xf86-video-ati: Branch 'master' - 3 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Tue Apr 12 09:16:05 UTC 2016
src/drmmode_display.c | 9 +++++++--
src/drmmode_display.h | 9 ++++++++-
src/radeon_dri2.c | 2 +-
src/radeon_kms.c | 11 +++++++----
src/radeon_present.c | 8 +++-----
5 files changed, 26 insertions(+), 13 deletions(-)
New commits:
commit 1ca677309720e2f6c953c9e76f5b34c22a4416c6
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Mar 15 16:47:35 2016 +0900
present: Support async flips
The xserver Present code only calls radeon_present_flip with
sync_flip=FALSE if radeon_present_screen_init sets
PresentCapabilityAsync, and the latter only sets it if the kernel driver
advertises support for async flips.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/radeon_present.c b/src/radeon_present.c
index c012fed..1eced4a 100644
--- a/src/radeon_present.c
+++ b/src/radeon_present.c
@@ -248,9 +248,6 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
if (info->hwcursor_disabled)
return FALSE;
- if (!sync_flip)
- return FALSE;
-
if (info->drmmode.dri2_flipping)
return FALSE;
@@ -339,7 +336,7 @@ radeon_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
event_id, event, crtc_id,
radeon_present_flip_event,
radeon_present_flip_abort,
- FLIP_VSYNC);
+ sync_flip ? FLIP_VSYNC : FLIP_ASYNC);
if (!ret)
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n");
else
commit 90a915c62d012e99193833aecc93974e68880c60
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Mar 15 16:42:16 2016 +0900
Add support for async flips to radeon_do_pageflip
Will be used by the next change. No functional change here.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index a368a41..4c66ca7 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2649,7 +2649,8 @@ void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode)
Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
uint32_t new_front_handle, uint64_t id, void *data,
int ref_crtc_hw_id, radeon_drm_handler_proc handler,
- radeon_drm_abort_proc abort)
+ radeon_drm_abort_proc abort,
+ enum drmmode_flip_sync flip_sync)
{
RADEONInfoPtr info = RADEONPTR(scrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -2659,6 +2660,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
unsigned int pitch;
int i;
uint32_t tiling_flags = 0;
+ uint32_t flip_flags = DRM_MODE_PAGE_FLIP_EVENT;
drmmode_flipdata_ptr flipdata;
uintptr_t drm_queue_seq = 0;
@@ -2705,6 +2707,9 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
flipdata->handler = handler;
flipdata->abort = abort;
+ if (flip_sync == FLIP_ASYNC)
+ flip_flags |= DRM_MODE_PAGE_FLIP_ASYNC;
+
for (i = 0; i < config->num_crtc; i++) {
crtc = config->crtc[i];
@@ -2731,7 +2736,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
}
if (drmModePageFlip(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
- drmmode->fb_id, DRM_MODE_PAGE_FLIP_EVENT,
+ drmmode->fb_id, flip_flags,
(void*)drm_queue_seq)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"flip queue failed: %s\n", strerror(errno));
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index c295735..83c6482 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -125,6 +125,12 @@ typedef struct {
} drmmode_output_private_rec, *drmmode_output_private_ptr;
+enum drmmode_flip_sync {
+ FLIP_VSYNC,
+ FLIP_ASYNC,
+};
+
+
extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp);
extern void drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
extern void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
@@ -151,7 +157,8 @@ extern int drmmode_get_base_align(ScrnInfoPtr scrn, int bpe, uint32_t tiling);
Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
uint32_t new_front_handle, uint64_t id, void *data,
int ref_crtc_hw_id, radeon_drm_handler_proc handler,
- radeon_drm_abort_proc abort);
+ radeon_drm_abort_proc abort,
+ enum drmmode_flip_sync flip_sync);
int drmmode_crtc_get_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc);
int drmmode_get_current_ust(int drm_fd, CARD64 *ust);
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 84cd031..62325bd 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -737,7 +737,7 @@ radeon_dri2_schedule_flip(xf86CrtcPtr crtc, ClientPtr client,
RADEON_DRM_QUEUE_ID_DEFAULT, flip_info,
ref_crtc_hw_id,
radeon_dri2_flip_event_handler,
- radeon_dri2_flip_event_abort)) {
+ radeon_dri2_flip_event_abort, FLIP_VSYNC)) {
info->drmmode.dri2_flipping = TRUE;
return TRUE;
}
diff --git a/src/radeon_present.c b/src/radeon_present.c
index 8988fc6..c012fed 100644
--- a/src/radeon_present.c
+++ b/src/radeon_present.c
@@ -338,7 +338,8 @@ radeon_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
ret = radeon_do_pageflip(scrn, RADEON_DRM_QUEUE_CLIENT_DEFAULT, handle,
event_id, event, crtc_id,
radeon_present_flip_event,
- radeon_present_flip_abort);
+ radeon_present_flip_abort,
+ FLIP_VSYNC);
if (!ret)
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n");
else
@@ -381,7 +382,7 @@ radeon_present_unflip(ScreenPtr screen, uint64_t event_id)
if (radeon_do_pageflip(scrn, RADEON_DRM_QUEUE_CLIENT_DEFAULT, handle,
event_id, event, -1, radeon_present_flip_event,
- radeon_present_flip_abort))
+ radeon_present_flip_abort, FLIP_VSYNC))
return;
modeset:
commit ba8b6288c8e6fc4be5d7144ecbe9a1f241881674
Author: Qiang Yu <Qiang.Yu at amd.com>
Date: Mon Apr 11 16:35:37 2016 +0900
Remove RR_Capability_SinkOutput for GPU without CRTC
Signed-off-by: Qiang Yu <Qiang.Yu at amd.com>
(Ported from amdgpu commit a0bbb373f902e0ffc14570c85faec7e44134f62e)
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index c5310ea..c35c951 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -1108,8 +1108,11 @@ static void RADEONSetupCapabilities(ScrnInfoPtr pScrn)
if (ret == 0) {
if (value & DRM_PRIME_CAP_EXPORT)
pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload;
- if (value & DRM_PRIME_CAP_IMPORT)
- pScrn->capabilities |= RR_Capability_SinkOutput | RR_Capability_SourceOffload;
+ if (value & DRM_PRIME_CAP_IMPORT) {
+ pScrn->capabilities |= RR_Capability_SourceOffload;
+ if (info->drmmode.count_crtcs)
+ pScrn->capabilities |= RR_Capability_SinkOutput;
+ }
}
#endif
}
@@ -1228,8 +1231,6 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
info->allowColorTiling2D = FALSE;
- RADEONSetupCapabilities(pScrn);
-
/* don't enable tiling if accel is not enabled */
if (!info->r600_shadow_fb) {
Bool colorTilingDefault =
@@ -1328,6 +1329,8 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
goto fail;
}
+ RADEONSetupCapabilities(pScrn);
+
if (info->drmmode.count_crtcs == 1)
pRADEONEnt->HasCRTC2 = FALSE;
else
More information about the xorg-commit
mailing list