diff options
Diffstat (limited to 'drivers/gpu/drm/via/via_drv.c')
-rw-r--r-- | drivers/gpu/drm/via/via_drv.c | 25 |
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 @@ | |||
30 | 30 | ||
31 | #include "drm_pciids.h" | 31 | #include "drm_pciids.h" |
32 | 32 | ||
33 | static int via_driver_open(struct drm_device *dev, struct drm_file *file) | ||
34 | { | ||
35 | struct via_file_private *file_priv; | ||
36 | |||
37 | DRM_DEBUG_DRIVER("\n"); | ||
38 | file_priv = kmalloc(sizeof(*file_priv), GFP_KERNEL); | ||
39 | if (!file_priv) | ||
40 | return -ENOMEM; | ||
41 | |||
42 | file->driver_priv = file_priv; | ||
43 | |||
44 | INIT_LIST_HEAD(&file_priv->obj_list); | ||
45 | |||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | void via_driver_postclose(struct drm_device *dev, struct drm_file *file) | ||
50 | { | ||
51 | struct via_file_private *file_priv = file->driver_priv; | ||
52 | |||
53 | kfree(file_priv); | ||
54 | } | ||
55 | |||
33 | static struct pci_device_id pciidlist[] = { | 56 | static struct pci_device_id pciidlist[] = { |
34 | viadrv_PCI_IDS | 57 | viadrv_PCI_IDS |
35 | }; | 58 | }; |
@@ -51,6 +74,8 @@ static struct drm_driver driver = { | |||
51 | DRIVER_IRQ_SHARED, | 74 | DRIVER_IRQ_SHARED, |
52 | .load = via_driver_load, | 75 | .load = via_driver_load, |
53 | .unload = via_driver_unload, | 76 | .unload = via_driver_unload, |
77 | .open = via_driver_open, | ||
78 | .postclose = via_driver_postclose, | ||
54 | .context_dtor = via_final_context, | 79 | .context_dtor = via_final_context, |
55 | .get_vblank_counter = via_get_vblank_counter, | 80 | .get_vblank_counter = via_get_vblank_counter, |
56 | .enable_vblank = via_enable_vblank, | 81 | .enable_vblank = via_enable_vblank, |