[PATCH 2/5] drm/sti: add drm_file to sti_private

Fabien Dessenne fabien.dessenne at st.com
Tue Jan 3 16:56:49 UTC 2017


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 <fabien.dessenne at st.com>
---
 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;
-- 
2.7.4



More information about the dri-devel mailing list