[Freedreno] [PATCH 17/21] drm/msm: Add preclose kms hook
Sean Paul
seanpaul at chromium.org
Mon Jul 9 17:31:53 UTC 2018
From: Jeykumar Sankaran <jsanka at codeaurora.org>
This is needed by the dpu driver
Signed-off-by: Jeykumar Sankaran <jsanka at codeaurora.org>
[seanpaul split from the dpu megapatch]
Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
drivers/gpu/drm/msm/msm_drv.c | 9 +++++++++
drivers/gpu/drm/msm/msm_kms.h | 1 +
2 files changed, 10 insertions(+)
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);
--
Sean Paul, Software Engineer, Google / Chromium OS
More information about the Freedreno
mailing list