From patchwork Tue Jan 3 16:56:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien DESSENNE X-Patchwork-Id: 9495209 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 93CB760414 for ; Tue, 3 Jan 2017 16:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A3DD1FEBD for ; Tue, 3 Jan 2017 16:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F2B52793A; Tue, 3 Jan 2017 16:57:21 +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=-4.2 required=2.0 tests=BAYES_00, 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 18D8C1FEBD for ; Tue, 3 Jan 2017 16:57:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B651E6E60F; Tue, 3 Jan 2017 16:57:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3C61F6E5F2 for ; Tue, 3 Jan 2017 16:57:04 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id v03GuODN031020; Tue, 3 Jan 2017 17:57:02 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-.pphosted.com with ESMTP id 27p2p9fwes-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 03 Jan 2017 17:57:02 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 843A134; Tue, 3 Jan 2017 16:57:01 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 64B4C4EBC; Tue, 3 Jan 2017 16:57:01 +0000 (GMT) Received: from localhost (10.201.23.25) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 3 Jan 2017 17:57:00 +0100 From: Fabien Dessenne To: Subject: [PATCH 2/5] drm/sti: add drm_file to sti_private Date: Tue, 3 Jan 2017 17:56:49 +0100 Message-ID: <1483462612-29448-3-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483462612-29448-1-git-send-email-fabien.dessenne@st.com> References: <1483462612-29448-1-git-send-email-fabien.dessenne@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.25] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-03_14:, , signatures=0 Cc: Vincent Abriou , kernel@stlinux.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Store the drm_file *filp in sti_private, so the driver can access more configuration information like the client capabilities. Change-Id: Ib8f305f1a41b4fdfe56f80294cd79e5dc44433ee Signed-off-by: Fabien Dessenne --- drivers/gpu/drm/sti/sti_drv.c | 10 ++++++++++ drivers/gpu/drm/sti/sti_drv.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 9a9b9a2..63febf8 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -170,6 +170,15 @@ static int sti_atomic_check(struct drm_device *dev, return ret; } +static int sti_drm_open(struct drm_device *ddev, struct drm_file *filp) +{ + struct sti_private *private = ddev->dev_private; + + private->filp = filp; + + return 0; +} + static void sti_output_poll_changed(struct drm_device *ddev) { struct sti_private *private = ddev->dev_private; @@ -226,6 +235,7 @@ static const struct file_operations sti_driver_fops = { static struct drm_driver sti_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_ATOMIC, + .open = sti_drm_open, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, diff --git a/drivers/gpu/drm/sti/sti_drv.h b/drivers/gpu/drm/sti/sti_drv.h index f9276cd..de22b0d 100644 --- a/drivers/gpu/drm/sti/sti_drv.h +++ b/drivers/gpu/drm/sti/sti_drv.h @@ -19,12 +19,15 @@ struct sti_tvout; * @compo: compositor * @plane_zorder_property: z-order property for CRTC planes * @drm_dev: drm device + * @fbdev: framebuffer dev cma struct + * @drm_file: drm file private data */ struct sti_private { struct sti_compositor *compo; struct drm_property *plane_zorder_property; struct drm_device *drm_dev; struct drm_fbdev_cma *fbdev; + struct drm_file *filp; }; extern struct platform_driver sti_tvout_driver;