From: Quanyang Wang <[email protected]>

The Test Pattern Generator in video layer creates output in rgb mode,
so in function zynqmp_disp_blend_layer_coeff, we should add a condition
check to ensure that the matrix swap_coeffs for rgb mode is used for tpg
but not sdtv_coeffs.

And delete zynqmp_disp_blend_layer_coeff from zynqmp_disp_layer_set_tpg,
this is because that zynqmp_disp_blend_layer_coeff will be called later
by zynqmp_disp_layer_enable.

Signed-off-by: Quanyang Wang <[email protected]>
---
 drivers/gpu/drm/xlnx/zynqmp_disp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c 
b/drivers/gpu/drm/xlnx/zynqmp_disp.c
index 961c3e99cb36..e51692c48c20 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
@@ -454,6 +454,7 @@ static void zynqmp_disp_blend_layer_coeff(struct 
zynqmp_disp_blend *blend,
        u32 sdtv_offsets_yonly[] = { 0x1800, 0x1800, 0x0 };
        u32 null_offsets[] = { 0x0, 0x0, 0x0 };
        u32 *offsets;
+       struct zynqmp_disp *display = layer->disp;
 
        if (layer->id == ZYNQMP_DISP_LAYER_VID)
                offset = ZYNQMP_DISP_V_BLEND_IN1CSC_COEFF0;
@@ -464,7 +465,7 @@ static void zynqmp_disp_blend_layer_coeff(struct 
zynqmp_disp_blend *blend,
                coeffs = null_coeffs;
                offsets = null_offsets;
        } else {
-               if (!layer->fmt->rgb) {
+               if ((!layer->fmt->rgb) && (!display->tpg_on)) {
                        /*
                         * In case of Y_ONLY formats, pixels are unpacked
                         * differently compared to YCbCr
@@ -1619,9 +1620,8 @@ static int zynqmp_disp_layer_set_tpg(struct zynqmp_disp 
*disp,
                return -EIO;
        }
 
-       zynqmp_disp_blend_layer_coeff(&disp->blend, layer, tpg_on);
-       zynqmp_disp_av_buf_set_tpg(&disp->av_buf, tpg_on);
        disp->tpg_on = tpg_on;
+       zynqmp_disp_av_buf_set_tpg(&disp->av_buf, tpg_on);
 
        return 0;
 }
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9854): 
https://lists.yoctoproject.org/g/linux-yocto/message/9854
Mute This Topic: https://lists.yoctoproject.org/mt/82715736/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to