disp: msm: fix fence set on drm plane
Chaining of dma-fence need to be used for chaining fences of buffer objects of each color plane. Max color planes currently supported in upstrean is 4. Current logic incorrectly referring drm-plane index instead of color plane index and fails to get buffer object. This change fixes the buffer object indexing beyond max color planes and dma-fence chain usage. Change-Id: I20618d3617ee638432e4e2d68540e345c241ee97 Signed-off-by: Prabhanjan Kandula <quic_pkandula@quicinc.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||||
* Copyright (C) 2014 Red Hat
|
* Copyright (C) 2014 Red Hat
|
||||||
* Author: Rob Clark <robdclark@gmail.com>
|
* Author: Rob Clark <robdclark@gmail.com>
|
||||||
@@ -806,26 +806,29 @@ int msm_atomic_commit(struct drm_device *dev,
|
|||||||
new_plane_state, i) {
|
new_plane_state, i) {
|
||||||
if ((new_plane_state->fb != old_plane_state->fb)
|
if ((new_plane_state->fb != old_plane_state->fb)
|
||||||
&& new_plane_state->fb) {
|
&& new_plane_state->fb) {
|
||||||
struct drm_gem_object *obj =
|
struct drm_gem_object *obj;
|
||||||
|
struct msm_gem_object *msm_obj;
|
||||||
|
struct dma_fence *fence;
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
|
||||||
msm_framebuffer_bo(new_plane_state->fb, i);
|
int j;
|
||||||
|
|
||||||
|
for (j = 0; j < new_plane_state->fb->format->num_planes; ++j) {
|
||||||
|
obj = msm_framebuffer_bo(new_plane_state->fb, j);
|
||||||
|
msm_obj = to_msm_bo(obj);
|
||||||
|
fence = msm_dma_resv_get_excl(new_plane_state, msm_obj);
|
||||||
|
dma_fence_put(new_plane_state->fence);
|
||||||
|
new_plane_state->fence = fence;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
msm_framebuffer_bo(new_plane_state->fb, 0);
|
obj = msm_framebuffer_bo(new_plane_state->fb, 0);
|
||||||
#endif
|
msm_obj = to_msm_bo(obj);
|
||||||
struct msm_gem_object *msm_obj = to_msm_bo(obj);
|
fence =
|
||||||
struct dma_fence *fence =
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0))
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
|
|
||||||
msm_dma_resv_get_excl(new_plane_state, msm_obj);
|
|
||||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0))
|
|
||||||
dma_resv_get_excl_unlocked(msm_obj->resv);
|
dma_resv_get_excl_unlocked(msm_obj->resv);
|
||||||
#else
|
#else
|
||||||
dma_resv_get_excl_rcu(msm_obj->resv);
|
dma_resv_get_excl_rcu(msm_obj->resv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
|
|
||||||
dma_fence_put(new_plane_state->fence);
|
|
||||||
new_plane_state->fence = fence;
|
|
||||||
#else
|
|
||||||
drm_atomic_set_fence_for_plane(new_plane_state, fence);
|
drm_atomic_set_fence_for_plane(new_plane_state, fence);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user