[openchrome-devel] drm-openchrome: Branch 'drm-next-5.11' - 7 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Mon Nov 23 22:08:27 UTC 2020
drivers/gpu/drm/openchrome/openchrome_crtc.c | 17 -------------
drivers/gpu/drm/openchrome/openchrome_cursor.c | 31 +++++++------------------
drivers/gpu/drm/openchrome/openchrome_drv.h | 12 ++++-----
drivers/gpu/drm/openchrome/openchrome_fb.c | 12 +--------
drivers/gpu/drm/openchrome/openchrome_init.c | 10 --------
drivers/gpu/drm/openchrome/openchrome_object.c | 27 +++++++++++++++++++--
6 files changed, 41 insertions(+), 68 deletions(-)
New commits:
commit 5879edf3c48664ae4e1efc14d6d84b9fcabe56c9
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Nov 23 14:07:10 2020 -0800
drm/openchrome: Version bumped to 3.4.3
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 b0744828cee3..4216d51bfeed 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 4
-#define DRIVER_PATCHLEVEL 2
+#define DRIVER_PATCHLEVEL 3
#define DRIVER_NAME "openchrome"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20201109"
+#define DRIVER_DATE "20201123"
#define DRIVER_AUTHOR "OpenChrome Project"
commit 7c8c4424757712fe799c3394397cd5613becf963
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Nov 23 14:06:42 2020 -0800
drm/openchrome: Discontinue drm_mode_crtc_load_lut()
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 fcce3fbbe33a..dfdecc7af125 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1563,21 +1563,6 @@ via_set_iga2_downscale_source_timing(struct drm_crtc *crtc,
drm_mode_destroy(crtc->dev, src_timing);
}
-static void
-drm_mode_crtc_load_lut(struct drm_crtc *crtc)
-{
- int size = crtc->gamma_size * sizeof(uint16_t);
- void *r_base, *g_base, *b_base;
-
- if (size) {
- r_base = crtc->gamma_store;
- g_base = r_base + size;
- b_base = g_base + size;
- crtc->funcs->gamma_set(crtc, r_base, g_base, b_base,
- crtc->gamma_size, NULL);
- }
-}
-
static void openchrome_crtc_dpms(struct drm_crtc *crtc, int mode)
{
struct openchrome_drm_private *dev_private =
@@ -1605,7 +1590,6 @@ static void openchrome_crtc_dpms(struct drm_crtc *crtc, int mode)
/* disable simultaneous */
svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
- drm_mode_crtc_load_lut(crtc);
break;
}
@@ -1627,7 +1611,6 @@ static void openchrome_crtc_dpms(struct drm_crtc *crtc, int mode)
/* disable simultaneous */
svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
- drm_mode_crtc_load_lut(crtc);
break;
}
}
commit d31ebfb1ba9b1cd901d067cda0492f0cb266b76f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Nov 23 14:06:16 2020 -0800
drm/openchrome: Pass drm_device type pointer to openchrome_hide_cursor()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index c6a4d31863a9..8bef134ad236 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -46,13 +46,12 @@
#include "openchrome_drv.h"
-static void openchrome_hide_cursor(struct drm_crtc *crtc)
+static void openchrome_hide_cursor(struct drm_device *dev,
+ struct drm_crtc *crtc)
{
- struct drm_device *dev = crtc->dev;
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
- struct openchrome_drm_private *dev_private =
- crtc->dev->dev_private;
+ struct openchrome_drm_private *dev_private = dev->dev_private;
uint32_t temp;
switch (dev->pdev->device) {
@@ -311,7 +310,7 @@ static int openchrome_cursor_disable_plane(struct drm_plane *plane,
struct drm_modeset_acquire_ctx *ctx)
{
if (plane->crtc) {
- openchrome_hide_cursor(plane->crtc);
+ openchrome_hide_cursor(plane->dev, plane->crtc);
}
if (plane->fb) {
commit 3c82346f477d481e29f0b05d54fa0027de6d50a8
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Nov 23 14:05:54 2020 -0800
drm/openchrome: Use resource_size_t for MMIO base address and size
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 d8fa91e5dcfa..b0744828cee3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -229,8 +229,8 @@ struct openchrome_drm_private {
resource_size_t vram_size;
int vram_mtrr;
- unsigned long long mmio_base;
- unsigned int mmio_size;
+ resource_size_t mmio_base;
+ resource_size_t mmio_size;
void __iomem *mmio;
struct via_state pm_cache;
diff --git a/drivers/gpu/drm/openchrome/openchrome_init.c b/drivers/gpu/drm/openchrome/openchrome_init.c
index 0e6d9dfe7542..2822e06bcd69 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1090,9 +1090,6 @@ int openchrome_mmio_init(
goto exit;
}
- DRM_INFO("VIA Technologies Chrome IGP MMIO Physical Address: "
- "0x%08llx\n",
- dev_private->mmio_base);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
commit 718c23c41dec3ccd69450ef2287c9052a256c5e6
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Nov 23 14:05:30 2020 -0800
drm/openchrome: Stop displaying VRAM physical address and size
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 9ac56e094150..0e6d9dfe7542 100644
--- a/drivers/gpu/drm/openchrome/openchrome_init.c
+++ b/drivers/gpu/drm/openchrome/openchrome_init.c
@@ -1049,13 +1049,6 @@ int openchrome_vram_init(struct openchrome_drm_private *dev_private)
dev_private->vram_start,
dev_private->vram_size);
- DRM_INFO("VIA Technologies Chrome IGP VRAM "
- "Physical Address: 0x%08llx\n",
- dev_private->vram_start);
- DRM_INFO("VIA Technologies Chrome IGP VRAM "
- "Size: %llu MB\n",
- (unsigned long long) dev_private->vram_size >> 20);
-
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
commit 472a3583fbb15b3261cfbea7b4419041aa1b0c61
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Nov 23 14:05:00 2020 -0800
drm/openchrome: Keep count of BO pin count
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 54740077f04a..d8fa91e5dcfa 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -196,6 +196,7 @@ struct openchrome_bo {
struct ttm_placement placement;
struct ttm_place placements[OPENCHROME_TTM_PL_NUM];
struct drm_gem_object gem;
+ int pin_count;
};
struct openchrome_framebuffer {
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c b/drivers/gpu/drm/openchrome/openchrome_object.c
index 24b421672a58..ec78df8a3c44 100644
--- a/drivers/gpu/drm/openchrome/openchrome_object.c
+++ b/drivers/gpu/drm/openchrome/openchrome_object.c
@@ -101,16 +101,27 @@ int openchrome_bo_pin(struct openchrome_bo *bo,
{
struct ttm_operation_ctx ctx = {false, false};
uint32_t i;
- int ret;
+ int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
+ if (bo->pin_count) {
+ bo->pin_count++;
+ goto exit;
+ }
+
openchrome_ttm_domain_to_placement(bo, ttm_domain);
for (i = 0; i < bo->placement.num_placement; i++) {
bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
}
ret = ttm_bo_validate(&bo->ttm_bo, &bo->placement, &ctx);
+ if (ret) {
+ goto exit;
+ }
+
+ bo->pin_count++;
+exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
@@ -120,16 +131,26 @@ int openchrome_bo_unpin(struct openchrome_bo *bo)
{
struct ttm_operation_ctx ctx = {false, false};
uint32_t i;
- int ret;
+ int ret = 0;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
+ if (!bo->pin_count) {
+ DRM_ERROR("Bad unpin.\n");
+ goto exit;
+ }
+
+ bo->pin_count--;
+ if (bo->pin_count) {
+ goto exit;
+ }
+
for (i = 0; i < bo->placement.num_placement; i++) {
bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
}
ret = ttm_bo_validate(&bo->ttm_bo, &bo->placement, &ctx);
-
+exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
}
commit ceaa5b2f9c9e75007ae9e32ecd69f48fee239b8f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Nov 23 14:04:34 2020 -0800
drm/openchrome: Use only 64 x 64 cursor dimensions
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 612ff28fa69c..c6a4d31863a9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -256,7 +256,6 @@ static int openchrome_cursor_update_plane(struct drm_plane *plane,
uint32_t src_w, uint32_t src_h,
struct drm_modeset_acquire_ctx *ctx)
{
- struct drm_device *dev = plane->dev;
struct openchrome_bo *ttm_bo;
struct drm_gem_object *gem;
int ret = 0;
@@ -279,22 +278,11 @@ static int openchrome_cursor_update_plane(struct drm_plane *plane,
goto exit;
}
- if ((dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266) ||
- (dev->pdev->device == PCI_DEVICE_ID_VIA_KM400)) {
- if ((fb->width != OPENCHROME_UNICHROME_CURSOR_SIZE) ||
- (fb->height != OPENCHROME_UNICHROME_CURSOR_SIZE)) {
- DRM_ERROR("Invalid cursor dimensions.\n");
- ret = -EINVAL;
- goto exit;
- }
-
- } else {
- if ((fb->width != OPENCHROME_UNICHROME_PRO_CURSOR_SIZE) ||
- (fb->height != OPENCHROME_UNICHROME_PRO_CURSOR_SIZE)) {
- DRM_ERROR("Invalid cursor dimensions.\n");
- ret = -EINVAL;
- goto exit;
- }
+ if ((fb->width != OPENCHROME_CURSOR_SIZE) ||
+ (fb->height != OPENCHROME_CURSOR_SIZE)) {
+ DRM_ERROR("Invalid cursor dimensions.\n");
+ ret = -EINVAL;
+ goto exit;
}
if (fb->width != fb->height) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 812da9f64c3a..54740077f04a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -72,8 +72,7 @@
#define OPENCHROME_MAX_CRTC 2
-#define OPENCHROME_UNICHROME_CURSOR_SIZE 32
-#define OPENCHROME_UNICHROME_PRO_CURSOR_SIZE 64
+#define OPENCHROME_CURSOR_SIZE 64
#define VIA_MM_ALIGN_SIZE 16
diff --git a/drivers/gpu/drm/openchrome/openchrome_fb.c b/drivers/gpu/drm/openchrome/openchrome_fb.c
index d0f6ffc2f409..17f2ed04a249 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fb.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fb.c
@@ -124,16 +124,8 @@ void openchrome_mode_config_init(
dev->mode_config.preferred_depth = 24;
- if ((dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266) ||
- (dev->pdev->device == PCI_DEVICE_ID_VIA_KM400)) {
- dev->mode_config.cursor_width =
- dev->mode_config.cursor_height =
- OPENCHROME_UNICHROME_CURSOR_SIZE;
- } else {
- dev->mode_config.cursor_width =
- dev->mode_config.cursor_height =
- OPENCHROME_UNICHROME_PRO_CURSOR_SIZE;
- }
+ dev->mode_config.cursor_width =
+ dev->mode_config.cursor_height = OPENCHROME_CURSOR_SIZE;
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
More information about the openchrome-devel
mailing list