summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/via/via_drv.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-10-25 16:32:45 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-12-22 00:33:19 +0100
commitc828e20456301b0f5192a1f75e8bf8a6afd15551 (patch)
treeac305d3618dafc1f8c3d9f18011d91badee9aabe /drivers/gpu/drm/via/via_drv.c
parentfdc0b8a63c1124bb025a2846d41531a123845740 (diff)
downloadblackbird-op-linux-c828e20456301b0f5192a1f75e8bf8a6afd15551.tar.gz
blackbird-op-linux-c828e20456301b0f5192a1f75e8bf8a6afd15551.zip
drm/via: track obj->drm_fd relations in the driver
Exactly like the previous patch for sis. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/via/via_drv.c')
-rw-r--r--drivers/gpu/drm/via/via_drv.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index fb43fd368ce1..02661f35f7a0 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -30,6 +30,29 @@
#include "drm_pciids.h"
+static int via_driver_open(struct drm_device *dev, struct drm_file *file)
+{
+ struct via_file_private *file_priv;
+
+ DRM_DEBUG_DRIVER("\n");
+ file_priv = kmalloc(sizeof(*file_priv), GFP_KERNEL);
+ if (!file_priv)
+ return -ENOMEM;
+
+ file->driver_priv = file_priv;
+
+ INIT_LIST_HEAD(&file_priv->obj_list);
+
+ return 0;
+}
+
+void via_driver_postclose(struct drm_device *dev, struct drm_file *file)
+{
+ struct via_file_private *file_priv = file->driver_priv;
+
+ kfree(file_priv);
+}
+
static struct pci_device_id pciidlist[] = {
viadrv_PCI_IDS
};
@@ -51,6 +74,8 @@ static struct drm_driver driver = {
DRIVER_IRQ_SHARED,
.load = via_driver_load,
.unload = via_driver_unload,
+ .open = via_driver_open,
+ .postclose = via_driver_postclose,
.context_dtor = via_final_context,
.get_vblank_counter = via_get_vblank_counter,
.enable_vblank = via_enable_vblank,
OpenPOWER on IntegriCloud