diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2024-04-20 07:01:02 +0300 |
---|---|---|
committer | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2024-04-23 12:56:29 +0300 |
commit | 0e67f514486f0aec823415c379fc274dfa096c18 (patch) | |
tree | f4300d36f884625e163b98d34fe1495170b2a14c /drivers/gpu/drm/msm/disp/mdp_format.c | |
parent | 7120d8a0d35b02113595982aa683f93845acdc95 (diff) | |
download | linux-0e67f514486f0aec823415c379fc274dfa096c18.tar.xz |
drm/msm: merge dpu_format and mdp_format in struct msm_format
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.
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/590434/
Link: https://lore.kernel.org/r/20240420-dpu-format-v2-5-9e93226cbffd@linaro.org
Diffstat (limited to 'drivers/gpu/drm/msm/disp/mdp_format.c')
-rw-r--r-- | drivers/gpu/drm/msm/disp/mdp_format.c | 28 |
1 files changed, 13 insertions, 15 deletions
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, \ + .bpp = c, \ + .flags = yuv ? MSM_FORMAT_FLAG_YUV : 0, \ } #define BPC0A 0 -static const struct mdp_format formats[] = { +static const struct msm_format formats[] = { /* name a r g b e0 e1 e2 e3 alpha tight cpp cnt ... */ FMT(ARGB8888, 8, 8, 8, 8, 1, 0, 2, 3, true, true, 4, 4, MDP_PLANE_INTERLEAVED, CHROMA_FULL, false), @@ -141,9 +139,9 @@ const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format, { int i; for (i = 0; i < ARRAY_SIZE(formats); i++) { - const struct mdp_format *f = &formats[i]; - if (f->base.pixel_format == format) - return &f->base; + const struct msm_format *f = &formats[i]; + if (f->pixel_format == format) + return f; } return NULL; } |