Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/display: Return correct err code for bpc < 0
@ 2023-04-11 17:34 Manasi Navare
  2023-04-11 17:42 ` Ville Syrjälä
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Manasi Navare @ 2023-04-11 17:34 UTC (permalink / raw)
  To: intel-gfx

In the function intel_dp_max_bpp(), currently if bpc < 0 in case of error,
we return 0 instead of returning an err code of -EINVAL.
This throws off the logic in the calling function. Fix this by returning
-EINVAL in case bpc < 0 which would be an error.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Sean Paul <sean@poorly.run>
Signed-off-by: Manasi Navare <navaremanasi@chromium.org>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index f0bace9d98a1..f6546292e7c6 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1280,7 +1280,7 @@ static int intel_dp_max_bpp(struct intel_dp *intel_dp,
 		max_hdmi_bpc = intel_dp_hdmi_compute_bpc(intel_dp, crtc_state, bpc,
 							 respect_downstream_limits);
 		if (max_hdmi_bpc < 0)
-			return 0;
+			return -EINVAL;
 
 		bpc = min(bpc, max_hdmi_bpc);
 	}
-- 
2.40.0.577.gac1e443424-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-04-19  5:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-11 17:34 [Intel-gfx] [PATCH] drm/i915/display: Return correct err code for bpc < 0 Manasi Navare
2023-04-11 17:42 ` Ville Syrjälä
2023-04-12  0:07   ` Manasi Navare
2023-04-12  5:22     ` Ville Syrjälä
2023-04-13 15:23       ` Manasi Navare
2023-04-17 22:48         ` Manasi Navare
2023-04-18 12:46           ` Ville Syrjälä
2023-04-18 14:39             ` Nautiyal, Ankit K
2023-04-18 14:54               ` Ville Syrjälä
2023-04-18 22:42                 ` Manasi Navare
2023-04-19  4:59                   ` Nautiyal, Ankit K
2023-04-19  5:04                     ` Nautiyal, Ankit K
2023-04-12  0:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-04-12 13:44 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox