From patchwork Mon Jul 9 17:31:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10515395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 08F4B600CA for ; Mon, 9 Jul 2018 17:35:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E677C28D0D for ; Mon, 9 Jul 2018 17:35:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA4B828DD3; Mon, 9 Jul 2018 17:35:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7452A28DD2 for ; Mon, 9 Jul 2018 17:35:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F92D89E43; Mon, 9 Jul 2018 17:35:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id A0A1589E43 for ; Mon, 9 Jul 2018 17:35:15 +0000 (UTC) Received: by mail-yw0-x243.google.com with SMTP id q129-v6so4029097ywg.8 for ; Mon, 09 Jul 2018 10:35:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=pROWaJXu4AH0XMKow1Xa+tPRkI97quob7Me+tenAILc=; b=JwdkpDZhKLBzlEgDDFzvj/GioMLThP4we/2bAoKLFF7O/WgqjC86i7VUiokxCp4mY+ zxncvmeVp0gQEHf2KgiphIaTyqKzgnEhMFI7PbtalsKkBaahz61mfgcMVjbMRb9o5uYn OChB5BzYhGia2WMZNmbTaGXNm6grPndgPigzfeYYDeTb1NlFvyXWzOD7mjgvZGr+8sHM dhMIYxXR5HlvKjF/sjs3XZdbq7jywl9QnSN6FMDqLRg3t6/9Ae2tgHQXjZ2bixOkJAeI yl+PVc4LllENn0Jzcg6zTE7ibfH7ZWhGxWM0OqWgG/mbNHIbDn70za/Oeg7ZvYhik0jb QUJQ== X-Gm-Message-State: APt69E3PdxIdxkC+CujkTW1Dm8ylfaqCWuw0QCyKscHpADSRy3ae6Rku wMkrU3wd8UPfcrLbOXtig03EXg== X-Google-Smtp-Source: AAOMgpfyJyUl+6vsFTGh7ljmbS19+nOEMP3xUwuvZ2zLbKDhmgzBeLV6Adykm1Qhnu37r5+CrQ1QYQ== X-Received: by 2002:a81:c6:: with SMTP id 189-v6mr10263037ywa.169.1531157714939; Mon, 09 Jul 2018 10:35:14 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id s206-v6sm5885495ywc.55.2018.07.09.10.35.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 10:35:14 -0700 (PDT) From: Sean Paul To: abhinavk@codeaurora.org, architt@codeaurora.org, chandanu@codeaurora.org, jsanka@codeaurora.org, jcrouse@codeaurora.org, ryadav@codeaurora.org, seanpaul@chromium.org, skolluku@codeaurora.org, dri-devel@lists.freedesktop.org, robdclark@gmail.com, airlied@linux.ie, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, nganji@codeaurora.org, hoegsberg@chromium.org, dovizu@chromium.org, robh+dt@kernel.org Subject: [PATCH 17/21] drm/msm: Add preclose kms hook Date: Mon, 9 Jul 2018 13:31:53 -0400 Message-Id: <20180709173200.238457-18-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180709173200.238457-1-seanpaul@chromium.org> References: <20180709173200.238457-1-seanpaul@chromium.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jeykumar Sankaran This is needed by the dpu driver Signed-off-by: Jeykumar Sankaran [seanpaul split from the dpu megapatch] Signed-off-by: Sean Paul --- 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);