xf86-video-ati: Branch 'master' - 2 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Thu Aug 17 07:11:08 UTC 2017
src/radeon_drm_queue.c | 2 -
src/radeon_kms.c | 85 ++++++++++++++++++++-----------------------------
src/radeon_list.h | 7 ++++
3 files changed, 44 insertions(+), 50 deletions(-)
New commits:
commit 3e24770b1b472fc15df56d06f5f04778c9db63dd
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Aug 9 13:02:34 2017 +0900
Use xorg_list_append for the DRM event list
We were adding entries at the start of the list, i.e. the list was
ordered from most recently added to least recently added. However, the
corresponding DRM events are generally expected to arrive in the same
order as they are queued, which means that radeon_drm_queue_alloc would
generally have to traverse the whole list to find the entry
corresponding to an arrived event. Fix this by adding entries at the end
of the list.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c
index 31f24350..37fdafeb 100644
--- a/src/radeon_drm_queue.c
+++ b/src/radeon_drm_queue.c
@@ -105,7 +105,7 @@ radeon_drm_queue_alloc(xf86CrtcPtr crtc, ClientPtr client,
e->handler = handler;
e->abort = abort;
- xorg_list_add(&e->list, &radeon_drm_queue);
+ xorg_list_append(&e->list, &radeon_drm_queue);
return e->seq;
}
diff --git a/src/radeon_list.h b/src/radeon_list.h
index a0038c96..f9e4ff73 100644
--- a/src/radeon_list.h
+++ b/src/radeon_list.h
@@ -35,6 +35,13 @@
#define xorg_list_del list_del
#define xorg_list_for_each_entry list_for_each_entry
#define xorg_list_for_each_entry_safe list_for_each_entry_safe
+
+static inline void
+xorg_list_append(struct list *entry, struct list *head)
+{
+ __list_add(entry, head->prev, head);
+}
+
#endif
#endif /* _RADEON_LIST_H_ */
commit 36ce7920136c0d723c9397a84e7dd5926a9c7943
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Aug 9 19:01:15 2017 +0900
Consolidate radeon_scanout_flip_abort/handler helpers
While at it, make them use crtc->driver_private.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 7febf148..4c001a31 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -518,6 +518,38 @@ radeon_sync_scanout_pixmaps(xf86CrtcPtr xf86_crtc, RegionPtr new_region,
RegionUninit(&remaining);
}
+static void
+radeon_scanout_flip_abort(xf86CrtcPtr crtc, void *event_data)
+{
+ RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+ drmmode_crtc->scanout_update_pending = FALSE;
+ drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending,
+ NULL);
+}
+
+static void
+radeon_scanout_flip_handler(xf86CrtcPtr crtc, uint32_t msc, uint64_t usec,
+ void *event_data)
+{
+ RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+ drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb,
+ drmmode_crtc->flip_pending);
+ radeon_scanout_flip_abort(crtc, event_data);
+
+#ifdef HAVE_PRESENT_H
+ if (drmmode_crtc->present_vblank_event_id) {
+ present_event_notify(drmmode_crtc->present_vblank_event_id,
+ drmmode_crtc->present_vblank_usec,
+ drmmode_crtc->present_vblank_msc);
+ drmmode_crtc->present_vblank_event_id = 0;
+ }
+#endif
+}
+
#ifdef RADEON_PIXMAP_SHARING
static RegionPtr
@@ -763,38 +795,6 @@ radeon_prime_scanout_update(PixmapDirtyUpdatePtr dirty)
}
static void
-radeon_prime_scanout_flip_abort(xf86CrtcPtr crtc, void *event_data)
-{
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
- drmmode_crtc_private_ptr drmmode_crtc = event_data;
-
- drmmode_crtc->scanout_update_pending = FALSE;
- drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending,
- NULL);
-}
-
-static void
-radeon_prime_scanout_flip_handler(xf86CrtcPtr crtc, uint32_t msc, uint64_t usec,
- void *event_data)
-{
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
- drmmode_crtc_private_ptr drmmode_crtc = event_data;
-
- drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb,
- drmmode_crtc->flip_pending);
- radeon_prime_scanout_flip_abort(crtc, event_data);
-
-#ifdef HAVE_PRESENT_H
- if (drmmode_crtc->present_vblank_event_id) {
- present_event_notify(drmmode_crtc->present_vblank_event_id,
- drmmode_crtc->present_vblank_usec,
- drmmode_crtc->present_vblank_msc);
- drmmode_crtc->present_vblank_event_id = 0;
- }
-#endif
-}
-
-static void
radeon_prime_scanout_flip(PixmapDirtyUpdatePtr ent)
{
ScreenPtr screen = ent->slave_dst->drawable.pScreen;
@@ -821,9 +821,9 @@ radeon_prime_scanout_flip(PixmapDirtyUpdatePtr ent)
drm_queue_seq = radeon_drm_queue_alloc(crtc,
RADEON_DRM_QUEUE_CLIENT_DEFAULT,
RADEON_DRM_QUEUE_ID_DEFAULT,
- drmmode_crtc,
- radeon_prime_scanout_flip_handler,
- radeon_prime_scanout_flip_abort);
+ NULL,
+ radeon_scanout_flip_handler,
+ radeon_scanout_flip_abort);
if (drm_queue_seq == RADEON_DRM_QUEUE_ERROR) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"Allocating DRM event queue entry failed for PRIME flip.\n");
@@ -1082,19 +1082,6 @@ radeon_scanout_update(xf86CrtcPtr xf86_crtc)
}
static void
-radeon_scanout_flip_abort(xf86CrtcPtr crtc, void *event_data)
-{
- radeon_prime_scanout_flip_abort(crtc, event_data);
-}
-
-static void
-radeon_scanout_flip_handler(xf86CrtcPtr crtc, uint32_t msc, uint64_t usec,
- void *event_data)
-{
- radeon_prime_scanout_flip_handler(crtc, msc, usec, event_data);
-}
-
-static void
radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
xf86CrtcPtr xf86_crtc)
{
@@ -1120,7 +1107,7 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
drm_queue_seq = radeon_drm_queue_alloc(xf86_crtc,
RADEON_DRM_QUEUE_CLIENT_DEFAULT,
RADEON_DRM_QUEUE_ID_DEFAULT,
- drmmode_crtc,
+ NULL,
radeon_scanout_flip_handler,
radeon_scanout_flip_abort);
if (drm_queue_seq == RADEON_DRM_QUEUE_ERROR) {
More information about the xorg-commit
mailing list