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

Commit 935af810 authored by Jeykumar Sankaran's avatar Jeykumar Sankaran
Browse files

disp: msm: sde: avoid MDSS register access during boot in trusted VM



Trusted VM will be assigned MDSS HW access dynamically only on TUI
use case start boundary. So, any HW access during the boot sequence
will result in stage2 faults. But SDE driver initializes few HW
blocks during the boot up sequence. This change fixes them by either
skipping those accesses, if those registers expected to be programmed
by the Primary VM or postponing those accesses until the HW is
assigned.

Change-Id: Ic85238c5d734e9ac993072374c1b0ae661708fca
Signed-off-by: default avatarJeykumar Sankaran <jsanka@codeaurora.org>
parent e81f110f
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -464,6 +464,7 @@ void sde_core_irq_preinstall(struct sde_kms *sde_kms)
		return;
	}

	if (!sde_in_trusted_vm(sde_kms)) {
		rc = pm_runtime_get_sync(sde_kms->dev->dev);
		if (rc < 0) {
			SDE_ERROR("failed to enable power resource %d\n", rc);
@@ -473,7 +474,9 @@ void sde_core_irq_preinstall(struct sde_kms *sde_kms)

		sde_clear_all_irqs(sde_kms);
		sde_disable_all_irqs(sde_kms);

		pm_runtime_put_sync(sde_kms->dev->dev);
	}

	spin_lock_init(&sde_kms->irq_obj.cb_lock);

+3 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 */

#include "sde_hw_mdss.h"
@@ -341,6 +341,7 @@ struct sde_hw_cdm *sde_hw_cdm_init(enum sde_cdm idx,
	 * Perform any default initialization for the chroma down module
	 * @setup default csc coefficients
	 */
	if (!m->trusted_vm_env)
		sde_hw_cdm_setup_csc_10bit(c, &rgb2yuv_cfg);

	return c;
+7 −2
Original line number Diff line number Diff line
@@ -3156,15 +3156,20 @@ static void sde_kms_handle_power_event(u32 event_type, void *usr)

	if (event_type == SDE_POWER_EVENT_POST_ENABLE) {
		sde_irq_update(msm_kms, true);
		if (sde_kms->splash_data.num_splash_displays)
		sde_kms->first_kickoff = true;
		if (sde_kms->splash_data.num_splash_displays ||
				sde_in_trusted_vm(sde_kms))
			return;

		sde_vbif_init_memtypes(sde_kms);
		sde_kms_init_shared_hw(sde_kms);
		_sde_kms_set_lutdma_vbif_remap(sde_kms);
		sde_kms->first_kickoff = true;
	} else if (event_type == SDE_POWER_EVENT_PRE_DISABLE) {
		sde_irq_update(msm_kms, false);
		sde_kms->first_kickoff = false;
		if (sde_in_trusted_vm(sde_kms))
			return;

		_sde_kms_active_override(sde_kms, true);
		if (!is_sde_rsc_available(SDE_RSC_INDEX))
			sde_vbif_axi_halt_request(sde_kms);