lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190701174120.15551-1-jeffrey.l.hugo@gmail.com>
Date:   Mon,  1 Jul 2019 10:41:20 -0700
From:   Jeffrey Hugo <jeffrey.l.hugo@...il.com>
To:     robdclark@...il.com, sean@...rly.run, airlied@...ux.ie,
        daniel@...ll.ch
Cc:     bjorn.andersson@...aro.org, linux-arm-msm@...r.kernel.org,
        dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org,
        Jeffrey Hugo <jeffrey.l.hugo@...il.com>
Subject: [PATCH] drm/msm/mdp5: Use eariler mixers when possible

When assigning a mixer, we will iterate through the entire list looking for
a suitable match.  This results in selecting the last match.  We should
stop at the first match, since lower numbered mixers will typically have
more capabilities, and are likely to be what the bootloader used, if we
are looking to reuse the bootloader config in future.

Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@...il.com>
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c
index 954db683ae44..1638042ad974 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c
@@ -96,6 +96,17 @@ int mdp5_mixer_assign(struct drm_atomic_state *s, struct drm_crtc *crtc,
 		 */
 		if (!(*mixer) || cur->caps & MDP_LM_CAP_PAIR)
 			*mixer = cur;
+
+		/*
+		 * We have everything we could want, exit early.
+		 * We have a valid mixer, that mixer pairs with another if we
+		 * need that ability in future, and we have a right mixer if
+		 * needed.
+		 * Later LMs could be less optimal
+		 */
+		if (*mixer && (*mixer)->caps & MDP_LM_CAP_PAIR &&
+		    ((r_mixer && *r_mixer) || !r_mixer))
+			break;
 	}
 
 	if (!(*mixer))
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ