[PATCH xf86-video-ati 04/15] Remove unnecessary fb addition from drmmode_xf86crtc_resize

Michel Dänzer michel at daenzer.net
Wed Sep 21 09:50:43 UTC 2016


From: Hans de Goede <hdegoede at redhat.com>

drmmode_set_mode_major() is the only user of drmmode->fb_id and will
create it if necessary.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
(Ported from xserver commit 877453212166fdc912e0d687cdecee11aba563b5)
(Ported from amdgpu commit 9ca1c24235ff5ab2e028333fc326e2eff008c574)

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

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 89922d6..4f25ae7 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1982,7 +1982,6 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	drmmode_ptr drmmode = drmmode_crtc->drmmode;
 	RADEONInfoPtr info = RADEONPTR(scrn);
 	struct radeon_bo *old_front = NULL;
-	Bool	    ret;
 	ScreenPtr   screen = xf86ScrnToScreen(scrn);
 	uint32_t    old_fb_id;
 	int	    i, pitch, old_width, old_height, old_pitch;
@@ -2085,6 +2084,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	old_height = scrn->virtualY;
 	old_pitch = scrn->displayWidth;
 	old_fb_id = drmmode->fb_id;
+	drmmode->fb_id = 0;
 	old_front = info->front_bo;
 
 	scrn->virtualX = width;
@@ -2115,13 +2115,6 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	if (tiling_flags)
 	    radeon_bo_set_tiling(info->front_bo, tiling_flags, pitch);
 
-	ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth,
-			   scrn->bitsPerPixel, pitch,
-			   info->front_bo->handle,
-			   &drmmode->fb_id);
-	if (ret)
-		goto fail;
-
 	if (!info->r600_shadow_fb) {
 		psurface = radeon_get_pixmap_surface(ppix);
 		*psurface = info->front_surface;
-- 
2.9.3



More information about the amd-gfx mailing list