fix green/pink color distortion from HDR set during vendor Uboot
PATCH 1/1 fix green/pink color distortion from HDR set during vendor Uboot
I also wrote a program to set this via /dev/mem from user space: https://github.com/ballerburg9005/android-tvbox-2-linux-pc-and-server/blob/main/fix_greenpink.c .
drivers/gpu/drm/meson/meson_drv.c +0 -0
@@ -308,6 +308,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
drm->mode_config.funcs = &meson_mode_config_funcs; drm->mode_config.helper_private = &meson_mode_config_helpers;
+ /* undo settings made in vendor Uboot */
+
+ writel_bits_relaxed(15 << 13, 0, priv->io_base + _REG(OSD1_HDR2_CTRL)); // fixes green/pink color distortion - reg_only_mat must be 0 +
/* Hardware Initialization */
meson_vpu_init(priv);
drivers/gpu/drm/meson/meson_registers.h +0 -0
@@ -634,6 +634,9 @@
#define VPP_WRAP_OSD3_MATRIX_PRE_OFFSET2 0x3dbc
#define VPP_WRAP_OSD3_MATRIX_EN_CTRL 0x3dbd
+/* osd1 HDR */
+#define OSD1_HDR2_CTRL 0x38a0
+
/* osd2 scaler */
#define OSD2_VSC_PHASE_STEP 0x3d00
#define OSD2_VSC_INI_PHASE 0x3d01
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Hi,
Thanks for looking at this !
The subject should be :
"drm/meson: fix green/pink color distortion from HDR set during vendor Uboot"
Quoted 4 lines · Mathias Steiger
I also wrote a program to set this via
/dev/memfrom user space: https://github.com/ballerburg9005/android-tvbox-2-linux-pc-and-server/blob/main/fix_greenpink.c .
Please explicit here what the patch does, no need for the example program, the patch is self explicit.
Then add:
Finally, it also needs your sign-off at the end of your commit message, simply commit with "-s".
drivers/gpu/drm/meson/meson_drv.c static int meson_drv_bind_master(struct device *dev, bool has_components) · line 314
Quoted 13 lines
drivers/gpu/drm/meson/meson_drv.c +4
-0@@ -308,6 +308,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) drm->mode_config.funcs = &meson_mode_config_funcs; drm->mode_config.helper_private = &meson_mode_config_helpers; + /* undo settings made in vendor Uboot */ + + writel_bits_relaxed(15 << 13, 0, priv->io_base + _REG(OSD1_HDR2_CTRL)); // fixes green/pink color distortion - reg_only_mat must be 0 +
This should go in meson_viu.c in meson_viu_init right after meson_viu_set_g12a_osd1_matrix() for VPU_COMPATIBLE_G12A (extend the else if case).
Please document the bits your write in meson_registers.h like:
#define OSD1_HDR2_CTRL_VDIN0_HDR2_TOP_EN BIT(13)
and same for bits mat_o_en and reg_out_fmt, then use them in writel_bits_relaxed()
Quoted 9 lines
drivers/gpu/drm/meson/meson_drv.c +0
-0/* Hardware Initialization */ meson_vpu_init(priv);drivers/gpu/drm/meson/meson_registers.h +0
-0
drivers/gpu/drm/meson/meson_registers.h line 642
Quoted 9 lines
drivers/gpu/drm/meson/meson_registers.h +3
-0@@ -634,6 +634,9 @@ #define VPP_WRAP_OSD3_MATRIX_PRE_OFFSET2 0x3dbc #define VPP_WRAP_OSD3_MATRIX_EN_CTRL 0x3dbd +/* osd1 HDR */ +#define OSD1_HDR2_CTRL 0x38a0 + /* osd2 scaler */ #define OSD2_VSC_PHASE_STEP 0x3d00 #define OSD2_VSC_INI_PHASE 0x3d01
This part will be ok with the bits defined.
Quoted 5 lines
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Neil
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Neil Armstrong
Tested-byQuoted 13 lines · Neil Armstrong
Hi,
Thanks for looking at this !
The subject should be :
"drm/meson: fix green/pink color distortion from HDR set during vendor Uboot"Quoted 4 lines · Mathias Steiger
I also wrote a program to set this via
/dev/memfrom user space: https://github.com/ballerburg9005/android-tvbox-2-linux-pc-and-server/blob/main/fix_greenpink.c .
Quoted 5 lines
Please explicit here what the patch does, no need for the example program, the patch is self explicit.
Then add:
Fixes 728883948b0d ("drm/meson: Add G12A Support for VIU setup")
I tested on a VIM3 with the vendor U-boot, and it works ! Thanks !
And please add to the v2 patch:
Thanks,
Neil
Quoted 48 lines
Finally, it also needs your sign-off at the end of your commit message, simply commit with "-s".
drivers/gpu/drm/meson/meson_drv.c static int meson_drv_bind_master(struct device *dev, bool has_components) · line 314
Quoted 13 lines
drivers/gpu/drm/meson/meson_drv.c +4
-0@@ -308,6 +308,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) drm->mode_config.funcs = &meson_mode_config_funcs; drm->mode_config.helper_private = &meson_mode_config_helpers; + /* undo settings made in vendor Uboot */ + + writel_bits_relaxed(15 << 13, 0, priv->io_base + _REG(OSD1_HDR2_CTRL)); // fixes green/pink color distortion - reg_only_mat must be 0 +This should go in
meson_viu.cinmeson_viu_initright aftermeson_viu_set_g12a_osd1_matrix()forVPU_COMPATIBLE_G12A(extend the else if case).Please document the bits your write in
meson_registers.hlike:
#defineOSD1_HDR2_CTRL_VDIN0_HDR2_TOP_ENBIT(13)and same for bits
mat_o_enandreg_out_fmt, then use them inwritel_bits_relaxed()Quoted 9 lines
drivers/gpu/drm/meson/meson_drv.c +0
-0/* Hardware Initialization */ meson_vpu_init(priv);drivers/gpu/drm/meson/meson_registers.h +0
-0drivers/gpu/drm/meson/meson_registers.h line 642
Quoted 9 lines
drivers/gpu/drm/meson/meson_registers.h +3
-0@@ -634,6 +634,9 @@ #define VPP_WRAP_OSD3_MATRIX_PRE_OFFSET2 0x3dbc #define VPP_WRAP_OSD3_MATRIX_EN_CTRL 0x3dbd +/* osd1 HDR */ +#define OSD1_HDR2_CTRL 0x38a0 + /* osd2 scaler */ #define OSD2_VSC_PHASE_STEP 0x3d00 #define OSD2_VSC_INI_PHASE 0x3d01This part will be ok with the bits defined.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogicNeil
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Hi Mathias,
So you think you'll be able to send a v2 patch ?
Thanks,
Neil
Quoted 20 lines · Neil Armstrong
Quoted 13 lines · Neil Armstrong
Hi,
Thanks for looking at this !
The subject should be :
"drm/meson: fix green/pink color distortion from HDR set during vendor Uboot"Quoted 4 lines · Mathias Steiger
I also wrote a program to set this via
/dev/memfrom user space: https://github.com/ballerburg9005/android-tvbox-2-linux-pc-and-server/blob/main/fix_greenpink.c .Quoted 5 lines
Please explicit here what the patch does, no need for the example program, the patch is self explicit.
Then add:
Fixes 728883948b0d ("drm/meson: Add G12A Support for VIU setup")
Quoted 64 lines
I tested on a VIM3 with the vendor U-boot, and it works ! Thanks !
And please add to the v2 patch:
Tested-by Neil Armstrong <[email protected]>Thanks,
NeilQuoted 55 lines
Finally, it also needs your sign-off at the end of your commit message, simply commit with "-s".
drivers/gpu/drm/meson/meson_drv.c static int meson_drv_bind_master(struct device *dev, bool has_components) · line 314
Quoted 13 lines
drivers/gpu/drm/meson/meson_drv.c +4
-0@@ -308,6 +308,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) drm->mode_config.funcs = &meson_mode_config_funcs; drm->mode_config.helper_private = &meson_mode_config_helpers; + /* undo settings made in vendor Uboot */ + + writel_bits_relaxed(15 << 13, 0, priv->io_base + _REG(OSD1_HDR2_CTRL)); // fixes green/pink color distortion - reg_only_mat must be 0 +This should go in
meson_viu.cinmeson_viu_initright aftermeson_viu_set_g12a_osd1_matrix()forVPU_COMPATIBLE_G12A(extend the else if case).Please document the bits your write in
meson_registers.hlike:
#defineOSD1_HDR2_CTRL_VDIN0_HDR2_TOP_ENBIT(13)and same for bits
mat_o_enandreg_out_fmt, then use them inwritel_bits_relaxed()Quoted 9 lines
drivers/gpu/drm/meson/meson_drv.c +0
-0/* Hardware Initialization */ meson_vpu_init(priv);drivers/gpu/drm/meson/meson_registers.h +0
-0drivers/gpu/drm/meson/meson_registers.h line 642
Quoted 9 lines
drivers/gpu/drm/meson/meson_registers.h +3
-0@@ -634,6 +634,9 @@ #define VPP_WRAP_OSD3_MATRIX_PRE_OFFSET2 0x3dbc #define VPP_WRAP_OSD3_MATRIX_EN_CTRL 0x3dbd +/* osd1 HDR */ +#define OSD1_HDR2_CTRL 0x38a0 + /* osd2 scaler */ #define OSD2_VSC_PHASE_STEP 0x3d00 #define OSD2_VSC_INI_PHASE 0x3d01This part will be ok with the bits defined.
Quoted 5 lines
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogicNeil
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic