dt-bindings: display: bridge: icn6211: Add support for RGB/BGR swap
Subsystems (5)
PATCH 1/2 dt-bindings: display: bridge: icn6211: Add support for RGB/BGR swap
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, document a DT property to select this swap in DT. This can be useful on hardware where such swap happens.
--- .../devicetree/bindings/display/bridge/chipone,icn6211.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml +6 -0
@@ -33,6 +33,12 @@ properties: Optional external clock connected to REF_CLK input. The clock rate must be in 10..154 MHz range. + blue-and-red-swap: + description: + If defined, the DPI output blue and red channels are swapped, + i.e. RGB becomes BGR. + type: boolean + enable-gpios: description: Bridge EN pin, chip is reset when EN is low.
Signature · 1 line
2.35.1
PATCH 2/2 drm: bridge: icn6211: Add support for RGB/BGR swap
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, implement support for this and add DT property "blue-and-red-swap" to select the RGB/BGR channel order.
--- drivers/gpu/drm/bridge/chipone-icn6211.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/chipone-icn6211.c +9 -1
@@ -30,6 +30,8 @@#define PD_CTRL (n) (0x0a + ((n) & 0x3))/* 0..3 */ #define RST_CTRL (n) (0x0e + ((n) & 0x1))/* 0..1 */ #define SYS_CTRL (n) (0x10 + ((n) & 0x7))/* 0..4 */ +#define SYS_CTRL_0_COLOR_ORDER_RGB 0x0 +#define SYS_CTRL_0_COLOR_ORDER_BGR 0x5#define SYS_CTRL_1_CLK_PHASE_MSK GENMASK(5, 4)#define CLK_PHASE_0 0#define CLK_PHASE_1_4 1
@@ -155,6 +157,7 @@ struct chipone {struct clk *refclk;unsigned long refclk_rate;bool interface_i2c; +bool color_swap; };static const struct regmap_range chipone_dsi_readable_ranges[] = {
@@ -426,7 +429,9 @@ static void chipone_atomic_enable(struct drm_bridge *bridge,/* Configure PLL settings */ chipone_configure_pll (icn, mode); -chipone_writeb (icn,SYS_CTRL (0 ),0x40 ); +chipone_writeb (icn,SYS_CTRL (0 ),0x40 | + (icn->color_swap ?SYS_CTRL_0_COLOR_ORDER_BGR : +SYS_CTRL_0_COLOR_ORDER_RGB )); sys_ctrl_1 =0x88 ;if (bus_flags &DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE )
@@ -680,6 +685,9 @@ static int chipone_parse_dt(struct chipone *icn)return PTR_ERR (icn->enable_gpio); } + icn->color_swap =of_property_read_bool (dev->of_node, +"blue-and-red-swap" ); + icn->panel_bridge =devm_drm_of_get_bridge (dev, dev->of_node,1 ,0 );if (IS_ERR (icn->panel_bridge))return PTR_ERR (icn->panel_bridge);
Signature · 1 line
2.35.1
Rob Herring
maintainerQuoted 3 lines · Marek Vasut
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, document a DT property to select this swap in DT. This can be useful on hardware where such swap happens.
We should ensure this series[1] works for you instead.
Quoted 18 lines
Signed-off-by Marek Vasut <[email protected]>Cc Jagan Teki <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Linus Walleij <[email protected]>Cc Rob Herring <[email protected]>Cc Robert Foss <[email protected]>Cc Sam Ravnborg <[email protected]>--- .../devicetree/bindings/display/bridge/chipone,icn6211.yaml | 6 ++++++ 1 file changed, 6 insertions(+)Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml +0
-0
Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml properties: · line 36
Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml +1
-0@@ -33,6 +33,12 @@ properties: Optional external clock connected to REF_CLK input. The clock rate must be in 10..154 MHz range. + blue-and-red-swap:
'swap' assumes I know the default order and I don't. Better to make the property name describe the end result. ('invert' properties have the same issue)
Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml properties: · line 43
Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml +5
-0+ description: + If defined, the DPI output blue and red channels are swapped, + i.e. RGB becomes BGR. + type: boolean + enable-gpios: description: Bridge EN pin, chip is reset when EN is low.
Rob
Quoted 6 lines · Rob Herring
Quoted 3 lines · Marek Vasut
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, document a DT property to select this swap in DT. This can be useful on hardware where such swap happens.
We should ensure this series[1] works for you instead.
[...]
Quoted 3 lines
Rob
I'm still not convinced that we should encode this pixel format value directly into the DT instead of trying to describe the DPI bus color channel width/order/shift in the DT instead. I think I mentioned that before in one of the previous versions of that series.
Rob Herring
maintainerQuoted 11 lines · Marek Vasut
Quoted 6 lines · Rob Herring
Quoted 3 lines · Marek Vasut
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, document a DT property to select this swap in DT. This can be useful on hardware where such swap happens.
We should ensure this series[1] works for you instead.
[...]
Quoted 8 lines
Quoted 3 lines
Rob
I'm still not convinced that we should encode this pixel format value directly into the DT instead of trying to describe the DPI bus color channel width/order/shift in the DT instead. I think I mentioned that before in one of the previous versions of that series.
I worry that it gets pretty verbose, but worth having the discussion. In any case, let's have that discussion and not add yet another one off property.
Rob
Quoted 16 lines · Rob Herring
Quoted 15 lines · Marek Vasut
Quoted 6 lines · Rob Herring
Quoted 3 lines · Marek Vasut
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, document a DT property to select this swap in DT. This can be useful on hardware where such swap happens.
We should ensure this series[1] works for you instead.
[...]
Quoted 3 lines
Rob
Quoted 8 lines
Quoted 4 lines
I'm still not convinced that we should encode this pixel format value directly into the DT instead of trying to describe the DPI bus color channel width/order/shift in the DT instead. I think I mentioned that before in one of the previous versions of that series.
I worry that it gets pretty verbose, but worth having the discussion. In any case, let's have that discussion and not add yet another one off property.
Done, I replied
Quoted 22 lines · Marek Vasut
Quoted 21 lines · Rob Herring
Quoted 19 lines · Marek Vasut
Quoted 6 lines · Rob Herring
Quoted 3 lines · Marek Vasut
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, document a DT property to select this swap in DT. This can be useful on hardware where such swap happens.
We should ensure this series[1] works for you instead.
[...]
Quoted 3 lines
Rob
I'm still not convinced that we should encode this pixel format value directly into the DT instead of trying to describe the DPI bus color channel width/order/shift in the DT instead. I think I mentioned that before in one of the previous versions of that series.
Quoted 5 lines
Quoted 3 lines
I worry that it gets pretty verbose, but worth having the discussion. In any case, let's have that discussion and not add yet another one off property.
Done, I replied
So what is the verdict? Is this patch set dropped or shall it be applied?
Yours,
Linus Walleij
Quoted 23 lines · Linus Walleij
Quoted 22 lines · Marek Vasut
Quoted 21 lines · Rob Herring
Quoted 19 lines · Marek Vasut
Quoted 6 lines · Rob Herring
Quoted 3 lines · Marek Vasut
The ICN6211 is capable of swapping the output DPI RGB/BGR color channels, document a DT property to select this swap in DT. This can be useful on hardware where such swap happens.
We should ensure this series[1] works for you instead.
[...]
Quoted 3 lines
Rob
I'm still not convinced that we should encode this pixel format value directly into the DT instead of trying to describe the DPI bus color channel width/order/shift in the DT instead. I think I mentioned that before in one of the previous versions of that series.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
I worry that it gets pretty verbose, but worth having the discussion. In any case, let's have that discussion and not add yet another one off property.
Done, I replied
So what is the verdict? Is this patch set dropped or shall it be applied?
Drop
Let's wait for the DPI pixel format description discussion in DT gets sorted out.