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

Commit b190a864 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: Fix race condition while iommu mapping from DSI flow"

parents 71aeb411 19cad9d2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -50,8 +50,11 @@ int mdss_dsi_check_panel_status(struct mdss_dsi_ctrl_pdata *ctrl, void *arg)
	 * then no need to fail this function,
	 * instead return a positive value.
	 */
	if (ctrl->check_status)
	if (ctrl->check_status) {
		mutex_lock(&mfd->sd_lock);
		ret = ctrl->check_status(ctrl);
		mutex_unlock(&mfd->sd_lock);
	}
	else
		ret = 1;
	mutex_unlock(&ctl->offlock);
+2 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Core MDSS framebuffer driver.
 *
 * Copyright (C) 2007 Google Incorporated
 * Copyright (c) 2008-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt)	"%s: " fmt, __func__
@@ -1315,6 +1315,7 @@ static int mdss_fb_probe(struct platform_device *pdev)
	mutex_init(&mfd->bl_lock);
	mutex_init(&mfd->mdss_sysfs_lock);
	mutex_init(&mfd->switch_lock);
	mutex_init(&mfd->sd_lock);

	fbi_list[fbi_list_index++] = fbi;

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

#ifndef MDSS_FB_H
#define MDSS_FB_H
@@ -313,6 +313,7 @@ struct msm_fb_data_type {
	u32 bl_level_usr;
	struct mutex bl_lock;
	struct mutex mdss_sysfs_lock;
	struct mutex sd_lock;
	bool ipc_resume;

	struct platform_device *pdev;
+7 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. */

#define pr_fmt(fmt)	"%s: " fmt, __func__

@@ -2417,6 +2417,7 @@ static int __overlay_secure_ctrl(struct msm_fb_data_type *mfd)
	if (mdp5_data->secure_transition_state == SECURE_TRANSITION_NONE)
		return ret;

	mutex_lock(&mfd->sd_lock);
	/* Secure Display */
	if (mdp5_data->secure_transition_state == SD_NON_SECURE_TO_SECURE) {
		if (!mdss_get_sd_client_cnt()) {
@@ -2445,6 +2446,7 @@ static int __overlay_secure_ctrl(struct msm_fb_data_type *mfd)
					MDP_SECURE_DISPLAY_OVERLAY_SESSION);
			if (ret) {
				pr_err("secure display enable fail:%d\n", ret);
				mutex_unlock(&mfd->sd_lock);
				return ret;
			}
		}
@@ -2461,6 +2463,7 @@ static int __overlay_secure_ctrl(struct msm_fb_data_type *mfd)
					MDP_SECURE_DISPLAY_OVERLAY_SESSION);
			if (ret) {
				pr_err("secure display disable fail:%d\n", ret);
				mutex_unlock(&mfd->sd_lock);
				return ret;
			}
		}
@@ -2476,6 +2479,7 @@ static int __overlay_secure_ctrl(struct msm_fb_data_type *mfd)
					MDP_SECURE_CAMERA_OVERLAY_SESSION);
			if (ret) {
				pr_err("secure camera enable fail:%d\n", ret);
				mutex_unlock(&mfd->sd_lock);
				return ret;
			}
		}
@@ -2492,6 +2496,7 @@ static int __overlay_secure_ctrl(struct msm_fb_data_type *mfd)
					MDP_SECURE_CAMERA_OVERLAY_SESSION);
			if (ret) {
				pr_err("secure camera disable fail:%d\n", ret);
				mutex_unlock(&mfd->sd_lock);
				return ret;
			}
		}
@@ -2499,6 +2504,7 @@ static int __overlay_secure_ctrl(struct msm_fb_data_type *mfd)
		mdp5_data->sc_enabled = 0;
	}

	mutex_unlock(&mfd->sd_lock);
	MDSS_XLOG(ret);
	return ret;
}