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

Commit bd6b7ab8 authored by Ping Li's avatar Ping Li Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: Add support for mdp LUT memory retention for display



When crtc is enabled, set mdp lut memory retention flag to retain
memory for color processing features; when crtc is disabled, set
mdp lut memory retention flag to not retain the memory.

Change-Id: I6d4c09b4ed05cb6bd85248c40dda214ad670dac2
Signed-off-by: default avatarPing Li <pingli@codeaurora.org>
parent d1280f8c
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_flip_work.h>
#include <linux/clk/qcom.h>

#include "sde_kms.h"
#include "sde_hw_lm.h"
@@ -4131,6 +4132,12 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
	msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
			(u8 *)&power_on);

	/* disable mdp LUT memory retention */
	ret = sde_power_clk_set_flags(&priv->phandle, "lut_clk",
				CLKFLAG_NORETAIN_MEM);
	if (ret)
		SDE_ERROR("failed to disable LUT memory retention %d\n", ret);

	/* destination scaler if enabled should be reconfigured on resume */
	if (cstate->num_ds_enabled)
		sde_crtc->ds_reconfig = true;
@@ -4277,6 +4284,12 @@ static void sde_crtc_enable(struct drm_crtc *crtc,
	msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
			(u8 *)&power_on);

	/* enable mdp LUT memory retention */
	ret = sde_power_clk_set_flags(&priv->phandle, "lut_clk",
					CLKFLAG_RETAIN_MEM);
	if (ret)
		SDE_ERROR("failed to enable LUT memory retention %d\n", ret);

	mutex_unlock(&sde_crtc->crtc_lock);

	spin_lock_irqsave(&sde_crtc->spin_lock, flags);