summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-11-11 15:51:58 +0900
committerMichel Dänzer <michel@daenzer.net>2015-11-12 11:27:19 +0900
commit421a7e797bdd58d83e81af7a6512cc715a3df514 (patch)
tree9fdb3b4f10bbc4e010f60efe03df8f4ad088a6af
parent875ad48e7b5cdb7beefbf18dddcbee3ed22b5446 (diff)
Don't advertise rotation support without hardware acceleration v2
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) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/drmmode_display.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 561b55ed..4397c51c 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))))