[PATCH 5/8] Don't advertise rotation support without hardware acceleration v2

Michel Dänzer michel at daenzer.net
Tue Nov 10 23:16:03 PST 2015


From: Michel Dänzer <michel.daenzer at amd.com>

Rotation currently doesn't work without acceleration (doesn't actually
rotate with Option "NoAccel", crashes with Option "AccelMethod" "none"
or when glamor fails to initialize) and would probably be too slow
anyway.

v2: Also remove now dead code checking for ShadowFB from
    drmmode_crtc_scanout_allocate().

(ported from amdgpu commit dc40582d5ff94d812cbc08f95cf14b80cd0f410d)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 561b55e..4397c51 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -522,7 +522,6 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
 			      int width, int height)
 {
 	ScrnInfoPtr pScrn = crtc->scrn;
-	RADEONInfoPtr info = RADEONPTR(pScrn);
 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 	drmmode_ptr drmmode = drmmode_crtc->drmmode;
 	int aligned_height;
@@ -531,13 +530,6 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc,
 	unsigned long rotate_pitch;
 	int base_align;
 
-	/* rotation requires acceleration */
-	if (info->r600_shadow_fb) {
-		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-			   "Rotation requires acceleration!\n");
-		return NULL;
-	}
-
 	if (scanout->bo) {
 		if (scanout->width == width && scanout->height == height)
 			return scanout->bo->ptr;
@@ -983,7 +975,7 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
 }
 #endif
 
-static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+static xf86CrtcFuncsRec drmmode_crtc_funcs = {
     .dpms = drmmode_crtc_dpms,
     .set_mode_major = drmmode_set_mode_major,
     .set_cursor_colors = drmmode_set_cursor_colors,
@@ -2066,6 +2058,7 @@ drm_wakeup_handler(pointer data, int err, pointer p)
 Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
 {
 	RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+	RADEONInfoPtr info = RADEONPTR(pScrn);
 	int i, num_dvi = 0, num_hdmi = 0;
 	drmModeResPtr mode_res;
 	unsigned int crtcs_needed = 0;
@@ -2086,8 +2079,16 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
 	xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
 		       "%d crtcs needed for screen.\n", crtcs_needed);
 
+	if (info->r600_shadow_fb) {
+		/* Rotation requires hardware acceleration */
+		drmmode_crtc_funcs.shadow_allocate = NULL;
+		drmmode_crtc_funcs.shadow_create = NULL;
+		drmmode_crtc_funcs.shadow_destroy = NULL;
+	}
+
 	drmmode->count_crtcs = mode_res->count_crtcs;
 	xf86CrtcSetSizeRange(pScrn, 320, 200, mode_res->max_width, mode_res->max_height);
+
 	for (i = 0; i < mode_res->count_crtcs; i++)
 		if (!xf86IsEntityShared(pScrn->entityList[0]) ||
 		    (crtcs_needed && !(pRADEONEnt->assigned_crtcs & (1 << i))))
-- 
2.6.2



More information about the xorg-driver-ati mailing list