[17/21] drm/msm: Add preclose kms hook

Submitted by Sean Paul on July 9, 2018, 5:31 p.m.

Details

Message ID 20180709173200.238457-18-seanpaul@chromium.org
State New
Headers show
Series "drm/msm: Add support for SDM845 Display Processing Unit (DPU)" ( rev: 3 2 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Sean Paul July 9, 2018, 5:31 p.m.
From: Jeykumar Sankaran <jsanka@codeaurora.org>

This is needed by the dpu driver

Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
[seanpaul split from the dpu megapatch]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/msm/msm_drv.c | 9 +++++++++
 drivers/gpu/drm/msm/msm_kms.h | 1 +
 2 files changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 8bd9fe831968..ed6efebabc38 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -540,6 +540,14 @@  static void context_close(struct msm_file_private *ctx)
 	kfree(ctx);
 }
 
+static void msm_preclose(struct drm_device *dev, struct drm_file *file)
+{
+	struct msm_drm_private *priv = dev->dev_private;
+	struct msm_kms *kms = priv->kms;
+
+	if (kms && kms->funcs && kms->funcs->preclose)
+		kms->funcs->preclose(kms, file);
+}
 static void msm_postclose(struct drm_device *dev, struct drm_file *file)
 {
 	struct msm_drm_private *priv = dev->dev_private;
@@ -860,6 +868,7 @@  static struct drm_driver msm_driver = {
 				DRIVER_ATOMIC |
 				DRIVER_MODESET,
 	.open               = msm_open,
+	.preclose           = msm_preclose,
 	.postclose           = msm_postclose,
 	.lastclose          = drm_fb_helper_lastclose,
 	.irq_handler        = msm_irq,
diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h
index 761bb07cd7bf..9cd7223febcf 100644
--- a/drivers/gpu/drm/msm/msm_kms.h
+++ b/drivers/gpu/drm/msm/msm_kms.h
@@ -58,6 +58,7 @@  struct msm_kms_funcs {
 			struct drm_encoder *encoder,
 			struct drm_encoder *slave_encoder,
 			bool is_cmd_mode);
+	void (*preclose)(struct msm_kms *kms, struct drm_file *file);
 	void (*set_encoder_mode)(struct msm_kms *kms,
 				 struct drm_encoder *encoder,
 				 bool cmd_mode);