* [PATCH xf86-video-ati 1/4] Don't rely on randr_crtc->scanout_pixmap in drmmode_set_scanout_pixmap
[not found] ` <20161025084128.25410-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2016-10-25 8:41 ` Michel Dänzer
2016-10-25 8:41 ` [PATCH xf86-video-ati 2/4] Always call PixmapStopDirtyTracking " Michel Dänzer
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michel Dänzer @ 2016-10-25 8:41 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Michel Dänzer <michel.daenzer@amd.com>
RRReplaceScanoutPixmap may set randr_crtc->scanout_pixmap = NULL before
we get here.
(Inspired by xserver commit f4c37eeee7953df1fe0e3196eda452acf0078e61)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
src/drmmode_display.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2cb5931..00a484b 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1144,11 +1144,18 @@ 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);
- return TRUE;
+ 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);
+ return TRUE;
+ }
}
if (!drmmode_crtc_scanout_create(crtc, &drmmode_crtc->scanout[0],
--
2.10.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH xf86-video-ati 2/4] Always call PixmapStopDirtyTracking in drmmode_set_scanout_pixmap
[not found] ` <20161025084128.25410-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-10-25 8:41 ` [PATCH xf86-video-ati 1/4] Don't rely on randr_crtc->scanout_pixmap in drmmode_set_scanout_pixmap Michel Dänzer
@ 2016-10-25 8:41 ` Michel Dänzer
2016-10-25 8:41 ` [PATCH xf86-video-ati 3/4] PRIME: Fix swapping of provider sink / source capabilities Michel Dänzer
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michel Dänzer @ 2016-10-25 8:41 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Michel Dänzer <michel.daenzer@amd.com>
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)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
src/drmmode_display.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 00a484b..a5a34fd 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1142,22 +1142,22 @@ 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);
- return TRUE;
- }
+ 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,
ppix->drawable.height))
--
2.10.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH xf86-video-ati 3/4] PRIME: Fix swapping of provider sink / source capabilities
[not found] ` <20161025084128.25410-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-10-25 8:41 ` [PATCH xf86-video-ati 1/4] Don't rely on randr_crtc->scanout_pixmap in drmmode_set_scanout_pixmap Michel Dänzer
2016-10-25 8:41 ` [PATCH xf86-video-ati 2/4] Always call PixmapStopDirtyTracking " Michel Dänzer
@ 2016-10-25 8:41 ` Michel Dänzer
2016-10-25 8:41 ` [PATCH xf86-video-ati 4/4] Consume all available udev events at once Michel Dänzer
2016-10-25 14:30 ` [PATCH xf86-video-ati 0/4] Fixes ported from / inspired by modesetting driver changes Deucher, Alexander
4 siblings, 0 replies; 6+ messages in thread
From: Michel Dänzer @ 2016-10-25 8:41 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Hans de Goede <hdegoede@redhat.com>
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@redhat.com>
(Ported from xserver commit 94a1c77259ce39ba59ad87615df39b570ffab435)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
src/radeon_kms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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;
}
--
2.10.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH xf86-video-ati 4/4] Consume all available udev events at once
[not found] ` <20161025084128.25410-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
` (2 preceding siblings ...)
2016-10-25 8:41 ` [PATCH xf86-video-ati 3/4] PRIME: Fix swapping of provider sink / source capabilities Michel Dänzer
@ 2016-10-25 8:41 ` Michel Dänzer
2016-10-25 14:30 ` [PATCH xf86-video-ati 0/4] Fixes ported from / inspired by modesetting driver changes Deucher, Alexander
4 siblings, 0 replies; 6+ messages in thread
From: Michel Dänzer @ 2016-10-25 8:41 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Michel Dänzer <michel.daenzer@amd.com>
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)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
src/drmmode_display.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
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
--
2.10.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH xf86-video-ati 0/4] Fixes ported from / inspired by modesetting driver changes
[not found] ` <20161025084128.25410-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
` (3 preceding siblings ...)
2016-10-25 8:41 ` [PATCH xf86-video-ati 4/4] Consume all available udev events at once Michel Dänzer
@ 2016-10-25 14:30 ` Deucher, Alexander
4 siblings, 0 replies; 6+ messages in thread
From: Deucher, Alexander @ 2016-10-25 14:30 UTC (permalink / raw)
To: 'Michel Dänzer', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Michel Dänzer
> Sent: Tuesday, October 25, 2016 4:41 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH xf86-video-ati 0/4] Fixes ported from / inspired by
> modesetting driver changes
>
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> Hans de Goede (1):
> PRIME: Fix swapping of provider sink / source capabilities
>
> Michel Dänzer (3):
> Don't rely on randr_crtc->scanout_pixmap in
> drmmode_set_scanout_pixmap
> Always call PixmapStopDirtyTracking in drmmode_set_scanout_pixmap
> Consume all available udev events at once
For the series:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
> src/drmmode_display.c | 30 ++++++++++++++++++++----------
> src/radeon_kms.c | 4 ++--
> 2 files changed, 22 insertions(+), 12 deletions(-)
>
> --
> 2.10.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread