[openchrome-devel] drm-openchrome: Branch 'drm-next-5.5' - 7 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Sat Nov 9 03:08:52 UTC 2019
drivers/gpu/drm/openchrome/openchrome_drv.c | 54 ------
drivers/gpu/drm/openchrome/openchrome_drv.h | 9 -
drivers/gpu/drm/openchrome/openchrome_init.c | 233 ---------------------------
3 files changed, 10 insertions(+), 286 deletions(-)
New commits:
commit c4280e7527f608bc5794d1c4a02f1e3c2bf703c4
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 8 18:38:14 2019 -0800
drm/openchrome: Version bumped to 3.1.21
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index c54f0cd92852..789d4802f7a1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,10 +61,10 @@
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 1
-#define DRIVER_PATCHLEVEL 20
+#define DRIVER_PATCHLEVEL 21
#define DRIVER_NAME "openchrome"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20191022"
+#define DRIVER_DATE "20191108"
#define DRIVER_AUTHOR "OpenChrome Project"
commit 3397fcbcef02816c98d5902caaf1d212cad071db
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 8 18:24:01 2019 -0800
drm/openchrome: Eliminate engine initialization code
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 8805a94a3865..78c6274530e6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -191,8 +191,6 @@ static int via_driver_load(struct drm_device *dev,
chip_revision_info(dev_private);
- via_engine_init(dev);
-
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
ret = via_modeset_init(dev);
if (ret) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 32aa84d8f558..c54f0cd92852 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -392,8 +392,6 @@ void chip_revision_info(struct openchrome_drm_private *dev_private);
void openchrome_flag_init(struct openchrome_drm_private *dev_private);
int openchrome_device_init(struct openchrome_drm_private *dev_private);
-extern void via_engine_init(struct drm_device *dev);
-
int openchrome_dev_pm_ops_suspend(struct device *dev);
int openchrome_dev_pm_ops_resume(struct device *dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 97a1b4f9b63e..76cefab61342 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1284,10 +1284,3 @@ exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
-
-/* This function does:
- * 1. Command buffer allocation
- */
-void via_engine_init(struct drm_device *dev)
-{
-}
commit 0c77203d04e4df5a295677666bdc48e58020e150
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 8 18:05:19 2019 -0800
drm/openchrome: Eliminate 2D engine initialization code
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 61070a3187e5..97a1b4f9b63e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1285,28 +1285,9 @@ exit:
return ret;
}
-static void via_init_2d(
- struct openchrome_drm_private *dev_private,
- int pci_device)
-{
- int i;
-
- for (i = 0x04; i < 0x5c; i += 4)
- VIA_WRITE(i, 0x0);
-
- /* For 410 chip*/
- if (pci_device == PCI_DEVICE_ID_VIA_VX900_VGA)
- VIA_WRITE(0x60, 0x0);
-}
-
/* This function does:
* 1. Command buffer allocation
- * 2. hw engine intialization:2D
*/
void via_engine_init(struct drm_device *dev)
{
- struct openchrome_drm_private *dev_private = dev->dev_private;
-
- /* initial engine */
- via_init_2d(dev_private, dev->pdev->device);
}
commit 41065a3970b44a17d0dad4477bc30d56ab2a57e5
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 8 17:45:46 2019 -0800
drm/openchrome: Eliminate 3D engine initialization code
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 707f32c2dee5..61070a3187e5 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1299,147 +1299,14 @@ static void via_init_2d(
VIA_WRITE(0x60, 0x0);
}
-static void via_init_3d(
- struct openchrome_drm_private *dev_private)
-{
- unsigned long texture_stage;
- int i;
-
- VIA_WRITE(VIA_REG_TRANSET, 0x00010000);
- for (i = 0; i <= 0x9A; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, i << 24);
-
- /* guardband clipping default setting */
- VIA_WRITE(VIA_REG_TRANSPACE, (0x88 << 24) | 0x00001ed0);
- VIA_WRITE(VIA_REG_TRANSPACE, (0x89 << 24) | 0x00000800);
-
- /* Initial Texture Stage Setting */
- for (texture_stage = 0; texture_stage <= 0xf; texture_stage++) {
- VIA_WRITE(VIA_REG_TRANSET, (0x00020000 | 0x00000000 |
- (texture_stage & 0xf) << 24));
- for (i = 0 ; i <= 0x30 ; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, i << 24);
- }
-
- /* Initial Texture Sampler Setting */
- for (texture_stage = 0; texture_stage <= 0xf; texture_stage++) {
- VIA_WRITE(VIA_REG_TRANSET, (0x00020000 | 0x20000000 |
- (texture_stage & 0x10) << 24));
- for (i = 0; i <= 0x36; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, i << 24);
- }
-
- VIA_WRITE(VIA_REG_TRANSET, (0x00020000 | 0xfe000000));
- for (i = 0 ; i <= 0x13 ; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, i << 24);
-
- /* degamma table */
- VIA_WRITE(VIA_REG_TRANSET, (0x00030000 | 0x15000000));
- VIA_WRITE(VIA_REG_TRANSPACE, (0x40000000 | (30 << 20) | (15 << 10) | (5)));
- VIA_WRITE(VIA_REG_TRANSPACE, ((119 << 20) | (81 << 10) | (52)));
- VIA_WRITE(VIA_REG_TRANSPACE, ((283 << 20) | (219 << 10) | (165)));
- VIA_WRITE(VIA_REG_TRANSPACE, ((535 << 20) | (441 << 10) | (357)));
- VIA_WRITE(VIA_REG_TRANSPACE, ((119 << 20) | (884 << 20) | (757 << 10) | (640)));
-
- /* gamma table */
- VIA_WRITE(VIA_REG_TRANSET, (0x00030000 | 0x17000000));
- VIA_WRITE(VIA_REG_TRANSPACE, (0x40000000 | (13 << 20) | (13 << 10) | (13)));
- VIA_WRITE(VIA_REG_TRANSPACE, (0x40000000 | (26 << 20) | (26 << 10) | (26)));
- VIA_WRITE(VIA_REG_TRANSPACE, (0x40000000 | (39 << 20) | (39 << 10) | (39)));
- VIA_WRITE(VIA_REG_TRANSPACE, ((51 << 20) | (51 << 10) | (51)));
- VIA_WRITE(VIA_REG_TRANSPACE, ((71 << 20) | (71 << 10) | (71)));
- VIA_WRITE(VIA_REG_TRANSPACE, (87 << 20) | (87 << 10) | (87));
- VIA_WRITE(VIA_REG_TRANSPACE, (113 << 20) | (113 << 10) | (113));
- VIA_WRITE(VIA_REG_TRANSPACE, (135 << 20) | (135 << 10) | (135));
- VIA_WRITE(VIA_REG_TRANSPACE, (170 << 20) | (170 << 10) | (170));
- VIA_WRITE(VIA_REG_TRANSPACE, (199 << 20) | (199 << 10) | (199));
- VIA_WRITE(VIA_REG_TRANSPACE, (246 << 20) | (246 << 10) | (246));
- VIA_WRITE(VIA_REG_TRANSPACE, (284 << 20) | (284 << 10) | (284));
- VIA_WRITE(VIA_REG_TRANSPACE, (317 << 20) | (317 << 10) | (317));
- VIA_WRITE(VIA_REG_TRANSPACE, (347 << 20) | (347 << 10) | (347));
- VIA_WRITE(VIA_REG_TRANSPACE, (373 << 20) | (373 << 10) | (373));
- VIA_WRITE(VIA_REG_TRANSPACE, (398 << 20) | (398 << 10) | (398));
- VIA_WRITE(VIA_REG_TRANSPACE, (442 << 20) | (442 << 10) | (442));
- VIA_WRITE(VIA_REG_TRANSPACE, (481 << 20) | (481 << 10) | (481));
- VIA_WRITE(VIA_REG_TRANSPACE, (517 << 20) | (517 << 10) | (517));
- VIA_WRITE(VIA_REG_TRANSPACE, (550 << 20) | (550 << 10) | (550));
- VIA_WRITE(VIA_REG_TRANSPACE, (609 << 20) | (609 << 10) | (609));
- VIA_WRITE(VIA_REG_TRANSPACE, (662 << 20) | (662 << 10) | (662));
- VIA_WRITE(VIA_REG_TRANSPACE, (709 << 20) | (709 << 10) | (709));
- VIA_WRITE(VIA_REG_TRANSPACE, (753 << 20) | (753 << 10) | (753));
- VIA_WRITE(VIA_REG_TRANSPACE, (794 << 20) | (794 << 10) | (794));
- VIA_WRITE(VIA_REG_TRANSPACE, (832 << 20) | (832 << 10) | (832));
- VIA_WRITE(VIA_REG_TRANSPACE, (868 << 20) | (868 << 10) | (868));
- VIA_WRITE(VIA_REG_TRANSPACE, (902 << 20) | (902 << 10) | (902));
- VIA_WRITE(VIA_REG_TRANSPACE, (934 << 20) | (934 << 10) | (934));
- VIA_WRITE(VIA_REG_TRANSPACE, (966 << 20) | (966 << 10) | (966));
- VIA_WRITE(VIA_REG_TRANSPACE, (996 << 20) | (996 << 10) | (996));
-
- /* Initialize INV_ParaSubType_TexPa */
- VIA_WRITE(VIA_REG_TRANSET, (0x00030000 | 0x00000000));
- for (i = 0; i < 16; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, 0x00000000);
-
- /* Initialize INV_ParaSubType_4X4Cof */
- VIA_WRITE(VIA_REG_TRANSET, (0x00030000 | 0x11000000));
- for (i = 0; i < 32; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, 0x00000000);
-
- /* Initialize INV_ParaSubType_StipPal */
- VIA_WRITE(VIA_REG_TRANSET, (0x00030000 | 0x14000000));
- for (i = 0; i < (5 + 3); i++)
- VIA_WRITE(VIA_REG_TRANSPACE, 0x00000000);
-
- /* primitive setting & vertex format */
- VIA_WRITE(VIA_REG_TRANSET, (0x00040000));
- for (i = 0; i <= 0x62; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, (i << 24));
-
- /* c2s clamping value for screen coordinate */
- VIA_WRITE(VIA_REG_TRANSPACE, (0x50 << 24) | 0x00000000);
- VIA_WRITE(VIA_REG_TRANSPACE, (0x51 << 24) | 0x00000000);
- VIA_WRITE(VIA_REG_TRANSPACE, (0x52 << 24) | 0x00147fff);
-
- /* ParaType 0xFE - Configure and Misc Setting */
- VIA_WRITE(VIA_REG_TRANSET, (0x00fe0000));
- for (i = 0; i <= 0x47; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, (i << 24));
-
- /* ParaType 0x11 - Frame Buffer Auto-Swapping and Command Regulator */
- VIA_WRITE(VIA_REG_TRANSET, (0x00110000));
- for (i = 0; i <= 0x20; i++)
- VIA_WRITE(VIA_REG_TRANSPACE, (i << 24));
-
- VIA_WRITE(VIA_REG_TRANSET, 0x00fe0000);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x4000840f);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x47000404);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x44000000);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x46000005);
-
- /* setting Misconfig */
- VIA_WRITE(VIA_REG_TRANSET, 0x00fe0000);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x00001004);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x08000249);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x0a0002c9);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x0b0002fb);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x0c000000);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x0d0002cb);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x0e000009);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x10000049);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x110002ff);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x12000008);
- VIA_WRITE(VIA_REG_TRANSPACE, 0x130002db);
-}
-
/* This function does:
* 1. Command buffer allocation
- * 2. hw engine intialization:2D;3D
+ * 2. hw engine intialization:2D
*/
void via_engine_init(struct drm_device *dev)
{
struct openchrome_drm_private *dev_private = dev->dev_private;
- /* initial engines */
+ /* initial engine */
via_init_2d(dev_private, dev->pdev->device);
- via_init_3d(dev_private);
}
commit 43974bfc69cf5089bb74e8728954647dcff6b412
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 8 17:25:24 2019 -0800
drm/openchrome: Eliminate GART code
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 72cb91ce5cf8..8805a94a3865 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -49,8 +49,6 @@ static struct pci_device_id via_pci_table[] = {
};
MODULE_DEVICE_TABLE(pci, via_pci_table);
-#define SGDMA_MEMORY (256*1024)
-
void openchrome_drm_driver_gem_free_object_unlocked (
struct drm_gem_object *obj)
@@ -142,15 +140,6 @@ static void via_driver_unload(struct drm_device *dev)
if (drm_core_check_feature(dev, DRIVER_MODESET))
via_modeset_fini(dev);
- if (dev_private->gart_bo) {
- /* enable gtt write */
- if (pci_is_pcie(dev->pdev))
- svga_wseq_mask(VGABASE, 0x6C, 0, BIT(7));
-
- openchrome_bo_destroy(dev_private->gart_bo, true);
- dev_private->gart_bo = NULL;
- }
-
openchrome_mm_fini(dev_private);
/*
@@ -202,24 +191,6 @@ static int via_driver_load(struct drm_device *dev,
chip_revision_info(dev_private);
- if (pci_is_pcie(dev->pdev)) {
- /* Allocate GART. */
- ret = openchrome_bo_create(dev,
- &dev_private->bdev,
- SGDMA_MEMORY,
- ttm_bo_type_kernel,
- TTM_PL_FLAG_VRAM,
- true,
- &dev_private->gart_bo);
- if (ret) {
- DRM_ERROR("Failed to allocate DMA memory.\n");
- goto init_error;
- }
-
- DRM_INFO("Allocated %u KB of DMA memory.\n",
- SGDMA_MEMORY >> 10);
- }
-
via_engine_init(dev);
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 103e0cfbf472..32aa84d8f558 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -226,8 +226,6 @@ struct openchrome_drm_private {
int revision;
- struct openchrome_bo *gart_bo;
-
struct via_framebuffer_device *via_fbdev;
u8 vram_type;
unsigned long long vram_start;
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 64e9ed5453ea..707f32c2dee5 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1431,41 +1431,9 @@ static void via_init_3d(
VIA_WRITE(VIA_REG_TRANSPACE, 0x130002db);
}
-static void via_init_pcie_gart_table(
- struct openchrome_drm_private *dev_private,
- struct pci_dev *pdev)
-{
- struct openchrome_bo *bo = dev_private->gart_bo;
- u8 value;
-
- if (!pci_is_pcie(pdev) || !bo->kmap.bo)
- return;
-
- /* enable gtt write */
- svga_wseq_mask(VGABASE, 0x6C, 0x00, BIT(7));
-
- /* set the base address of gart table */
- value = (bo->kmap.bo->offset & 0xff000) >> 12;
- vga_wseq(VGABASE, 0x6A, value);
-
- value = (bo->kmap.bo->offset & 0xff000) >> 20;
- vga_wseq(VGABASE, 0x6B, value);
-
- value = vga_rseq(VGABASE, 0x6C);
- value |= ((bo->kmap.bo->offset >> 28) & 0x01);
- vga_wseq(VGABASE, 0x6C, value);
-
- /* flush the gtt cache */
- svga_wseq_mask(VGABASE, 0x6F, BIT(7), BIT(7));
-
- /* disable the gtt write */
- svga_wseq_mask(VGABASE, 0x6C, BIT(7), BIT(7));
-}
-
/* This function does:
* 1. Command buffer allocation
* 2. hw engine intialization:2D;3D
- * 3. Ring Buffer mechanism setup
*/
void via_engine_init(struct drm_device *dev)
{
@@ -1474,7 +1442,4 @@ void via_engine_init(struct drm_device *dev)
/* initial engines */
via_init_2d(dev_private, dev->pdev->device);
via_init_3d(dev_private);
-
- /* pcie gart table setup */
- via_init_pcie_gart_table(dev_private, dev->pdev);
}
commit 705084e948120ba3a44bf48cc348ab130cdd9669
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 8 16:36:35 2019 -0800
drm/openchrome: Eliminate VQ (Virtual Queue) code
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index e32b19548580..72cb91ce5cf8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -50,7 +50,6 @@ static struct pci_device_id via_pci_table[] = {
MODULE_DEVICE_TABLE(pci, via_pci_table);
#define SGDMA_MEMORY (256*1024)
-#define VQ_MEMORY (256*1024)
void openchrome_drm_driver_gem_free_object_unlocked (
@@ -143,11 +142,6 @@ static void via_driver_unload(struct drm_device *dev)
if (drm_core_check_feature(dev, DRIVER_MODESET))
via_modeset_fini(dev);
- if (dev_private->vq_bo) {
- openchrome_bo_destroy(dev_private->vq_bo, true);
- dev_private->vq_bo = NULL;
- }
-
if (dev_private->gart_bo) {
/* enable gtt write */
if (pci_is_pcie(dev->pdev))
@@ -226,23 +220,6 @@ static int via_driver_load(struct drm_device *dev,
SGDMA_MEMORY >> 10);
}
- /* Allocate VQ. (Virtual Queue) */
- ret = openchrome_bo_create(dev,
- &dev_private->bdev,
- VQ_MEMORY,
- ttm_bo_type_kernel,
- TTM_PL_FLAG_VRAM,
- true,
- &dev_private->vq_bo);
- if (ret) {
- DRM_ERROR("Failed to allocate VQ (Virtual Queue) "
- "memory.\n");
- goto init_error;
- }
-
- DRM_INFO("Allocated %u KB of VQ (Virtual Queue) memory.\n",
- VQ_MEMORY >> 10);
-
via_engine_init(dev);
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index cf6cae145848..103e0cfbf472 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -227,7 +227,6 @@ struct openchrome_drm_private {
int revision;
struct openchrome_bo *gart_bo;
- struct openchrome_bo *vq_bo;
struct via_framebuffer_device *via_fbdev;
u8 vram_type;
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 9cccc00a22a8..64e9ed5453ea 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1431,32 +1431,6 @@ static void via_init_3d(
VIA_WRITE(VIA_REG_TRANSPACE, 0x130002db);
}
-static void via_init_vq(struct openchrome_drm_private *dev_private)
-{
- unsigned long vq_start_addr, vq_end_addr, vqlen;
- unsigned long vqstartl, vqendl, vqstart_endh;
- struct openchrome_bo *bo = dev_private->vq_bo;
-
- if (!bo->kmap.bo)
- return;
-
- vq_start_addr = bo->kmap.bo->offset;
- vq_end_addr = vq_start_addr + bo->kmap.bo->mem.size - 1;
- vqstartl = 0x70000000 | (vq_start_addr & 0xFFFFFF);
- vqendl = 0x71000000 | (vq_end_addr & 0xFFFFFF);
- vqstart_endh = 0x72000000 | ((vq_start_addr & 0xFF000000) >> 24) |
- ((vq_end_addr & 0xFF000000) >> 16);
- vqlen = 0x73000000 | (bo->kmap.bo->mem.size >> 3);
-
- VIA_WRITE(0x41c, 0x00100000);
- VIA_WRITE(0x420, vqstart_endh);
- VIA_WRITE(0x420, vqstartl);
- VIA_WRITE(0x420, vqendl);
- VIA_WRITE(0x420, vqlen);
- VIA_WRITE(0x420, 0x74301001);
- VIA_WRITE(0x420, 0x00000000);
-}
-
static void via_init_pcie_gart_table(
struct openchrome_drm_private *dev_private,
struct pci_dev *pdev)
@@ -1490,7 +1464,7 @@ static void via_init_pcie_gart_table(
/* This function does:
* 1. Command buffer allocation
- * 2. hw engine intialization:2D;3D;VQ
+ * 2. hw engine intialization:2D;3D
* 3. Ring Buffer mechanism setup
*/
void via_engine_init(struct drm_device *dev)
@@ -1500,7 +1474,6 @@ void via_engine_init(struct drm_device *dev)
/* initial engines */
via_init_2d(dev_private, dev->pdev->device);
via_init_3d(dev_private);
- via_init_vq(dev_private);
/* pcie gart table setup */
via_init_pcie_gart_table(dev_private, dev->pdev);
commit 8e40c43cec2c6e2d7c835cadb27f7610f2743a21
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Nov 8 15:05:23 2019 -0800
drm/openchrome: Centralize the location of VRAM base address acquisition
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index e49fdc0c1ad9..9cccc00a22a8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -771,7 +771,14 @@ int openchrome_vram_detect(struct openchrome_drm_private *dev_private)
DRM_ERROR("No function 3 on host bridge...\n");
goto out_err;
}
- dev_private->vram_start = pci_resource_start(dev->pdev, 0);
+
+ if (dev->pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA) {
+ dev_private->vram_start =
+ pci_resource_start(dev->pdev, 2);
+ } else {
+ dev_private->vram_start =
+ pci_resource_start(dev->pdev, 0);
+ }
switch (bridge->device) {
@@ -880,9 +887,6 @@ int openchrome_vram_detect(struct openchrome_drm_private *dev_private)
/* VX900 */
case PCI_DEVICE_ID_VIA_VT3410:
- dev_private->vram_start =
- pci_resource_start(dev->pdev, 2);
-
ret = pci_read_config_byte(fn3, 0xA1, &size);
if (ret)
goto out_err;
More information about the openchrome-devel
mailing list