diff options
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_fb.c')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_drm_fb.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_fb.c b/drivers/gpu/drm/mediatek/mtk_drm_fb.c index 4c3ad7de2d3b..ae40b080ae47 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_fb.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_fb.c @@ -3,13 +3,14 @@ * Copyright (c) 2015 MediaTek Inc. */ -#include <drm/drmP.h> +#include <linux/dma-buf.h> +#include <linux/reservation.h> + #include <drm/drm_modeset_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <linux/dma-buf.h> -#include <linux/reservation.h> #include "mtk_drm_drv.h" #include "mtk_drm_fb.h" @@ -49,34 +50,6 @@ static struct drm_framebuffer *mtk_drm_framebuffer_init(struct drm_device *dev, return fb; } -/* - * Wait for any exclusive fence in fb's gem object's reservation object. - * - * Returns -ERESTARTSYS if interrupted, else 0. - */ -int mtk_fb_wait(struct drm_framebuffer *fb) -{ - struct drm_gem_object *gem; - struct reservation_object *resv; - long ret; - - if (!fb) - return 0; - - gem = fb->obj[0]; - if (!gem || !gem->dma_buf || !gem->dma_buf->resv) - return 0; - - resv = gem->dma_buf->resv; - ret = reservation_object_wait_timeout_rcu(resv, false, true, - MAX_SCHEDULE_TIMEOUT); - /* MAX_SCHEDULE_TIMEOUT on success, -ERESTARTSYS if interrupted */ - if (WARN_ON(ret < 0)) - return ret; - - return 0; -} - struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev, struct drm_file *file, const struct drm_mode_fb_cmd2 *cmd) |