[RFC 01/11] fixup! drm/bridge: Add the necessary bits to support bus format negotiation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	} 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@xxxxxxxxxxxx>
---
 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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux