[Openchrome-devel] drm-openchrome: 4 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Mon Jan 2 07:36:51 UTC 2017
drivers/gpu/drm/via/via_drv.c | 90 ++++++++++++++++++++++++++----------------
drivers/gpu/drm/via/via_drv.h | 4 -
2 files changed, 59 insertions(+), 35 deletions(-)
New commits:
commit 502ad2c1f2cd55e0cb01f75bbe85a33185466f44
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun Jan 1 23:36:06 2017 -0800
Version bumped to 3.0.10
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 c2705dc..3f6788c 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 "20161231"
+#define DRIVER_DATE "20170102"
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 9
+#define DRIVER_PATCHLEVEL 10
#include <linux/module.h>
commit 4a2b931ed97ac19a871e6f88597c766be7b40629
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun Jan 1 23:34:48 2017 -0800
Made improvements to via_driver_load error condition handling
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 52af9d4..e176465 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -324,9 +324,10 @@ via_driver_load(struct drm_device *dev, unsigned long chipset)
DRM_INFO("Entered via_driver_load.\n");
dev_priv = kzalloc(sizeof(struct drm_via_private), GFP_KERNEL);
- if (dev_priv == NULL) {
+ if (!dev_priv) {
+ ret = -ENOMEM;
DRM_ERROR("Failed to allocate private storage memory.\n");
- return -ENOMEM;
+ goto exit;
}
dev->dev_private = (void *)dev_priv;
@@ -339,19 +340,19 @@ via_driver_load(struct drm_device *dev, unsigned long chipset)
ret = via_ttm_init(dev);
if (ret) {
DRM_ERROR("Failed to initialize TTM.\n");
- goto out_err;
+ goto init_error;
}
ret = via_detect_vram(dev);
if (ret) {
DRM_ERROR("Failed to initialize video RAM.\n");
- goto out_err;
+ goto init_error;
}
ret = via_mmio_setup(dev);
if (ret) {
DRM_ERROR("Failed to map Chrome IGP MMIO region.\n");
- goto out_err;
+ goto init_error;
}
chip_revision_info(dev);
@@ -375,57 +376,61 @@ via_driver_load(struct drm_device *dev, unsigned long chipset)
DRM_INFO("Allocated %u KB of DMA memory.\n", SGDMA_MEMORY >> 10);
} else {
DRM_ERROR("Failed to allocate DMA memory.\n");
+ goto init_error;
}
}
/* Allocate VQ. (Virtual Queue) */
ret = ttm_allocate_kernel_buffer(&dev_priv->bdev, VQ_MEMORY, 16,
TTM_PL_FLAG_VRAM, &dev_priv->vq);
- if (likely(!ret))
+ if (likely(!ret)) {
DRM_INFO("Allocated %u KB of VQ (Virtual Queue) memory.\n", VQ_MEMORY >> 10);
- else
+ } else {
DRM_ERROR("Failed to allocate VQ (Virtual Queue) memory.\n");
+ goto init_error;
+ }
via_engine_init(dev);
/* Setting up a work queue. */
dev_priv->wq = create_workqueue("viadrm");
- if (dev_priv->wq == NULL) {
+ if (!dev_priv->wq) {
DRM_ERROR("Failed to create a work queue.\n");
ret = -EINVAL;
- goto out_err;
+ goto init_error;
}
ret = drm_vblank_init(dev, 2);
if (ret) {
DRM_ERROR("Failed to initialize DRM VBlank.\n");
- goto out_err;
+ goto init_error;
}
ret = via_dmablit_init(dev);
if (ret) {
DRM_ERROR("Failed to initialize DMA.\n");
- goto out_err;
+ goto init_error;
}
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
ret = via_modeset_init(dev);
if (ret) {
DRM_ERROR("Failed to initialize mode setting.\n");
- goto out_err;
+ goto init_error;
}
}
ret = drm_irq_install(dev, dev->pdev->irq);
if (ret) {
DRM_ERROR("Failed to initialize DRM IRQ.\n");
- goto out_err;
+ goto init_error;
}
-out_err:
+ goto exit;
+init_error:
if (ret)
via_driver_unload(dev);
-
+exit:
DRM_INFO("Exiting via_driver_load.\n");
return ret;
}
commit 585620aed009db2babb9275c3d8f0ef6e0ac87f0
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun Jan 1 23:33:21 2017 -0800
Added debug messages to via_driver_load
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 b9c5737..52af9d4 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -321,9 +321,13 @@ via_driver_load(struct drm_device *dev, unsigned long chipset)
struct drm_via_private *dev_priv;
int ret = 0;
- dev_priv = kzalloc(sizeof(struct drm_via_private), GFP_KERNEL);
- if (dev_priv == NULL)
+ DRM_INFO("Entered via_driver_load.\n");
+
+ dev_priv = kzalloc(sizeof(struct drm_via_private), GFP_KERNEL);
+ if (dev_priv == NULL) {
+ DRM_ERROR("Failed to allocate private storage memory.\n");
return -ENOMEM;
+ }
dev->dev_private = (void *)dev_priv;
dev_priv->engine_type = chipset;
@@ -333,16 +337,20 @@ via_driver_load(struct drm_device *dev, unsigned long chipset)
via_init_command_verifier();
ret = via_ttm_init(dev);
- if (ret)
+ if (ret) {
+ DRM_ERROR("Failed to initialize TTM.\n");
goto out_err;
+ }
ret = via_detect_vram(dev);
- if (ret)
+ if (ret) {
+ DRM_ERROR("Failed to initialize video RAM.\n");
goto out_err;
+ }
ret = via_mmio_setup(dev);
if (ret) {
- DRM_INFO("VIA MMIO region failed to map\n");
+ DRM_ERROR("Failed to map Chrome IGP MMIO region.\n");
goto out_err;
}
@@ -355,57 +363,70 @@ via_driver_load(struct drm_device *dev, unsigned long chipset)
if (!ret)
via_agp_engine_init(dev_priv);
else
- DRM_ERROR("Failed to allocate AGP\n");
+ DRM_ERROR("Failed to allocate AGP.\n");
}
#endif
if (pci_is_pcie(dev->pdev)) {
- /* allocate the gart table */
+ /* Allocate GART. */
ret = ttm_allocate_kernel_buffer(&dev_priv->bdev, SGDMA_MEMORY,
16, TTM_PL_FLAG_VRAM,
&dev_priv->gart);
if (likely(!ret)) {
- DRM_INFO("Allocated %u KB of DMA memory\n",
- SGDMA_MEMORY >> 10);
- } else
- DRM_ERROR("Failed to allocate DMA memory\n");
+ DRM_INFO("Allocated %u KB of DMA memory.\n", SGDMA_MEMORY >> 10);
+ } else {
+ DRM_ERROR("Failed to allocate DMA memory.\n");
+ }
}
- /* allocate vq bo */
+ /* Allocate VQ. (Virtual Queue) */
ret = ttm_allocate_kernel_buffer(&dev_priv->bdev, VQ_MEMORY, 16,
TTM_PL_FLAG_VRAM, &dev_priv->vq);
if (likely(!ret))
- DRM_INFO("Allocated %u KB of memory for VQ\n", VQ_MEMORY >> 10);
+ DRM_INFO("Allocated %u KB of VQ (Virtual Queue) memory.\n", VQ_MEMORY >> 10);
else
- DRM_ERROR("Failed to allocate VQ memory\n");
+ DRM_ERROR("Failed to allocate VQ (Virtual Queue) memory.\n");
via_engine_init(dev);
- /* setup workqueue */
+ /* Setting up a work queue. */
dev_priv->wq = create_workqueue("viadrm");
if (dev_priv->wq == NULL) {
- DRM_ERROR("create_workqueue failed !\n");
+ DRM_ERROR("Failed to create a work queue.\n");
ret = -EINVAL;
goto out_err;
}
ret = drm_vblank_init(dev, 2);
- if (ret)
+ if (ret) {
+ DRM_ERROR("Failed to initialize DRM VBlank.\n");
goto out_err;
+ }
ret = via_dmablit_init(dev);
- if (ret)
+ if (ret) {
+ DRM_ERROR("Failed to initialize DMA.\n");
goto out_err;
+ }
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
ret = via_modeset_init(dev);
- if (ret)
- goto out_err;
+ if (ret) {
+ DRM_ERROR("Failed to initialize mode setting.\n");
+ goto out_err;
+ }
}
ret = drm_irq_install(dev, dev->pdev->irq);
+ if (ret) {
+ DRM_ERROR("Failed to initialize DRM IRQ.\n");
+ goto out_err;
+ }
+
out_err:
if (ret)
via_driver_unload(dev);
+
+ DRM_INFO("Exiting via_driver_load.\n");
return ret;
}
commit 3d1564398c0c3b750c2547b6be207350dd3a377a
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun Jan 1 23:32:04 2017 -0800
Removing hardcoding of major and minor version
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 f4562d8..b9c5737 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -524,8 +524,6 @@ static int __init via_init(void)
via_pci_driver.resume = via_pci_resume;
#endif
via_driver.driver_features |= DRIVER_MODESET;
- via_driver.major = 3;
- via_driver.minor = 0;
}
return drm_pci_init(&via_driver, &via_pci_driver);
}
More information about the Openchrome-devel
mailing list