Re: [PATCH 07/12] drm/msm: merge dpu_format and mdp_format in struct msm_format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 12/2/2023 1:40 PM, Dmitry Baryshkov wrote:
Structures dpu_format and mdp_format are largely the same structures.
In order to remove duplication between format databases, merge these two
stucture definitions into the global struct msm_format.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  12 +-
  .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |   2 +-
  .../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c   |   2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c   | 184 ++++++++++--------
  drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h   |   2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c   |  10 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h   |   2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h   |  41 +---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c   |  30 +--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h   |   6 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c   |  14 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h   |   4 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c     |  16 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h     |   2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c     |  74 +++----
  drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c     |   4 +-
  drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c    |  26 +--
  drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c     |   7 +-
  drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c    |  54 ++---
  drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c      |   4 +-
  drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.h      |   2 +-
  drivers/gpu/drm/msm/disp/mdp_format.c         |  28 ++-
  drivers/gpu/drm/msm/disp/mdp_kms.h            |  13 --
  drivers/gpu/drm/msm/msm_drv.h                 |  28 +++
  24 files changed, 279 insertions(+), 288 deletions(-)


<snip>

  int mdp5_smp_assign(struct mdp5_smp *smp, struct mdp5_smp_state *state,
diff --git a/drivers/gpu/drm/msm/disp/mdp_format.c b/drivers/gpu/drm/msm/disp/mdp_format.c
index 30919641c813..5fc55f41e74f 100644
--- a/drivers/gpu/drm/msm/disp/mdp_format.c
+++ b/drivers/gpu/drm/msm/disp/mdp_format.c
@@ -63,26 +63,24 @@ static struct csc_cfg csc_convert[CSC_MAX] = {
  };
#define FMT(name, a, r, g, b, e0, e1, e2, e3, alpha, tight, c, cnt, fp, cs, yuv) { \
-		.base = {                                        \
-			.pixel_format = DRM_FORMAT_ ## name,     \
-			.flags = yuv ? MSM_FORMAT_FLAG_YUV : 0,  \
-		},                                               \
+		.pixel_format = DRM_FORMAT_ ## name,             \
  		.bpc_a = BPC ## a ## A,                          \
-		.bpc_r = BPC ## r,                               \
-		.bpc_g = BPC ## g,                               \
-		.bpc_b = BPC ## b,                               \
-		.unpack = { e0, e1, e2, e3 },                    \
+		.bpc_r_cr = BPC ## r,                            \
+		.bpc_g_y = BPC ## g,                             \
+		.bpc_b_cb = BPC ## b,                            \
+		.element = { e0, e1, e2, e3 },                   \
+		.fetch_type = fp,                                \
+		.chroma_sample = cs,                             \
  		.alpha_enable = alpha,                           \
  		.unpack_tight = tight,                           \
-		.cpp = c,                                        \
  		.unpack_count = cnt,                             \
-		.fetch_type = fp,                                \
-		.chroma_sample = cs,                             \

Minor nit:

These two lines are only moving the locations of assignment so unnecessary change?

Rest LGTM,

Reviewed-by: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>

For validation, are you relying mostly on the CI here OR also other internal farms? Even though mostly its just making code common, basic display coming up on one target each of MDP4/MDP5/DPU will be great to be safe.



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux