drm/bridge: use bus flags in bridge timings
Subsystems (5)
PATCH 1/6 drm/bridge: use bus flags in bridge timings
The DRM bus flags convey additional information on pixel data on the bus. All current available bus flags might be of interest for a bridge. Remove the sampling_edge field and use bus_flags.
In the case at hand a dumb VGA bridge needs a specific data enable polarity (DRM_BUS_FLAG_DE_LOW).
--- drivers/gpu/drm/bridge/dumb-vga-dac.c | 6 +++--- include/drm/drm_bridge.h | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/bridge/dumb-vga-dac.c +3 -3
@@ -234,7 +234,7 @@ static int dumb_vga_remove(struct platform_device *pdev)*/ static const struct drm_bridge_timings default_dac_timings = {/* Timing specifications, datasheet page 7 */ - .sampling_edge =DRM_BUS_FLAG_PIXDATA_POSEDGE , + .bus_flags =DRM_BUS_FLAG_PIXDATA_POSEDGE , .setup_time_ps =500 , .hold_time_ps =1500 , };
@@ -245,7 +245,7 @@ static const struct drm_bridge_timings default_dac_timings = {*/ static const struct drm_bridge_timings ti_ths8134_dac_timings = {/* From timing diagram, datasheet page 9 */ - .sampling_edge =DRM_BUS_FLAG_PIXDATA_POSEDGE , + .bus_flags =DRM_BUS_FLAG_PIXDATA_POSEDGE ,/* From datasheet, page 12 */ .setup_time_ps =3000 ,/* I guess this means latched input */
@@ -258,7 +258,7 @@ static const struct drm_bridge_timings ti_ths8134_dac_timings = {*/ static const struct drm_bridge_timings ti_ths8135_dac_timings = {/* From timing diagram, datasheet page 14 */ - .sampling_edge =DRM_BUS_FLAG_PIXDATA_POSEDGE , + .bus_flags =DRM_BUS_FLAG_PIXDATA_POSEDGE ,/* From datasheet, page 16 */ .setup_time_ps =2000 , .hold_time_ps =500 ,
include/drm/drm_bridge.h +5 -6
@@ -244,14 +244,13 @@ struct drm_bridge_funcs {*/ struct drm_bridge_timings {/** -* @sampling_edge: +* @bus_flags: * -* Tells whether the bridge samples the digital input signal -* from the display engine on the positive or negative edge of the -* clock, this should reuse the DRM_BUS_FLAG_PIXDATA_[POS|NEG]EDGE -* bitwise flags from the DRM connector (bit 2 and 3 valid). +* Tells what additional settings for the pixel data on the bus +* this bridge requires (like pixel signal polarity). See also +* &drm_display_info->bus_flags. */ -u32 sampling_edge; +u32 bus_flags;/** * @setup_time_ps: *
Signature · 6 lines
2.18.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/2 modeprint: use libutil to lookup strings
Use libutil to lookup connector type names and state. This also makes sure that the latest connector type addition "DPI" gets printed correctly.
--- tests/modeprint/Makefile.am | 1 + tests/modeprint/meson.build | 2 +- tests/modeprint/modeprint.c | 43 ++++++------------------------------- 3 files changed, 9 insertions(+), 37 deletions(-)
tests/modeprint/Makefile.am +1 -0
@@ -15,4 +15,5 @@ endif modeprint_SOURCES = \ modeprint.c modeprint_LDADD = \ + $(top_builddir)/tests/util/libutil.la \ $(top_builddir)/libdrm.la
tests/modeprint/meson.build +1 -1
@@ -23,7 +23,7 @@ modeprint = executable( files('modeprint.c'), c_args : warn_c_args, include_directories : [inc_root, inc_tests, inc_drm], - link_with : libdrm, + link_with : [libdrm, libutil], dependencies : dep_threads, install : with_install_tests, )
tests/modeprint/modeprint.c +7 -36
73 lines not on this page · raw message
Signature · 6 lines
2.18.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm 1/2] modeprint: use libutil to lookup strings
Quoted 6 lines · Stefan Agner
Use libutil to lookup connector type names and state. This also makes sure that the latest connector type addition "DPI" gets printed correctly.
Signed-off-by Stefan Agner <[email protected]>
For the series:
Will do some sanity check and push in a moment.
Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/6 drm/bridge: allow to specify data-enable polarity
In reply to Stefan AgnerSupport boards with a passive RGB to VGA bridge which require a low active data-enable polarity.
---
Alternatively a new dt binding could be introduced for dumb VGA bridges requiring low active data enable... However, also other polarities might need a specific polarity, hence this generic approach might be better.
drivers/gpu/drm/bridge/dumb-vga-dac.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/dumb-vga-dac.c +18 -4
@@ -179,6 +179,7 @@ static struct i2c_adapter *dumb_vga_retrieve_ddc(struct device *dev)static int dumb_vga_probe (struct platform_device *pdev) {struct dumb_vga *vga; +u32 de; vga =devm_kzalloc (&pdev->dev,sizeof (*vga),GFP_KERNEL );if (!vga)
@@ -194,6 +195,23 @@ static int dumb_vga_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"No vdd regulator found: %d\n" , ret); } + vga->bridge.funcs = &dumb_vga_bridge_funcs; + vga->bridge.of_node = pdev->dev.of_node; + vga->bridge.timings =of_device_get_match_data (&pdev->dev); + +if (!vga->bridge.timings && + !of_property_read_u32 (pdev->dev.of_node,"de-active" , &de)) { +struct drm_bridge_timings *timings; + + timings =devm_kzalloc (&pdev->dev,sizeof (*timings),GFP_KERNEL ); +if (!timings) +return -ENOMEM ; + + timings->bus_flags = de ?DRM_BUS_FLAG_DE_HIGH : +DRM_BUS_FLAG_DE_LOW ; + vga->bridge.timings = timings; + } + vga->ddc =dumb_vga_retrieve_ddc (&pdev->dev);if (IS_ERR (vga->ddc)) {if (PTR_ERR (vga->ddc) == -ENODEV ) {
@@ -205,10 +223,6 @@ static int dumb_vga_probe(struct platform_device *pdev) } } - vga->bridge.funcs = &dumb_vga_bridge_funcs; - vga->bridge.of_node = pdev->dev.of_node; - vga->bridge.timings =of_device_get_match_data (&pdev->dev); -drm_bridge_add (&vga->bridge);return 0 ;
Signature · 6 lines
2.18.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 modeprint: print encoder type
In reply to Stefan AgnerPrint encoder types similar to connector types.
--- tests/modeprint/modeprint.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tests/modeprint/modeprint.c +7 -1
@@ -186,7 +186,13 @@ static int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connectstatic int printEncoder (int fd,drmModeResPtr res,drmModeEncoderPtr encoder,uint32_t id) { -printf ("Encoder\n" ); +const char *encoder_name; + + encoder_name =util_lookup_encoder_type_name (encoder->encoder_type); +if (encoder_name) +printf ("Encoder: %s\n" , encoder_name); +else +printf ("Encoder\n" );printf ("\tid :%i\n" , id);printf ("\tcrtc_id :%d\n" , encoder->crtc_id);printf ("\ttype :%d\n" , encoder->encoder_type);
Signature · 6 lines
2.18.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/6 dt-bindings: display: add data-enable polarity property
In reply to Stefan AgnerAllow to specify the data-enable polarity required by a dumb VGA DAC converting parallel RGB to VGA.
--- .../devicetree/bindings/display/bridge/dumb-vga-dac.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt +1 -0
@@ -18,6 +18,7 @@ graph bindings specified in Documentation/devicetree/bindings/graph.txt. Optional properties: - vdd-supply: Power supply for DAC +- de-active: data-enable pulse is active low/high/ignored Example -------
Signature · 6 lines
2.18.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Stefan Agner
The DRM bus flags convey additional information on pixel data on the bus. All current available bus flags might be of interest for a bridge. Remove the
sampling_edgefield and usebus_flags.In the case at hand a dumb VGA bridge needs a specific data enable polarity (
DRM_BUS_FLAG_DE_LOW).Signed-off-by Stefan Agner <[email protected]>---
I meant to send out only the two patches with "PATCH libdrm" in subject.
Please disregard the other patches, they have been sent in error.
--
Stefan
Quoted 52 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c | 6 +++--- include/drm/drm_bridge.h | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-)drivers/gpu/drm/bridge/dumb-vga-dac.c +2
-2@@ -234,7 +234,7 @@ static int dumb_vga_remove(struct platform_device *pdev)*/ static const struct drm_bridge_timings default_dac_timings = {/* Timing specifications, datasheet page 7 */ - .sampling_edge =DRM_BUS_FLAG_PIXDATA_POSEDGE , + .bus_flags =DRM_BUS_FLAG_PIXDATA_POSEDGE , .setup_time_ps =500 , .hold_time_ps =1500 , };@@ -245,7 +245,7 @@ static const struct drm_bridge_timingsdefault_dac_timings = { */ static const struct drm_bridge_timings ti_ths8134_dac_timings = {/* From timing diagram, datasheet page 9 */ - .sampling_edge =DRM_BUS_FLAG_PIXDATA_POSEDGE , + .bus_flags =DRM_BUS_FLAG_PIXDATA_POSEDGE ,/* From datasheet, page 12 */ .setup_time_ps =3000 ,drivers/gpu/drm/bridge/dumb-vga-dac.c +1
-1/* I guess this means latched input */ @@ -258,7 +258,7 @@ static const struct drm_bridge_timingsti_ths8134_dac_timings = { */ static const struct drm_bridge_timings ti_ths8135_dac_timings = {/* From timing diagram, datasheet page 14 */ - .sampling_edge =DRM_BUS_FLAG_PIXDATA_POSEDGE , + .bus_flags =DRM_BUS_FLAG_PIXDATA_POSEDGE ,/* From datasheet, page 16 */ .setup_time_ps =2000 ,drivers/gpu/drm/bridge/dumb-vga-dac.c +0
-0.hold_time_ps = 500,include/drm/drm_bridge.h +1
-4@@ -244,14 +244,13 @@ struct drm_bridge_funcs {*/ struct drm_bridge_timings {/** -* @sampling_edge: +* @bus_flags: * -* Tells whether the bridge samples the digital input signal -* from the display engine on the positive or negative edge of the -* clock, this should reuse the DRM_BUS_FLAG_PIXDATA_[POS|NEG]EDGE
include/drm/drm_bridge.h struct drm_bridge_funcs { · line 256
Quoted 10 lines
include/drm/drm_bridge.h +4
-2-* bitwise flags from the DRM connector (bit 2 and 3 valid). +* Tells what additional settings for the pixel data on the bus +* this bridge requires (like pixel signal polarity). See also +* &drm_display_info->bus_flags. */ -u32 sampling_edge; +u32 bus_flags;/** * @setup_time_ps: *
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel