xf86-video-ati: Branch 'master' - 4 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Wed Oct 26 07:12:57 UTC 2016
src/drmmode_display.c | 30 ++++++++++++++++++++----------
src/radeon_kms.c | 4 ++--
2 files changed, 22 insertions(+), 12 deletions(-)
New commits:
commit 22b5ce9548393ba2ff73ee234ecd82eeaf0ef6c4
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Oct 25 17:28:03 2016 +0900
Consume all available udev events at once
We get multiple udev events for actions like docking a laptop into its
station or plugging a monitor to the station. By consuming as many
events as we can, we reduce the number of output re-evalutions.
It depends on the timing how many events can be consumed at once.
(Inspired by xserver commit 363f4273dd4aec3e26cc57ecb6c20f27e6c813d8)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index a5a34fd..9cf4846 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2656,12 +2656,15 @@ drmmode_handle_uevents(int fd, void *closure)
drmmode_ptr drmmode = closure;
ScrnInfoPtr scrn = drmmode->scrn;
struct udev_device *dev;
- dev = udev_monitor_receive_device(drmmode->uevent_monitor);
- if (!dev)
- return;
+ Bool received = FALSE;
+
+ while ((dev = udev_monitor_receive_device(drmmode->uevent_monitor))) {
+ udev_device_unref(dev);
+ received = TRUE;
+ }
- radeon_mode_hotplug(scrn, drmmode);
- udev_device_unref(dev);
+ if (received)
+ radeon_mode_hotplug(scrn, drmmode);
}
#endif
commit 82d3c8f5500d2a6fb1495e217a0b79c396f1534c
Author: Hans de Goede <hdegoede at redhat.com>
Date: Tue Oct 25 16:56:40 2016 +0900
PRIME: Fix swapping of provider sink / source capabilities
When a card has import capability it can be an offload _sink_, not a
source and vice versa for export capability.
This went unnoticed sofar because most gpus have both import and export
capability.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
(Ported from xserver commit 94a1c77259ce39ba59ad87615df39b570ffab435)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index faa1e0f..68c7837 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -1587,9 +1587,9 @@ static void RADEONSetupCapabilities(ScrnInfoPtr pScrn)
ret = drmGetCap(info->dri2.drm_fd, DRM_CAP_PRIME, &value);
if (ret == 0) {
if (value & DRM_PRIME_CAP_EXPORT)
- pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload;
+ pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SourceOffload;
if (value & DRM_PRIME_CAP_IMPORT) {
- pScrn->capabilities |= RR_Capability_SourceOffload;
+ pScrn->capabilities |= RR_Capability_SinkOffload;
if (info->drmmode.count_crtcs)
pScrn->capabilities |= RR_Capability_SinkOutput;
}
commit 6c940446ddadf418ee4959e46fa552b6c1cf6704
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Oct 25 16:42:03 2016 +0900
Always call PixmapStopDirtyTracking in drmmode_set_scanout_pixmap
Otherwise, we may leak screen->pixmap_dirty_list entries if
drmmode_set_scanout_pixmap is called repatedly with ppix != NULL, which
can happen from RRReplaceScanoutPixmap.
(Inspired by xserver commit b773a9c8126222e5fed2904d012fbf917a9f22fd)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 3db0a96..a5a34fd 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1142,23 +1142,21 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
RADEONInfoPtr info = RADEONPTR(crtc->scrn);
+ ScreenPtr screen = crtc->scrn->pScreen;
+ PixmapDirtyUpdatePtr dirty;
- if (!ppix) {
- ScreenPtr screen = crtc->scrn->pScreen;
- PixmapDirtyUpdatePtr dirty;
-
- xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) {
- if (dirty->slave_dst !=
- drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
- continue;
+ xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) {
+ if (dirty->slave_dst !=
+ drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
+ continue;
- PixmapStopDirtyTracking(dirty->src, dirty->slave_dst);
- drmmode_crtc_scanout_free(drmmode_crtc);
- break;
- }
+ PixmapStopDirtyTracking(dirty->src, dirty->slave_dst);
+ drmmode_crtc_scanout_free(drmmode_crtc);
+ break;
+ }
+ if (!ppix)
return TRUE;
- }
if (!drmmode_crtc_scanout_create(crtc, &drmmode_crtc->scanout[0],
ppix->drawable.width,
commit 61df12e2377cbb19a19ca9d5624df8959822da9f
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Oct 19 18:55:33 2016 +0900
Don't rely on randr_crtc->scanout_pixmap in drmmode_set_scanout_pixmap
RRReplaceScanoutPixmap may set randr_crtc->scanout_pixmap = NULL before
we get here.
(Inspired by xserver commit f4c37eeee7953df1fe0e3196eda452acf0078e61)
v2: Always return TRUE in the if (!ppix) block.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com> (v1)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2cb5931..3db0a96 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1144,10 +1144,19 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
RADEONInfoPtr info = RADEONPTR(crtc->scrn);
if (!ppix) {
- if (crtc->randr_crtc->scanout_pixmap)
- PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap,
- drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap);
- drmmode_crtc_scanout_free(drmmode_crtc);
+ ScreenPtr screen = crtc->scrn->pScreen;
+ PixmapDirtyUpdatePtr dirty;
+
+ xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) {
+ if (dirty->slave_dst !=
+ drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
+ continue;
+
+ PixmapStopDirtyTracking(dirty->src, dirty->slave_dst);
+ drmmode_crtc_scanout_free(drmmode_crtc);
+ break;
+ }
+
return TRUE;
}
More information about the xorg-commit
mailing list