Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05431f32 authored by Clarence Ip's avatar Clarence Ip
Browse files

drm/msm/sde: avoid drm_for_each_connector usage in encoder



Each physical encoder's associated connector is cached during
driver initialization, so the correct connector object may be
obtained without needing to iterate over the global connector
list.

CRs-Fixed: 2019302
Change-Id: I8e1f45a69cf64c3af4ce555b4005feac11701943
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent a18d483d
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
@@ -948,12 +947,7 @@ static void sde_encoder_phys_wb_enable(struct sde_encoder_phys *phys_enc)
	dev = wb_enc->base.parent->dev;

	/* find associated writeback connector */
	mutex_lock(&dev->mode_config.mutex);
	drm_for_each_connector(connector, phys_enc->parent->dev) {
		if (connector->encoder == phys_enc->parent)
			break;
	}
	mutex_unlock(&dev->mode_config.mutex);
	connector = phys_enc->connector;

	if (!connector || connector->encoder != phys_enc->parent) {
		SDE_ERROR("failed to find writeback connector\n");