[PATCH xf86-video-ati 05/15] Only add main fb if necessary
Michel Dänzer
michel at daenzer.net
Wed Sep 21 09:50:44 UTC 2016
From: Hans de Goede <hdegoede at redhat.com>
If we're doing reverse-prime; or doing rotation the main fb is not used,
and there is no reason to add it in this case.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
(Ported from xserver commit 4313122dea0df9affc280ee698e929489061ccc6)
(Ported from amdgpu commit a3ca1500703837cbb8d49c554199a25dea7d5e1e)
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
src/drmmode_display.c | 44 ++++++++++++++++----------------------------
1 file changed, 16 insertions(+), 28 deletions(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 4f25ae7..25c0e99 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -734,34 +734,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
int i;
int fb_id;
drmModeModeInfo kmode;
- int pitch;
- uint32_t tiling_flags = 0;
-
- if (info->allowColorTiling) {
- if (info->ChipFamily >= CHIP_FAMILY_R600)
- tiling_flags |= RADEON_TILING_MICRO;
- else
- tiling_flags |= RADEON_TILING_MACRO;
- }
-
- pitch = RADEON_ALIGN(pScrn->displayWidth, drmmode_get_pitch_align(pScrn, info->pixel_bytes, tiling_flags)) *
- info->pixel_bytes;
- if (info->ChipFamily >= CHIP_FAMILY_R600) {
- pitch = info->front_surface.level[0].pitch_bytes;
- }
-
- if (drmmode->fb_id == 0) {
- ret = drmModeAddFB(drmmode->fd,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->depth, pScrn->bitsPerPixel,
- pitch,
- info->front_bo->handle,
- &drmmode->fb_id);
- if (ret < 0) {
- ErrorF("failed to add fb\n");
- return FALSE;
- }
- }
saved_mode = crtc->mode;
saved_x = crtc->x;
@@ -869,6 +841,22 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
}
}
+ if (fb_id == 0) {
+ if (drmModeAddFB(drmmode->fd,
+ pScrn->virtualX,
+ pScrn->virtualY,
+ pScrn->depth, pScrn->bitsPerPixel,
+ pScrn->displayWidth * info->pixel_bytes,
+ info->front_bo->handle,
+ &drmmode->fb_id) < 0) {
+ ErrorF("failed to add fb\n");
+ ret = FALSE;
+ goto done;
+ }
+
+ fb_id = drmmode->fb_id;
+ }
+
/* Wait for any pending flip to finish */
do {} while (drmmode_crtc->flip_pending &&
drmHandleEvent(drmmode->fd,
--
2.9.3
More information about the amd-gfx
mailing list