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

Commit 535500ac authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: Allow resource update during secure UI"

parents 66037751 695632e5
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
/* Copyright (c) 2013-2014, 2016-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 2016-2020, The Linux Foundation. All rights reserved.
 * Copyright (C) 2007 Google Incorporated
 * Copyright (C) 2007 Google Incorporated
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
@@ -211,6 +211,8 @@ struct mdp3_hw_resource {
	struct mutex reg_bus_lock;
	struct mutex reg_bus_lock;
	int bklt_level;
	int bklt_level;
	int bklt_update;
	int bklt_update;
	bool secure_update_bl;
	bool secure_reg_on;
	bool twm_en;
	bool twm_en;
	u32 max_bw;
	u32 max_bw;


+21 −1
Original line number Original line Diff line number Diff line
@@ -948,6 +948,7 @@ static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)
	mutex_lock(&mdp3_session->lock);
	mutex_lock(&mdp3_session->lock);


	MDSS_XLOG(XLOG_FUNC_ENTRY, __LINE__, mfd->panel_power_state);
	MDSS_XLOG(XLOG_FUNC_ENTRY, __LINE__, mfd->panel_power_state);
	mdp3_res->secure_update_bl = false;
	panel = mdp3_session->panel;
	panel = mdp3_session->panel;
	/* make sure DSI host is initialized properly */
	/* make sure DSI host is initialized properly */
	if (panel) {
	if (panel) {
@@ -1865,6 +1866,24 @@ static int mdp3_set_metadata(struct msm_fb_data_type *mfd,
			return ret;
			return ret;
		}
		}
		break;
		break;
	case metadata_op_secure_bl_set:
		if (mdss_panel_is_power_off(mfd->panel_power_state) &&
				mfd->panel.type == SPI_PANEL) {
			mfd->allow_secure_bl_update =
				metadata_ptr->data.sec_bl_update_en;
			mdp3_res->secure_update_bl =
				mfd->allow_secure_bl_update;
		}
		pr_debug("Secure backlight = %d,panel power state = %d\n",
		mfd->allow_secure_bl_update, mfd->panel_power_state);
		break;
	case metadata_op_secure_reg:
		if (mfd->panel.type == SPI_PANEL) {
			mdp3_res->secure_reg_on = metadata_ptr->data.sec_reg_on;
			pr_debug("Secure regulator_on flag is %d\n",
					mdp3_res->secure_reg_on);
		}
	break;
	default:
	default:
		pr_warn("Unsupported request to MDP SET META IOCTL.\n");
		pr_warn("Unsupported request to MDP SET META IOCTL.\n");
		ret = -EINVAL;
		ret = -EINVAL;
@@ -2813,7 +2832,8 @@ static int mdp3_ctrl_ioctl_handler(struct msm_fb_data_type *mfd,
	req = &mdp3_session->req_overlay;
	req = &mdp3_session->req_overlay;


	if (!mdp3_session->status && cmd != MSMFB_METADATA_GET &&
	if (!mdp3_session->status && cmd != MSMFB_METADATA_GET &&
		cmd != MSMFB_HISTOGRAM_STOP && cmd != MSMFB_HISTOGRAM) {
		cmd != MSMFB_METADATA_SET && cmd != MSMFB_HISTOGRAM_STOP &&
		cmd != MSMFB_HISTOGRAM) {
		pr_err("mdp3_ctrl_ioctl_handler, display off!\n");
		pr_err("mdp3_ctrl_ioctl_handler, display off!\n");
		return -EPERM;
		return -EPERM;
	}
	}
+3 −1
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (c) 2014-2016, 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2016, 2018,2020, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -88,6 +88,8 @@ struct msmfb_metadata32 {
		uint32_t video_info_code;
		uint32_t video_info_code;
		struct mdss_hw_caps caps;
		struct mdss_hw_caps caps;
		uint8_t secure_en;
		uint8_t secure_en;
		bool sec_bl_update_en;
		bool sec_reg_on;
	} data;
	} data;
};
};


+11 −4
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 * Core MDSS framebuffer driver.
 * Core MDSS framebuffer driver.
 *
 *
 * Copyright (C) 2007 Google Incorporated
 * Copyright (C) 2007 Google Incorporated
 * Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2020, The Linux Foundation. All rights reserved.
 *
 *
 * This software is licensed under the terms of the GNU General Public
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * License version 2, as published by the Free Software Foundation, and
@@ -1716,13 +1716,14 @@ void mdss_fb_set_backlight(struct msm_fb_data_type *mfd, u32 bkl_lvl)
	bool twm_en = false;
	bool twm_en = false;


	if ((((mdss_fb_is_power_off(mfd) && mfd->dcm_state != DCM_ENTER)
	if ((((mdss_fb_is_power_off(mfd) && mfd->dcm_state != DCM_ENTER)
		|| !mfd->allow_bl_update) && !IS_CALIB_MODE_BL(mfd)) ||
		|| !mfd->allow_bl_update) && !IS_CALIB_MODE_BL(mfd) &&
		!mfd->allow_secure_bl_update) ||
		mfd->panel_info->cont_splash_enabled) {
		mfd->panel_info->cont_splash_enabled) {
		mfd->unset_bl_level = bkl_lvl;
		mfd->unset_bl_level = bkl_lvl;
		return;
		return;
	} else if (mdss_fb_is_power_on(mfd) && mfd->panel_info->panel_dead) {
	} else if (mdss_fb_is_power_on(mfd) && mfd->panel_info->panel_dead) {
		mfd->unset_bl_level = mfd->bl_level;
		mfd->unset_bl_level = mfd->bl_level;
	} else {
	} else if (!mfd->allow_secure_bl_update) {
		mfd->unset_bl_level = U32_MAX;
		mfd->unset_bl_level = U32_MAX;
	}
	}


@@ -1734,6 +1735,9 @@ void mdss_fb_set_backlight(struct msm_fb_data_type *mfd, u32 bkl_lvl)
							&ad_bl_notify_needed);
							&ad_bl_notify_needed);
		if (!IS_CALIB_MODE_BL(mfd))
		if (!IS_CALIB_MODE_BL(mfd))
			mdss_fb_scale_bl(mfd, &temp);
			mdss_fb_scale_bl(mfd, &temp);

		if (!temp && !mfd->allow_secure_bl_update && mfd->bl_level)
			mfd->unset_bl_level =  mfd->bl_level;
		/*
		/*
		 * Even though backlight has been scaled, want to show that
		 * Even though backlight has been scaled, want to show that
		 * backlight has been set to bkl_lvl to those that read from
		 * backlight has been set to bkl_lvl to those that read from
@@ -1914,6 +1918,7 @@ static int mdss_fb_blank_blank(struct msm_fb_data_type *mfd,
		mfd->allow_bl_update = true;
		mfd->allow_bl_update = true;
		mdss_fb_set_backlight(mfd, 0);
		mdss_fb_set_backlight(mfd, 0);
		mfd->allow_bl_update = false;
		mfd->allow_bl_update = false;
		if (current_bl)
			mfd->unset_bl_level = current_bl;
			mfd->unset_bl_level = current_bl;
		mutex_unlock(&mfd->bl_lock);
		mutex_unlock(&mfd->bl_lock);
	}
	}
@@ -1960,6 +1965,8 @@ static int mdss_fb_blank_unblank(struct msm_fb_data_type *mfd)
		return 0;
		return 0;
	}
	}


	mfd->allow_secure_bl_update = false;

	if (mfd->mdp.on_fnc) {
	if (mfd->mdp.on_fnc) {
		struct mdss_panel_info *panel_info = mfd->panel_info;
		struct mdss_panel_info *panel_info = mfd->panel_info;
		struct fb_var_screeninfo *var = &mfd->fbi->var;
		struct fb_var_screeninfo *var = &mfd->fbi->var;
+2 −1
Original line number Original line Diff line number Diff line
/* Copyright (c) 2008-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2018,2020, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -322,6 +322,7 @@ struct msm_fb_data_type {
	struct mutex bl_lock;
	struct mutex bl_lock;
	struct mutex mdss_sysfs_lock;
	struct mutex mdss_sysfs_lock;
	bool ipc_resume;
	bool ipc_resume;
	bool allow_secure_bl_update;


	struct platform_device *pdev;
	struct platform_device *pdev;


Loading