[Openchrome-devel] drm-openchrome: 2 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Tue Jan 17 17:36:26 UTC 2017
drivers/gpu/drm/via/init_ttm.c | 77 -----------------------------------------
drivers/gpu/drm/via/via_drv.h | 2 -
drivers/gpu/drm/via/via_mem.h | 18 ++++-----
drivers/gpu/drm/via/via_ttm.c | 77 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 87 insertions(+), 87 deletions(-)
New commits:
commit 063489f6ddc44c8b573cdc139e0b2842a02470c8
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Jan 17 10:17:52 2017 -0600
Version bumped to 3.0.13
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 3ac41dc..fdf2603 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -31,7 +31,7 @@
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 12
+#define DRIVER_PATCHLEVEL 13
#include <linux/module.h>
commit f4fa0e7f2f69155350185e2e02bf87faf15a5c3a
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue Jan 17 10:16:22 2017 -0600
Moved several functions from init_ttm.c to via_ttm.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/via/init_ttm.c b/drivers/gpu/drm/via/init_ttm.c
index 66bd79a..b574765 100644
--- a/drivers/gpu/drm/via/init_ttm.c
+++ b/drivers/gpu/drm/via/init_ttm.c
@@ -24,83 +24,6 @@
#include "drmP.h"
#include "via_mem.h"
-#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
-
-static int
-via_ttm_global_mem_init(struct drm_global_reference *ref)
-{
- return ttm_mem_global_init(ref->object);
-}
-
-static void
-via_ttm_global_mem_release(struct drm_global_reference *ref)
-{
- ttm_mem_global_release(ref->object);
-}
-
-void
-via_ttm_global_release(struct drm_global_reference *global_ref,
- struct ttm_bo_global_ref *global_bo,
- struct ttm_bo_device *bdev)
-{
- 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;
-}
-
-int
-via_ttm_global_init(struct drm_global_reference *global_ref,
- struct ttm_bo_global_ref *global_bo,
- struct ttm_bo_driver *driver,
- struct ttm_bo_device *bdev,
- struct drm_device *dev,
- bool dma32)
-{
- struct drm_global_reference *bo_ref;
- int rc;
-
- global_ref->global_type = DRM_GLOBAL_TTM_MEM;
- global_ref->size = sizeof(struct ttm_mem_global);
- global_ref->init = &via_ttm_global_mem_init;
- global_ref->release = &via_ttm_global_mem_release;
-
- rc = drm_global_item_ref(global_ref);
- if (unlikely(rc != 0)) {
- DRM_ERROR("Failed setting up TTM memory accounting\n");
- global_ref->release = NULL;
- return rc;
- }
-
- global_bo->mem_glob = global_ref->object;
- bo_ref = &global_bo->ref;
- bo_ref->global_type = DRM_GLOBAL_TTM_BO;
- bo_ref->size = sizeof(struct ttm_bo_global);
- bo_ref->init = &ttm_bo_global_init;
- bo_ref->release = &ttm_bo_global_release;
-
- rc = drm_global_item_ref(bo_ref);
- if (unlikely(rc != 0)) {
- DRM_ERROR("Failed setting up TTM BO subsystem\n");
- drm_global_item_unref(global_ref);
- global_ref->release = NULL;
- return rc;
- }
-
- rc = ttm_bo_device_init(bdev, bo_ref->object, driver,
- dev->anon_inode->i_mapping,
- DRM_FILE_PAGE_OFFSET, dma32);
- if (rc) {
- DRM_ERROR("Error initialising bo driver: %d\n", rc);
- via_ttm_global_release(global_ref, global_bo, NULL);
- }
- return rc;
-}
-
static void
ttm_buffer_object_destroy(struct ttm_buffer_object *bo)
{
diff --git a/drivers/gpu/drm/via/via_mem.h b/drivers/gpu/drm/via/via_mem.h
index 90bf52d..aeb432c 100644
--- a/drivers/gpu/drm/via/via_mem.h
+++ b/drivers/gpu/drm/via/via_mem.h
@@ -35,20 +35,20 @@ struct ttm_heap {
struct ttm_buffer_object pbo;
};
+extern void via_ttm_global_release(struct drm_global_reference *global_ref,
+ struct ttm_bo_global_ref *global_bo,
+ struct ttm_bo_device *bdev);
+extern int via_ttm_global_init(struct drm_global_reference *global_ref,
+ struct ttm_bo_global_ref *global_bo,
+ struct ttm_bo_driver *driver,
+ struct ttm_bo_device *bdev,
+ struct drm_device *dev,
+ bool dma32);
extern int via_ttm_init(struct drm_device *dev);
extern struct ttm_tt *
via_sgdma_backend_init(struct ttm_bo_device *bdev, unsigned long size,
uint32_t page_flags, struct page *dummy_read_page);
-extern int via_ttm_global_init(struct drm_global_reference *global_ref,
- struct ttm_bo_global_ref *global_bo,
- struct ttm_bo_driver *driver,
- struct ttm_bo_device *bdev,
- struct drm_device *dev,
- bool dma32);
-extern void via_ttm_global_release(struct drm_global_reference *global_ref,
- struct ttm_bo_global_ref *global_bo,
- struct ttm_bo_device *bdev);
extern int via_bo_create(struct ttm_bo_device *bdev, unsigned long size,
enum ttm_bo_type origin, uint32_t domains,
diff --git a/drivers/gpu/drm/via/via_ttm.c b/drivers/gpu/drm/via/via_ttm.c
index b0a0976..04cb2f51 100644
--- a/drivers/gpu/drm/via/via_ttm.c
+++ b/drivers/gpu/drm/via/via_ttm.c
@@ -27,6 +27,83 @@
#include "via_drv.h"
+#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
+
+static int
+via_ttm_global_mem_init(struct drm_global_reference *ref)
+{
+ return ttm_mem_global_init(ref->object);
+}
+
+static void
+via_ttm_global_mem_release(struct drm_global_reference *ref)
+{
+ ttm_mem_global_release(ref->object);
+}
+
+void
+via_ttm_global_release(struct drm_global_reference *global_ref,
+ struct ttm_bo_global_ref *global_bo,
+ struct ttm_bo_device *bdev)
+{
+ 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;
+}
+
+int
+via_ttm_global_init(struct drm_global_reference *global_ref,
+ struct ttm_bo_global_ref *global_bo,
+ struct ttm_bo_driver *driver,
+ struct ttm_bo_device *bdev,
+ struct drm_device *dev,
+ bool dma32)
+{
+ struct drm_global_reference *bo_ref;
+ int rc;
+
+ global_ref->global_type = DRM_GLOBAL_TTM_MEM;
+ global_ref->size = sizeof(struct ttm_mem_global);
+ global_ref->init = &via_ttm_global_mem_init;
+ global_ref->release = &via_ttm_global_mem_release;
+
+ rc = drm_global_item_ref(global_ref);
+ if (unlikely(rc != 0)) {
+ DRM_ERROR("Failed setting up TTM memory accounting\n");
+ global_ref->release = NULL;
+ return rc;
+ }
+
+ global_bo->mem_glob = global_ref->object;
+ bo_ref = &global_bo->ref;
+ bo_ref->global_type = DRM_GLOBAL_TTM_BO;
+ bo_ref->size = sizeof(struct ttm_bo_global);
+ bo_ref->init = &ttm_bo_global_init;
+ bo_ref->release = &ttm_bo_global_release;
+
+ rc = drm_global_item_ref(bo_ref);
+ if (unlikely(rc != 0)) {
+ DRM_ERROR("Failed setting up TTM BO subsystem\n");
+ drm_global_item_unref(global_ref);
+ global_ref->release = NULL;
+ return rc;
+ }
+
+ rc = ttm_bo_device_init(bdev, bo_ref->object, driver,
+ dev->anon_inode->i_mapping,
+ DRM_FILE_PAGE_OFFSET, dma32);
+ if (rc) {
+ DRM_ERROR("Error initialising bo driver: %d\n", rc);
+ via_ttm_global_release(global_ref, global_bo, NULL);
+ }
+ return rc;
+}
+
static struct ttm_tt *
via_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size,
uint32_t page_flags, struct page *dummy_read_page)
More information about the Openchrome-devel
mailing list