lkml.org 
[lkml]   [2019]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 01/11] fixup! drm/bridge: Add the necessary bits to support bus format negotiation
Date
> +	} else if (b->num_supported_fmts > 1 && b->supported_fmts) {
> + *selected_bus_fmt = b->supported_fmts[0];
> + return 0;

Here, `!a->num_supported_fmts &&` is missing otherwise this code will
select b->supported_fmts[0] whatever the supported formats of a.

> + } else if (a->num_supported_fmts > 1 && a->supported_fmts) {
> + *selected_bus_fmt = a->supported_fmts[0];
> + return 0;

Here, `!b->num_supported_fmts &&` is missing otherwise this code will
select a->supported_fmts[0] whatever the supported formats of b.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
drivers/gpu/drm/drm_bridge.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 5f0925467292..82fe7728fcd1 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -615,10 +615,12 @@ int drm_find_best_bus_format(const struct drm_bus_caps *a,
if (!a->num_supported_fmts && !b->num_supported_fmts) {
*selected_bus_fmt = 0;
return 0;
- } else if (b->num_supported_fmts > 1 && b->supported_fmts) {
+ } else if (!a->num_supported_fmts &&
+ b->num_supported_fmts > 1 && b->supported_fmts) {
*selected_bus_fmt = b->supported_fmts[0];
return 0;
- } else if (a->num_supported_fmts > 1 && a->supported_fmts) {
+ } else if (!b->num_supported_fmts &&
+ a->num_supported_fmts > 1 && a->supported_fmts) {
*selected_bus_fmt = a->supported_fmts[0];
return 0;
} else if (!a->num_supported_fmts || !a->supported_fmts ||
--
2.22.0
\
 
 \ /
  Last update: 2019-08-20 10:42    [W:0.091 / U:3.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site