[Openchrome-devel] drm-openchrome: 2 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Tue Jan 17 21:05:20 UTC 2017
drivers/gpu/drm/via/via_drv.c | 8 +-------
drivers/gpu/drm/via/via_drv.h | 4 ++--
drivers/gpu/drm/via/via_mem.h | 1 +
drivers/gpu/drm/via/via_ttm.c | 28 ++++++++++++++++++++++++++--
4 files changed, 30 insertions(+), 11 deletions(-)
New commits:
commit fbfb03880ee93ce3ef1d42ef702329cc2a25e8c5
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Jan 17 15:04:04 2017 -0600
Version bumped to 3.0.14
Risky code rewriting was done in this version.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index fdf2603..dd7f03f 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -27,11 +27,11 @@
#define DRIVER_AUTHOR "The OpenChrome Project"
#define DRIVER_NAME "via"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20170116"
+#define DRIVER_DATE "20170117"
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 13
+#define DRIVER_PATCHLEVEL 14
#include <linux/module.h>
commit 8798867b09fdfdf6a9d3b627fb3a4ee936faf0c7
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Jan 17 15:03:23 2017 -0600
Created via_mm_fini
This was done to have some code commonality with Matrox G200 DRM.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 63d8d26..3e51ee2 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -299,13 +299,7 @@ static int via_driver_unload(struct drm_device *dev)
ttm_bo_unref(&bo);
}
- /* mtrr delete the vram */
- if (dev_priv->vram_mtrr >= 0)
- arch_phys_wc_del(dev_priv->vram_mtrr);
-
- via_ttm_global_release(&dev_priv->mem_global_ref,
- &dev_priv->bo_global_ref,
- &dev_priv->bdev);
+ via_mm_fini(dev);
#if __OS_HAS_AGP
if (dev->agp && dev->agp->acquired)
diff --git a/drivers/gpu/drm/via/via_mem.h b/drivers/gpu/drm/via/via_mem.h
index aeb432c..350d622 100644
--- a/drivers/gpu/drm/via/via_mem.h
+++ b/drivers/gpu/drm/via/via_mem.h
@@ -64,6 +64,7 @@ extern int via_bo_pin(struct ttm_buffer_object *bo, struct ttm_bo_kmap_obj *kmap
extern int ttm_allocate_kernel_buffer(struct ttm_bo_device *bdev, unsigned long size,
uint32_t alignment, uint32_t domain,
struct ttm_bo_kmap_obj *kmap);
+void via_mm_fini(struct drm_device *dev);
extern int ttm_mmap(struct file *filp, struct vm_area_struct *vma);
diff --git a/drivers/gpu/drm/via/via_ttm.c b/drivers/gpu/drm/via/via_ttm.c
index 04cb2f51..5357849 100644
--- a/drivers/gpu/drm/via/via_ttm.c
+++ b/drivers/gpu/drm/via/via_ttm.c
@@ -46,14 +46,16 @@ via_ttm_global_release(struct drm_global_reference *global_ref,
struct ttm_bo_global_ref *global_bo,
struct ttm_bo_device *bdev)
{
+ DRM_DEBUG("Entered via_ttm_global_release.\n");
+
if (global_ref->release == NULL)
return;
- if (bdev)
- ttm_bo_device_release(bdev);
drm_global_item_unref(&global_bo->ref);
drm_global_item_unref(global_ref);
global_ref->release = NULL;
+
+ DRM_DEBUG("Exiting via_ttm_global_release.\n");
}
int
@@ -565,3 +567,25 @@ int via_ttm_init(struct drm_device *dev)
dev_priv->bdev.dev_mapping = dev_priv->dev->anon_inode->i_mapping;
return ret;
}
+
+void via_mm_fini(struct drm_device *dev)
+{
+ struct drm_via_private *dev_priv = dev->dev_private;
+
+ DRM_DEBUG("Entered via_mm_fini.\n");
+
+ ttm_bo_device_release(&dev_priv->bdev);
+
+ via_ttm_global_release(&dev_priv->mem_global_ref,
+ &dev_priv->bo_global_ref,
+ &dev_priv->bdev);
+
+ /* mtrr delete the vram */
+ if (dev_priv->vram_mtrr >= 0) {
+ arch_phys_wc_del(dev_priv->vram_mtrr);
+ }
+
+ dev_priv->vram_mtrr = 0;
+
+ DRM_DEBUG("Exiting via_mm_fini.\n");
+}
More information about the Openchrome-devel
mailing list