diff options
author | Mario Kleiner <mario.kleiner.de@gmail.com> | 2018-01-22 03:14:34 +0100 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2018-01-22 12:05:51 +0100 |
commit | 21f6753462464acfd3c452393328c977a375ce26 (patch) | |
tree | 07241a65f99682a44bb3bdbd6b410fd85f289e32 /src | |
parent | 1fe8ca75974c5241c3b556b757f9c966c9ce5002 (diff) |
Define per x-screen individual drmmode_crtc_funcs
This allows to en-/disable some functions depending on individual screen
settings.
Prep work for more efficient depth 30 support.
Suggested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 14 | ||||
-rw-r--r-- | src/radeon.h | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index f55677f6..b1c874c7 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1395,8 +1395,9 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res xf86CrtcPtr crtc; drmmode_crtc_private_ptr drmmode_crtc; RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); + RADEONInfoPtr info = RADEONPTR(pScrn); - crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs); + crtc = xf86CrtcCreate(pScrn, &info->drmmode_crtc_funcs); if (crtc == NULL) return 0; @@ -2531,11 +2532,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); + /* Need per-screen drmmode_crtc_funcs, based on our global template, + * so we can disable some functions, depending on screen settings. + */ + info->drmmode_crtc_funcs = drmmode_crtc_funcs; + 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; + info->drmmode_crtc_funcs.shadow_allocate = NULL; + info->drmmode_crtc_funcs.shadow_create = NULL; + info->drmmode_crtc_funcs.shadow_destroy = NULL; } drmmode->count_crtcs = mode_res->count_crtcs; diff --git a/src/radeon.h b/src/radeon.h index 9658e029..5b717364 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -635,6 +635,8 @@ typedef struct { SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking; } glamor; #endif /* USE_GLAMOR */ + + xf86CrtcFuncsRec drmmode_crtc_funcs; } RADEONInfoRec, *RADEONInfoPtr; /* radeon_accel.c */ |