[Openchrome-devel] drm-openchrome: 2 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Tue Jan 24 02:26:08 UTC 2017
drivers/gpu/drm/via/via_drv.c | 32 +++++---------------------------
drivers/gpu/drm/via/via_drv.h | 2 +-
drivers/gpu/drm/via/via_ttm.c | 31 +++++++++++++++++++++++++++++--
3 files changed, 35 insertions(+), 30 deletions(-)
New commits:
commit 564119fc1c18918135668854b6ba42542a890927
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Jan 23 20:25:09 2017 -0600
Version bumped to 3.0.19
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 2c8f0ac..ff27c21 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -34,7 +34,7 @@
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 18
+#define DRIVER_PATCHLEVEL 19
#include <linux/module.h>
commit af3cbf673e1f0c417b4cdf0fd91de8da0ec99a25
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Jan 23 20:22:29 2017 -0600
Moving MMIO memory mapping code to via_mm_init
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 e9f8fb5..5f4a7a51 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -121,15 +121,14 @@ static void via_agp_engine_init(struct via_device *dev_priv)
}
#endif
-static int
+static void
via_mmio_setup(struct drm_device *dev)
{
- struct via_device *dev_priv = dev->dev_private;
- int ret, len = pci_resource_len(dev->pdev, 1);
void __iomem *regs = ioport_map(0x3c0, 100);
- struct ttm_buffer_object *bo;
u8 val;
+ DRM_INFO("Entered via_mmio_setup.\n");
+
val = ioread8(regs + 0x03);
iowrite8(val | 0x1, regs + 0x03);
val = ioread8(regs + 0x0C);
@@ -146,24 +145,7 @@ via_mmio_setup(struct drm_device *dev)
val = ioread8(regs + 0x05);
iowrite8(val | 0x38, regs + 0x05);
- ret = ttm_bo_init_mm(&dev_priv->bdev, TTM_PL_PRIV0,
- len >> PAGE_SHIFT);
- if (ret)
- return ret;
-
- ret = via_bo_create(&dev_priv->bdev, VIA_MMIO_REGSIZE, ttm_bo_type_kernel,
- TTM_PL_FLAG_PRIV0, 1, PAGE_SIZE, false, NULL, NULL, &bo);
- if (ret)
- goto err;
-
- ret = via_bo_pin(bo, &dev_priv->mmio);
-err:
- if (!ret)
- DRM_INFO("Detected MMIO at physical address 0x%08llx.\n",
- (unsigned long long) pci_resource_start(dev->pdev, 1));
- else
- ttm_bo_clean_mm(&dev_priv->bdev, TTM_PL_PRIV0);
- return ret;
+ DRM_INFO("Exiting via_mmio_setup.\n");
}
static void
@@ -343,11 +325,7 @@ via_driver_load(struct drm_device *dev, unsigned long chipset)
goto init_error;
}
- ret = via_mmio_setup(dev);
- if (ret) {
- DRM_ERROR("Failed to map Chrome IGP MMIO region.\n");
- goto init_error;
- }
+ via_mmio_setup(dev);
chip_revision_info(dev);
diff --git a/drivers/gpu/drm/via/via_ttm.c b/drivers/gpu/drm/via/via_ttm.c
index 8cd1f72..49df2af 100644
--- a/drivers/gpu/drm/via/via_ttm.c
+++ b/drivers/gpu/drm/via/via_ttm.c
@@ -556,8 +556,11 @@ static struct ttm_bo_driver via_bo_driver = {
int via_mm_init(struct via_device *dev_priv)
{
- int ret;
struct drm_device *dev = dev_priv->dev;
+ struct ttm_buffer_object *bo;
+ unsigned long long start;
+ int len;
+ int ret;
DRM_DEBUG("Entered via_mm_init.\n");
@@ -586,12 +589,36 @@ int via_mm_init(struct via_device *dev_priv)
goto exit;
}
- /* Add an MTRR for the VRAM. */
+ /* Add an MTRR for the video RAM. */
dev_priv->vram_mtrr = arch_phys_wc_add(dev_priv->vram_start, dev_priv->vram_size);
DRM_INFO("Mapped %llu MB of video RAM at physical address 0x%08llx.\n",
(unsigned long long) dev_priv->vram_size >> 20, dev_priv->vram_start);
+ start = (unsigned long long) pci_resource_start(dev->pdev, 1);
+ len = pci_resource_len(dev->pdev, 1);
+ ret = ttm_bo_init_mm(&dev_priv->bdev, TTM_PL_PRIV0, len >> PAGE_SHIFT);
+ if (ret) {
+ DRM_ERROR("Failed to map MMIO: %d\n", ret);
+ goto exit;
+ }
+
+ ret = via_bo_create(&dev_priv->bdev, VIA_MMIO_REGSIZE, ttm_bo_type_kernel,
+ TTM_PL_FLAG_PRIV0, 1, PAGE_SIZE, false, NULL, NULL, &bo);
+ if (ret) {
+ DRM_ERROR("Failed to create a buffer object for MMIO: %d\n", ret);
+ goto exit;
+ }
+
+ ret = via_bo_pin(bo, &dev_priv->mmio);
+ if (ret) {
+ DRM_ERROR("Failed to map a buffer object for MMIO: %d\n", ret);
+ ttm_bo_clean_mm(&dev_priv->bdev, TTM_PL_PRIV0);
+ goto exit;
+ }
+
+ DRM_INFO("Mapped MMIO at physical address 0x%08llx.\n",
+ start);
exit:
DRM_DEBUG("Exiting via_mm_init.\n");
return ret;
More information about the Openchrome-devel
mailing list