diff options
author | Hans de Goede <hdegoede@redhat.com> | 2016-06-01 15:11:05 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-06-23 10:58:11 +0900 |
commit | 9ca1c24235ff5ab2e028333fc326e2eff008c574 (patch) | |
tree | 4484f36fb05616cd5101b773aab5f124571713d7 | |
parent | 0d42082108c264568e2aadd15ace70e72388bc65 (diff) |
Remove unnecessary fb addition from drmmode_xf86crtc_resize
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@redhat.com>
(Ported from xserver commit 877453212166fdc912e0d687cdecee11aba563b5)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/drmmode_display.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 5d08b49..6a918e6 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1893,7 +1893,6 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) int i, pitch, old_width, old_height, old_pitch; int cpp = info->pixel_bytes; PixmapPtr ppix = screen->GetScreenPixmap(screen); - uint32_t bo_handle; void *fb_shadow; int hint = 0; xRectangle rect; @@ -1914,6 +1913,7 @@ static Bool 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_buffer; scrn->virtualX = width; @@ -1938,20 +1938,6 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) xf86DrvMsg(scrn->scrnIndex, X_INFO, " => pitch %d bytes\n", pitch); scrn->displayWidth = pitch / cpp; - if (!amdgpu_bo_get_handle(info->front_buffer, &bo_handle)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to get front buffer handle\n"); - goto fail; - } - - if (drmModeAddFB(pAMDGPUEnt->fd, width, height, scrn->depth, - scrn->bitsPerPixel, pitch, - bo_handle, &drmmode->fb_id) != 0) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "drmModeAddFB failed for front buffer\n"); - goto fail; - } - if (info->use_glamor || (info->front_buffer->flags & AMDGPU_BO_FLAGS_GBM)) { screen->ModifyPixmapHeader(ppix, |