drm/msm/dpu: move CSC tables to dpu_hw_util.c
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 13 Dec 2023 00:57:28 +0000 (02:57 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 14 Dec 2023 07:27:45 +0000 (09:27 +0200)
Move CSC tables out of the header file to fix following kind of warnings:

In file included from drivers/gpu/drm/msm/disp/dpu1/dpu_hwio.h:8,
                 from drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c:5:
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h:54:33: warning: ‘dpu_csc10_rgb2yuv_601l’ defined but not used [-Wunused-const-variable=]
   54 | static const struct dpu_csc_cfg dpu_csc10_rgb2yuv_601l = {
      |                                 ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h:39:33: warning: ‘dpu_csc10_YUV2RGB_601L’ defined but not used [-Wunused-const-variable=]
   39 | static const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L = {
      |                                 ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h:24:33: warning: ‘dpu_csc_YUV2RGB_601L’ defined but not used [-Wunused-const-variable=]
   24 | static const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = {
      |                                 ^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/571869/
Link: https://lore.kernel.org/r/20231213005728.53060-1-dmitry.baryshkov@linaro.org
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h

index 0b05061e3e62191200d2247a79fcb3762ab447f5..395fdcea28b9bd3d7d09df20b18660a42e00ad7c 100644 (file)
@@ -561,3 +561,47 @@ bool dpu_hw_clk_force_ctrl(struct dpu_hw_blk_reg_map *c,
 
        return clk_forced_on;
 }
+
+#define TO_S15D16(_x_)((_x_) << 7)
+
+const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = {
+       {
+               /* S15.16 format */
+               0x00012A00, 0x00000000, 0x00019880,
+               0x00012A00, 0xFFFF9B80, 0xFFFF3000,
+               0x00012A00, 0x00020480, 0x00000000,
+       },
+       /* signed bias */
+       { 0xfff0, 0xff80, 0xff80,},
+       { 0x0, 0x0, 0x0,},
+       /* unsigned clamp */
+       { 0x10, 0xeb, 0x10, 0xf0, 0x10, 0xf0,},
+       { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,},
+};
+
+const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L = {
+       {
+               /* S15.16 format */
+               0x00012A00, 0x00000000, 0x00019880,
+               0x00012A00, 0xFFFF9B80, 0xFFFF3000,
+               0x00012A00, 0x00020480, 0x00000000,
+       },
+       /* signed bias */
+       { 0xffc0, 0xfe00, 0xfe00,},
+       { 0x0, 0x0, 0x0,},
+       /* unsigned clamp */
+       { 0x40, 0x3ac, 0x40, 0x3c0, 0x40, 0x3c0,},
+       { 0x00, 0x3ff, 0x00, 0x3ff, 0x00, 0x3ff,},
+};
+
+const struct dpu_csc_cfg dpu_csc10_rgb2yuv_601l = {
+       {
+               TO_S15D16(0x0083), TO_S15D16(0x0102), TO_S15D16(0x0032),
+               TO_S15D16(0x1fb5), TO_S15D16(0x1f6c), TO_S15D16(0x00e1),
+               TO_S15D16(0x00e1), TO_S15D16(0x1f45), TO_S15D16(0x1fdc)
+       },
+       { 0x00, 0x00, 0x00 },
+       { 0x0040, 0x0200, 0x0200 },
+       { 0x000, 0x3ff, 0x000, 0x3ff, 0x000, 0x3ff },
+       { 0x040, 0x3ac, 0x040, 0x3c0, 0x040, 0x3c0 },
+};
index c0aaad2023da693719119f974dcd1d7e9cea5a25..25cc13b57756bb38e84f0cfba0dbe356635dd672 100644 (file)
 
 #define TO_S15D16(_x_)((_x_) << 7)
 
-static const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = {
-       {
-               /* S15.16 format */
-               0x00012A00, 0x00000000, 0x00019880,
-               0x00012A00, 0xFFFF9B80, 0xFFFF3000,
-               0x00012A00, 0x00020480, 0x00000000,
-       },
-       /* signed bias */
-       { 0xfff0, 0xff80, 0xff80,},
-       { 0x0, 0x0, 0x0,},
-       /* unsigned clamp */
-       { 0x10, 0xeb, 0x10, 0xf0, 0x10, 0xf0,},
-       { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,},
-};
-
-static const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L = {
-       {
-               /* S15.16 format */
-               0x00012A00, 0x00000000, 0x00019880,
-               0x00012A00, 0xFFFF9B80, 0xFFFF3000,
-               0x00012A00, 0x00020480, 0x00000000,
-       },
-       /* signed bias */
-       { 0xffc0, 0xfe00, 0xfe00,},
-       { 0x0, 0x0, 0x0,},
-       /* unsigned clamp */
-       { 0x40, 0x3ac, 0x40, 0x3c0, 0x40, 0x3c0,},
-       { 0x00, 0x3ff, 0x00, 0x3ff, 0x00, 0x3ff,},
-};
-
-static const struct dpu_csc_cfg dpu_csc10_rgb2yuv_601l = {
-       {
-               TO_S15D16(0x0083), TO_S15D16(0x0102), TO_S15D16(0x0032),
-               TO_S15D16(0x1fb5), TO_S15D16(0x1f6c), TO_S15D16(0x00e1),
-               TO_S15D16(0x00e1), TO_S15D16(0x1f45), TO_S15D16(0x1fdc)
-       },
-       { 0x00, 0x00, 0x00 },
-       { 0x0040, 0x0200, 0x0200 },
-       { 0x000, 0x3ff, 0x000, 0x3ff, 0x000, 0x3ff },
-       { 0x040, 0x3ac, 0x040, 0x3c0, 0x040, 0x3c0 },
-};
+extern const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L;
+extern const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L;
+extern const struct dpu_csc_cfg dpu_csc10_rgb2yuv_601l;
 
 /*
  * This is the common struct maintained by each sub block