Skip to content

Commit aee797d

Browse files
committed
drm/msm/dpu: move CSC tables to dpu_hw_util.c
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
1 parent 45284ff commit aee797d

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,3 +561,47 @@ bool dpu_hw_clk_force_ctrl(struct dpu_hw_blk_reg_map *c,
561561

562562
return clk_forced_on;
563563
}
564+
565+
#define TO_S15D16(_x_)((_x_) << 7)
566+
567+
const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = {
568+
{
569+
/* S15.16 format */
570+
0x00012A00, 0x00000000, 0x00019880,
571+
0x00012A00, 0xFFFF9B80, 0xFFFF3000,
572+
0x00012A00, 0x00020480, 0x00000000,
573+
},
574+
/* signed bias */
575+
{ 0xfff0, 0xff80, 0xff80,},
576+
{ 0x0, 0x0, 0x0,},
577+
/* unsigned clamp */
578+
{ 0x10, 0xeb, 0x10, 0xf0, 0x10, 0xf0,},
579+
{ 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,},
580+
};
581+
582+
const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L = {
583+
{
584+
/* S15.16 format */
585+
0x00012A00, 0x00000000, 0x00019880,
586+
0x00012A00, 0xFFFF9B80, 0xFFFF3000,
587+
0x00012A00, 0x00020480, 0x00000000,
588+
},
589+
/* signed bias */
590+
{ 0xffc0, 0xfe00, 0xfe00,},
591+
{ 0x0, 0x0, 0x0,},
592+
/* unsigned clamp */
593+
{ 0x40, 0x3ac, 0x40, 0x3c0, 0x40, 0x3c0,},
594+
{ 0x00, 0x3ff, 0x00, 0x3ff, 0x00, 0x3ff,},
595+
};
596+
597+
const struct dpu_csc_cfg dpu_csc10_rgb2yuv_601l = {
598+
{
599+
TO_S15D16(0x0083), TO_S15D16(0x0102), TO_S15D16(0x0032),
600+
TO_S15D16(0x1fb5), TO_S15D16(0x1f6c), TO_S15D16(0x00e1),
601+
TO_S15D16(0x00e1), TO_S15D16(0x1f45), TO_S15D16(0x1fdc)
602+
},
603+
{ 0x00, 0x00, 0x00 },
604+
{ 0x0040, 0x0200, 0x0200 },
605+
{ 0x000, 0x3ff, 0x000, 0x3ff, 0x000, 0x3ff },
606+
{ 0x040, 0x3ac, 0x040, 0x3c0, 0x040, 0x3c0 },
607+
};

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,9 @@
2121

2222
#define TO_S15D16(_x_)((_x_) << 7)
2323

24-
static const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = {
25-
{
26-
/* S15.16 format */
27-
0x00012A00, 0x00000000, 0x00019880,
28-
0x00012A00, 0xFFFF9B80, 0xFFFF3000,
29-
0x00012A00, 0x00020480, 0x00000000,
30-
},
31-
/* signed bias */
32-
{ 0xfff0, 0xff80, 0xff80,},
33-
{ 0x0, 0x0, 0x0,},
34-
/* unsigned clamp */
35-
{ 0x10, 0xeb, 0x10, 0xf0, 0x10, 0xf0,},
36-
{ 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,},
37-
};
38-
39-
static const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L = {
40-
{
41-
/* S15.16 format */
42-
0x00012A00, 0x00000000, 0x00019880,
43-
0x00012A00, 0xFFFF9B80, 0xFFFF3000,
44-
0x00012A00, 0x00020480, 0x00000000,
45-
},
46-
/* signed bias */
47-
{ 0xffc0, 0xfe00, 0xfe00,},
48-
{ 0x0, 0x0, 0x0,},
49-
/* unsigned clamp */
50-
{ 0x40, 0x3ac, 0x40, 0x3c0, 0x40, 0x3c0,},
51-
{ 0x00, 0x3ff, 0x00, 0x3ff, 0x00, 0x3ff,},
52-
};
53-
54-
static const struct dpu_csc_cfg dpu_csc10_rgb2yuv_601l = {
55-
{
56-
TO_S15D16(0x0083), TO_S15D16(0x0102), TO_S15D16(0x0032),
57-
TO_S15D16(0x1fb5), TO_S15D16(0x1f6c), TO_S15D16(0x00e1),
58-
TO_S15D16(0x00e1), TO_S15D16(0x1f45), TO_S15D16(0x1fdc)
59-
},
60-
{ 0x00, 0x00, 0x00 },
61-
{ 0x0040, 0x0200, 0x0200 },
62-
{ 0x000, 0x3ff, 0x000, 0x3ff, 0x000, 0x3ff },
63-
{ 0x040, 0x3ac, 0x040, 0x3c0, 0x040, 0x3c0 },
64-
};
24+
extern const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L;
25+
extern const struct dpu_csc_cfg dpu_csc10_YUV2RGB_601L;
26+
extern const struct dpu_csc_cfg dpu_csc10_rgb2yuv_601l;
6527

6628
/*
6729
* This is the common struct maintained by each sub block

0 commit comments

Comments
 (0)