summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/drm_drv.c15
-rw-r--r--linux-core/i915_drv.c5
-rw-r--r--shared-core/i915_init.c9
3 files changed, 24 insertions, 5 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index dd76421f..434789dd 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -187,7 +187,9 @@ int drm_lastclose(struct drm_device * dev)
DRM_DEBUG("\n");
-/* return 0; */
+ if (!drm_core_check_feature(dev, DRIVER_MODESET))
+ drm_bo_driver_finish(dev);
+
/*
* We can't do much about this function failing.
*/
@@ -425,13 +427,20 @@ int drm_minors_cleanup(int id, void *ptr, void *data)
struct drm_minor *minor = ptr;
struct drm_device *dev;
struct drm_driver *driver = data;
- if (id < 127 || id > 192)
- return 0;
dev = minor->dev;
if (minor->dev->driver != driver)
return 0;
+ if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+ if (minor->type != DRM_MINOR_CONTROL)
+ return 0;
+ } else {
+ if (minor->type != DRM_MINOR_LEGACY)
+ return 0;
+ }
+
+
if (dev)
pci_dev_put(dev->pdev);
drm_cleanup(dev);
diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c
index b844dfe6..0e65c0cd 100644
--- a/linux-core/i915_drv.c
+++ b/linux-core/i915_drv.c
@@ -48,8 +48,8 @@ extern struct drm_fence_driver i915_fence_driver;
#ifdef I915_HAVE_BUFFER
-static uint32_t i915_mem_prios[] = {DRM_BO_MEM_VRAM, DRM_BO_MEM_PRIV0, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL};
-static uint32_t i915_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_PRIV0, DRM_BO_MEM_VRAM, DRM_BO_MEM_LOCAL};
+static uint32_t i915_mem_prios[] = {DRM_BO_MEM_VRAM, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL};
+static uint32_t i915_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_VRAM, DRM_BO_MEM_LOCAL};
static struct drm_bo_driver i915_bo_driver = {
.mem_type_prio = i915_mem_prios,
@@ -566,6 +566,7 @@ static struct drm_driver driver = {
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
.load = i915_driver_load,
.unload = i915_driver_unload,
+ .firstopen = i915_driver_firstopen,
.lastclose = i915_driver_lastclose,
.preclose = i915_driver_preclose,
.suspend = i915_suspend,
diff --git a/shared-core/i915_init.c b/shared-core/i915_init.c
index a2e08bc1..1f22d171 100644
--- a/shared-core/i915_init.c
+++ b/shared-core/i915_init.c
@@ -401,3 +401,12 @@ void i915_driver_lastclose(struct drm_device * dev)
i915_dma_cleanup(dev);
}
+
+int i915_driver_firstopen(struct drm_device *dev)
+{
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ return 0;
+
+ drm_bo_driver_init(dev);
+ return 0;
+}