[xserver,1/2] modesetting: Remove unnecessary fb addition from drmmode_xf86crtc_resize

Submitted by Hans de Goede on June 1, 2016, 7:04 p.m.

Details

Message ID 1464807881-9258-1-git-send-email-hdegoede@redhat.com
State Accepted
Headers show
Series "Series without cover letter" ( rev: 1 ) in X.org (DEPRECATED - USE GITLAB)

Not browsing as part of any series.

Commit Message

Hans de Goede June 1, 2016, 7:04 p.m.
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>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index e8a722e..2fe46e9 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1727,8 +1727,9 @@  drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
     old_width = scrn->virtualX;
     old_height = scrn->virtualY;
     old_pitch = drmmode_bo_get_pitch(&drmmode->front_bo);
-    old_fb_id = drmmode->fb_id;
     old_front = drmmode->front_bo;
+    old_fb_id = drmmode->fb_id;
+    drmmode->fb_id = 0;
 
     if (!drmmode_create_bo(drmmode, &drmmode->front_bo,
                            width, height, scrn->bitsPerPixel))
@@ -1740,13 +1741,6 @@  drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
     scrn->virtualY = height;
     scrn->displayWidth = pitch / cpp;
 
-    ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth,
-                       scrn->bitsPerPixel, pitch,
-                       drmmode_bo_get_handle(&drmmode->front_bo),
-                       &drmmode->fb_id);
-    if (ret)
-        goto fail;
-
     if (!drmmode->gbm) {
         new_pixels = drmmode_map_front_bo(drmmode);
         if (!new_pixels)