aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_proc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-11-27 23:22:24 -0500
committerDave Airlie <airlied@linux.ie>2008-12-29 02:47:22 -0500
commit7c1c2871a6a3a114853ec6836e9035ac1c0c7f7a (patch)
tree1b5debcc86ff20bd5e11b42ea5c52da42214e376 /drivers/gpu/drm/drm_proc.c
parente7f7ab45ebcb54fd5f814ea15ea079e079662f67 (diff)
drm: move to kref per-master structures.
This is step one towards having multiple masters sharing a drm device in order to get fast-user-switching to work. It splits out the information associated with the drm master into a separate kref counted structure, and allocates this when a master opens the device node. It also allows the current master to abdicate (say while VT switched), and a new master to take over the hardware. It moves the Intel and radeon drivers to using the sarea from within the new master structures. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_proc.c')
-rw-r--r--drivers/gpu/drm/drm_proc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c
index ae73b7f7249..7dbaa1a19ea 100644
--- a/drivers/gpu/drm/drm_proc.c
+++ b/drivers/gpu/drm/drm_proc.c
@@ -195,6 +195,7 @@ static int drm_name_info(char *buf, char **start, off_t offset, int request,
195 int *eof, void *data) 195 int *eof, void *data)
196{ 196{
197 struct drm_minor *minor = (struct drm_minor *) data; 197 struct drm_minor *minor = (struct drm_minor *) data;
198 struct drm_master *master = minor->master;
198 struct drm_device *dev = minor->dev; 199 struct drm_device *dev = minor->dev;
199 int len = 0; 200 int len = 0;
200 201
@@ -203,13 +204,16 @@ static int drm_name_info(char *buf, char **start, off_t offset, int request,
203 return 0; 204 return 0;
204 } 205 }
205 206
207 if (!master)
208 return 0;
209
206 *start = &buf[offset]; 210 *start = &buf[offset];
207 *eof = 0; 211 *eof = 0;
208 212
209 if (dev->unique) { 213 if (master->unique) {
210 DRM_PROC_PRINT("%s %s %s\n", 214 DRM_PROC_PRINT("%s %s %s\n",
211 dev->driver->pci_driver.name, 215 dev->driver->pci_driver.name,
212 pci_name(dev->pdev), dev->unique); 216 pci_name(dev->pdev), master->unique);
213 } else { 217 } else {
214 DRM_PROC_PRINT("%s %s\n", dev->driver->pci_driver.name, 218 DRM_PROC_PRINT("%s %s\n", dev->driver->pci_driver.name,
215 pci_name(dev->pdev)); 219 pci_name(dev->pdev));