[openchrome-devel] drm-openchrome: Branch 'drm-next-5.1' - 3 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Fri Jan 25 23:29:33 UTC 2019


 drivers/gpu/drm/openchrome/openchrome_crtc.c    |   11 ++-
 drivers/gpu/drm/openchrome/openchrome_display.c |   12 ++-
 drivers/gpu/drm/openchrome/openchrome_display.h |    2 
 drivers/gpu/drm/openchrome/openchrome_drv.c     |   17 ----
 drivers/gpu/drm/openchrome/openchrome_drv.h     |    8 --
 drivers/gpu/drm/openchrome/openchrome_init.c    |   82 ------------------------
 drivers/gpu/drm/openchrome/openchrome_ioc32.c   |    1 
 drivers/gpu/drm/openchrome/openchrome_ttm.c     |   28 --------
 8 files changed, 21 insertions(+), 140 deletions(-)

New commits:
commit 78ef4a26e5f77623d4402714539379aecc121914
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jan 25 17:28:45 2019 -0600

    drm/openchrome: Version bumped to 3.1.4
    
    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 f872386138ff..5d7be047a9ef 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -51,10 +51,10 @@
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		1
-#define DRIVER_PATCHLEVEL	3
+#define DRIVER_PATCHLEVEL	4
 #define DRIVER_NAME		"openchrome"
 #define DRIVER_DESC		"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE		"20190110"
+#define DRIVER_DATE		"20190125"
 #define DRIVER_AUTHOR		"OpenChrome Project"
 
 
commit 0a9e03d347a6f2285a6fdbb134e75e647a0f3019
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jan 25 17:25:54 2019 -0600

    drm/openchrome: Let via_crtc_init return a value
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 2a0ab4a08800..3bfbf3a2d6c6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -2402,8 +2402,7 @@ static const struct drm_crtc_helper_funcs via_iga2_helper_funcs = {
 	.mode_set_base_atomic = via_iga2_mode_set_base_atomic,
 };
 
-void
-via_crtc_init(struct drm_device *dev, int index)
+int via_crtc_init(struct drm_device *dev, int index)
 {
 	struct openchrome_drm_private *dev_private =
 						dev->dev_private;
@@ -2411,6 +2410,7 @@ via_crtc_init(struct drm_device *dev, int index)
 	struct drm_crtc *crtc = &iga->base;
 	int cursor_size = 64 * 64 * 4, i;
 	u16 *gamma;
+	int ret;
 
 	iga->index = index;
 	if (index) {
@@ -2582,8 +2582,11 @@ via_crtc_init(struct drm_device *dev, int index)
 			|| dev->pdev->device == PCI_DEVICE_ID_VIA_KM400)
 		cursor_size = 32 * 32 * 4;
 
-	if (via_ttm_allocate_kernel_buffer(&dev_private->ttm.bdev,
+	ret = via_ttm_allocate_kernel_buffer(&dev_private->ttm.bdev,
 				cursor_size, 16,
-				TTM_PL_FLAG_VRAM, &iga->cursor_kmap))
+				TTM_PL_FLAG_VRAM, &iga->cursor_kmap);
+	if (ret)
 		DRM_ERROR("failed to create cursor\n");
+
+	return ret;
 }
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 86c56b27cd87..07f208ed70bd 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -480,7 +480,6 @@ via_modeset_init(struct drm_device *dev)
 {
 	struct openchrome_drm_private *dev_private = dev->dev_private;
 	int ret = 0;
-	int i;
 
 	drm_mode_config_init(dev);
 
@@ -498,8 +497,15 @@ via_modeset_init(struct drm_device *dev)
 	via_i2c_init(dev);
 	via_hwcursor_init(dev_private);
 
-	for (i = 0; i < 2; i++)
-		via_crtc_init(dev, i);
+	ret = via_crtc_init(dev, 0);
+	if (ret) {
+		goto exit;
+	}
+
+	ret = via_crtc_init(dev, 1);
+	if (ret) {
+		goto exit;
+	}
 
 	openchrome_ext_dvi_probe(dev);
 	via_tmds_probe(dev);
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.h b/drivers/gpu/drm/openchrome/openchrome_display.h
index 1240bef2f779..e5be8e61e2bc 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.h
+++ b/drivers/gpu/drm/openchrome/openchrome_display.h
@@ -171,7 +171,7 @@ extern void via_fbdev_fini(struct drm_device *dev);
 /* crtc */
 extern void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
 					struct drm_display_mode *mode);
-extern void via_crtc_init(struct drm_device *dev, int index);
+extern int via_crtc_init(struct drm_device *dev, int index);
 
 /* encoders */
 extern void via_set_sync_polarity(struct drm_encoder *encoder,
commit 3094359250e28289a5c93aaee9940cbcff234fd6
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jan 24 16:58:45 2019 -0600

    drm/openchrome: Remove AGP support
    
    Further removing the unfinished acceleration 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 76f1442a85cb..e929a96c92f0 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -147,10 +147,6 @@ static void via_driver_unload(struct drm_device *dev)
 
 	openchrome_mmio_fini(dev_private);
 
-#if IS_ENABLED(CONFIG_AGP)
-	if (dev->agp && dev->agp->acquired)
-		drm_agp_release(dev);
-#endif
 	kfree(dev_private);
 
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
@@ -193,17 +189,6 @@ static int via_driver_load(struct drm_device *dev,
 
 	chip_revision_info(dev_private);
 
-#if IS_ENABLED(CONFIG_AGP)
-	if ((dev_private->engine_type <= VIA_ENG_H2) ||
-		(dev->agp &&
-		pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))) {
-		ret = via_detect_agp(dev);
-		if (!ret)
-			via_agp_engine_init(dev_private);
-		else
-			DRM_ERROR("Failed to allocate AGP.\n");
-	}
-#endif
 	if (pci_is_pcie(dev->pdev)) {
 		/* Allocate GART. */
 		ret = via_ttm_allocate_kernel_buffer(
@@ -280,7 +265,7 @@ static const struct file_operations via_driver_fops = {
 };
 
 static struct drm_driver via_driver = {
-	.driver_features = DRIVER_USE_AGP | DRIVER_HAVE_IRQ |
+	.driver_features = DRIVER_HAVE_IRQ |
 				DRIVER_IRQ_SHARED | DRIVER_GEM |
 				DRIVER_MODESET,
 	.load = via_driver_load,
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 84707a9e1069..f872386138ff 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -260,10 +260,6 @@ extern int via_max_ioctl;
 
 extern int via_hdmi_audio;
 
-#if IS_ENABLED(CONFIG_AGP)
-int via_detect_agp(struct drm_device *dev);
-void via_agp_engine_init(struct openchrome_drm_private *dev_private);
-#endif /* IS_ENABLED(CONFIG_AGP) */
 int openchrome_mmio_init(struct openchrome_drm_private *dev_private);
 void openchrome_mmio_fini(struct openchrome_drm_private *dev_private);
 void openchrome_graphics_unlock(
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 5c1f25317078..6bcd434a464f 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -31,88 +31,6 @@
 #include "openchrome_drv.h"
 
 
-#if IS_ENABLED(CONFIG_AGP)
-
-#define VIA_AGP_MODE_MASK	0x17
-#define VIA_AGPV3_MODE		0x08
-#define VIA_AGPV3_8X_MODE	0x02
-#define VIA_AGPV3_4X_MODE	0x01
-#define VIA_AGP_4X_MODE		0x04
-#define VIA_AGP_2X_MODE		0x02
-#define VIA_AGP_1X_MODE		0x01
-#define VIA_AGP_FW_MODE		0x10
-
-int via_detect_agp(struct drm_device *dev)
-{
-	struct openchrome_drm_private *dev_private = dev->dev_private;
-	struct drm_agp_info agp_info;
-	struct drm_agp_mode mode;
-	int ret = 0;
-
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	ret = drm_agp_acquire(dev);
-	if (ret) {
-		DRM_ERROR("Failed acquiring AGP device.\n");
-		return ret;
-	}
-
-	ret = drm_agp_info(dev, &agp_info);
-	if (ret) {
-		DRM_ERROR("Failed detecting AGP aperture size.\n");
-		goto out_err0;
-	}
-
-	mode.mode = agp_info.mode & ~VIA_AGP_MODE_MASK;
-	if (mode.mode & VIA_AGPV3_MODE)
-		mode.mode |= VIA_AGPV3_8X_MODE;
-	else
-		mode.mode |= VIA_AGP_4X_MODE;
-
-	mode.mode |= VIA_AGP_FW_MODE;
-	ret = drm_agp_enable(dev, mode);
-	if (ret) {
-		DRM_ERROR("Failed to enable the AGP bus.\n");
-		goto out_err0;
-	}
-
-	ret = ttm_bo_init_mm(&dev_private->ttm.bdev, TTM_PL_TT,
-				agp_info.aperture_size >> PAGE_SHIFT);
-	if (!ret) {
-		DRM_INFO("Detected %lu MB of AGP Aperture at "
-			"physical address 0x%08lx.\n",
-			agp_info.aperture_size >> 20,
-			agp_info.aperture_base);
-	} else {
-out_err0:
-		drm_agp_release(dev);
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-	return ret;
-}
-
-void via_agp_engine_init(struct openchrome_drm_private *dev_private)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	VIA_WRITE(VIA_REG_TRANSET, 0x00100000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x00000000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x00333004);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x60000000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x61000000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x62000000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x63000000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x64000000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x7D000000);
-
-	VIA_WRITE(VIA_REG_TRANSET, 0xfe020000);
-	VIA_WRITE(VIA_REG_TRANSPACE, 0x00000000);
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-#endif
-
 int openchrome_mmio_init(
 			struct openchrome_drm_private *dev_private)
 {
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioc32.c b/drivers/gpu/drm/openchrome/openchrome_ioc32.c
index 3ec4cafcabcc..5a54f3a51460 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioc32.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioc32.c
@@ -179,7 +179,6 @@ KMS_INVALID_IOCTL(via_decoder_futex)
 const struct drm_ioctl_desc via_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(VIA_ALLOCMEM, via_mem_alloc, DRM_AUTH),
 	DRM_IOCTL_DEF_DRV(VIA_FREEMEM, via_mem_free, DRM_AUTH),
-	DRM_IOCTL_DEF_DRV(VIA_AGP_INIT, via_agp_init, DRM_AUTH | DRM_MASTER),
 	DRM_IOCTL_DEF_DRV(VIA_FB_INIT, via_fb_init, DRM_AUTH | DRM_MASTER),
 	DRM_IOCTL_DEF_DRV(VIA_MAP_INIT, via_map_init, DRM_AUTH | DRM_MASTER),
 	DRM_IOCTL_DEF_DRV(VIA_DEC_FUTEX, via_decoder_futex, DRM_AUTH),
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index b2426d8bf7e3..44e4cde9a42b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -51,14 +51,6 @@ static int via_invalidate_caches(struct ttm_bo_device *bdev,
 static int via_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
 				struct ttm_mem_type_manager *man)
 {
-#if IS_ENABLED(CONFIG_AGP)
-	struct openchrome_drm_private *dev_private =
-					container_of(bdev,
-					struct openchrome_drm_private,
-					ttm.bdev);
-	struct drm_device *dev = dev_private->dev;
-#endif
-
 	switch (type) {
 	case TTM_PL_SYSTEM:
 		/* System memory */
@@ -70,23 +62,11 @@ static int via_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
 	case TTM_PL_TT:
 		man->func = &ttm_bo_manager_func;
 
-		/* By default we handle PCI/PCIe DMA. If AGP is avaliable
-		 * then we use that instead */
+		/* By default we handle PCI/PCIe DMA. */
 		man->flags = TTM_MEMTYPE_FLAG_MAPPABLE |
 				TTM_MEMTYPE_FLAG_CMA;
 		man->available_caching = TTM_PL_MASK_CACHING;
 		man->default_caching = TTM_PL_FLAG_CACHED;
-
-#if IS_ENABLED(CONFIG_AGP)
-		if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP) &&
-			dev->agp != NULL) {
-			man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
-			man->available_caching = TTM_PL_FLAG_UNCACHED |
-						TTM_PL_FLAG_WC;
-			man->default_caching = TTM_PL_FLAG_WC;
-		} else
-			DRM_ERROR("AGP is possible but not enabled\n");
-#endif
 		break;
 
 	case TTM_PL_VRAM:
@@ -163,12 +143,6 @@ static int via_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
 		return 0;
 
 	case TTM_PL_TT:
-#if IS_ENABLED(CONFIG_AGP)
-		if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) {
-			mem->bus.is_iomem = !dev->agp->cant_use_aperture;
-			mem->bus.base = dev->agp->base;
-		}
-#endif
 		break;
 
 	case TTM_PL_PRIV:


More information about the openchrome-devel mailing list