drm/msm: Use drm_gem_fb_prepare_fb

msm has switched over to drm_fb->obj[] a while ago already, so we can
just use the helper.

v2: Make it compile ... oops.

Cc: Eric Anholt <eric@anholt.net>
Cc: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Jeykumar Sankaran <jsanka@codeaurora.org>
Cc: Jordan Crouse <jcrouse@codeaurora.org>
Cc: Bruce Wang <bzwang@chromium.org>
Cc: Fritz Koenig <frkoenig@google.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190625204208.5614-3-daniel.vetter@ffwll.ch
This commit is contained in:
Daniel Vetter 2019-06-25 22:42:03 +02:00
parent bd630a86be
commit e78ad76541
2 changed files with 4 additions and 12 deletions

View file

@ -22,6 +22,7 @@
#include <linux/dma-buf.h> #include <linux/dma-buf.h>
#include <drm/drm_atomic_uapi.h> #include <drm/drm_atomic_uapi.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include "msm_drv.h" #include "msm_drv.h"
#include "dpu_kms.h" #include "dpu_kms.h"
@ -774,8 +775,6 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
struct dpu_plane *pdpu = to_dpu_plane(plane); struct dpu_plane *pdpu = to_dpu_plane(plane);
struct dpu_plane_state *pstate = to_dpu_plane_state(new_state); struct dpu_plane_state *pstate = to_dpu_plane_state(new_state);
struct dpu_hw_fmt_layout layout; struct dpu_hw_fmt_layout layout;
struct drm_gem_object *obj;
struct dma_fence *fence;
struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base); struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
int ret; int ret;
@ -792,10 +791,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
* we can use msm_atomic_prepare_fb() instead of doing the * we can use msm_atomic_prepare_fb() instead of doing the
* implicit fence and fb prepare by hand here. * implicit fence and fb prepare by hand here.
*/ */
obj = msm_framebuffer_bo(new_state->fb, 0); drm_gem_fb_prepare_fb(plane, new_state);
fence = reservation_object_get_excl_rcu(obj->resv);
if (fence)
drm_atomic_set_fence_for_plane(new_state, fence);
if (pstate->aspace) { if (pstate->aspace) {
ret = msm_framebuffer_prepare(new_state->fb, ret = msm_framebuffer_prepare(new_state->fb,

View file

@ -16,6 +16,7 @@
*/ */
#include <drm/drm_atomic_uapi.h> #include <drm/drm_atomic_uapi.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include "msm_drv.h" #include "msm_drv.h"
#include "msm_gem.h" #include "msm_gem.h"
@ -48,16 +49,11 @@ int msm_atomic_prepare_fb(struct drm_plane *plane,
{ {
struct msm_drm_private *priv = plane->dev->dev_private; struct msm_drm_private *priv = plane->dev->dev_private;
struct msm_kms *kms = priv->kms; struct msm_kms *kms = priv->kms;
struct drm_gem_object *obj;
struct dma_fence *fence;
if (!new_state->fb) if (!new_state->fb)
return 0; return 0;
obj = msm_framebuffer_bo(new_state->fb, 0); drm_gem_fb_prepare_fb(plane, new_state);
fence = reservation_object_get_excl_rcu(obj->resv);
drm_atomic_set_fence_for_plane(new_state, fence);
return msm_framebuffer_prepare(new_state->fb, kms->aspace); return msm_framebuffer_prepare(new_state->fb, kms->aspace);
} }