xf86-video-amdgpu: Branch 'master' - 4 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Thu Oct 27 02:02:53 UTC 2016
src/amdgpu_kms.c | 4 ++--
src/drmmode_display.c | 30 ++++++++++++++++++++----------
2 files changed, 22 insertions(+), 12 deletions(-)
New commits:
commit 3c1f4386ba7d0b6c16bdd2b2178f978f2f154ba8
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Oct 26 16:19:01 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)
(Ported from radeon commit 22b5ce9548393ba2ff73ee234ecd82eeaf0ef6c4)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9dfef40..b03a8a7 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2479,12 +2479,15 @@ static void 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;
+ }
- amdgpu_mode_hotplug(scrn, drmmode);
- udev_device_unref(dev);
+ if (received)
+ amdgpu_mode_hotplug(scrn, drmmode);
}
#endif
commit c87dff3257e797cfd80d208c9a612b21978ff4eb
Author: Hans de Goede <hdegoede at redhat.com>
Date: Wed Oct 26 16:17:04 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)
(Ported from radeon commit 82d3c8f5500d2a6fb1495e217a0b79c396f1534c)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 4ae7995..6fa63e9 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1235,9 +1235,9 @@ static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn)
ret = drmGetCap(pAMDGPUEnt->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 9c4416422f2d07dbfa7c0b18beb1353f122fc1a1
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Oct 26 16:15:42 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)
(Ported from radeon commit 6c940446ddadf418ee4959e46fa552b6c1cf6704)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 5f0fdb0..9dfef40 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1103,23 +1103,21 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
AMDGPUInfoPtr info = AMDGPUPTR(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 0a91f11c03400e3f92a2b048505f39e7de7e87fc
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Oct 26 16:14:45 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.
(Cherry picked from radeon commit 61df12e2377cbb19a19ca9d5624df8959822da9f)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f291f6d..5f0fdb0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1105,10 +1105,19 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
AMDGPUInfoPtr info = AMDGPUPTR(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