[openchrome-devel] drm-openchrome: Branch 'drm-next-5.9' - 3 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Tue Aug 11 01:13:38 UTC 2020
drivers/gpu/drm/openchrome/openchrome_crtc.c | 6 ++++--
drivers/gpu/drm/openchrome/openchrome_cursor.c | 6 +++---
drivers/gpu/drm/openchrome/openchrome_drv.c | 4 ++--
drivers/gpu/drm/openchrome/openchrome_fb.c | 6 +++---
drivers/gpu/drm/openchrome/openchrome_fbdev.c | 2 +-
drivers/gpu/drm/openchrome/openchrome_fp.c | 1 -
drivers/gpu/drm/openchrome/openchrome_ioc32.c | 7 ++++---
drivers/gpu/drm/openchrome/openchrome_ttm.c | 1 -
8 files changed, 17 insertions(+), 16 deletions(-)
New commits:
commit 21c746e8582aecfe24e1f7d70f486957aafb653d
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 10 17:59:08 2020 -0700
drm/openchrome: Don't use ttm bo->offset
Based on commit a0e4a29 (drm/radeon: don't use ttm bo->offset).
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 728bff2a363c..3610c37c8cca 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1999,7 +1999,8 @@ static int openchrome_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
via_iga1_set_color_depth(dev_private, fb->format->depth);
/* Set the framebuffer offset */
- addr = round_up(bo->ttm_bo.offset + pitch, 16) >> 1;
+ addr = round_up((bo->ttm_bo.mem.start << PAGE_SHIFT) +
+ pitch, 16) >> 1;
vga_wcrt(VGABASE, 0x0D, addr & 0xFF);
vga_wcrt(VGABASE, 0x0C, (addr >> 8) & 0xFF);
/* Yes order of setting these registers matters on some hardware */
@@ -2025,7 +2026,8 @@ static int openchrome_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
via_iga2_set_color_depth(dev_private, fb->format->depth);
/* Set the framebuffer offset */
- addr = round_up(bo->ttm_bo.offset + pitch, 16);
+ addr = round_up((bo->ttm_bo.mem.start << PAGE_SHIFT) +
+ pitch, 16);
/* Bits 9 to 3 of the frame buffer go into bits 7 to 1
* of the register. Bit 0 is for setting tile mode or
* linear mode. A value of zero sets it to linear mode */
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 791822682e6f..ac9c81191f68 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -170,15 +170,15 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
/* Program the HI offset. */
if (iga->index) {
VIA_WRITE(HI_FBOFFSET,
- ttm_bo->kmap.bo->offset);
+ ttm_bo->kmap.bo->mem.start << PAGE_SHIFT);
} else {
VIA_WRITE(PRIM_HI_FBOFFSET,
- ttm_bo->kmap.bo->offset);
+ ttm_bo->kmap.bo->mem.start << PAGE_SHIFT);
}
break;
default:
VIA_WRITE(HI_FBOFFSET,
- ttm_bo->kmap.bo->offset);
+ ttm_bo->kmap.bo->mem.start << PAGE_SHIFT);
break;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioc32.c b/drivers/gpu/drm/openchrome/openchrome_ioc32.c
index 1e47ed60e12c..b10c72d37c21 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioc32.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioc32.c
@@ -98,7 +98,7 @@ via_gem_alloc(struct drm_device *dev, void *data,
args->size = bo->ttm_bo.mem.size;
args->domains = bo->ttm_bo.mem.placement &
TTM_PL_MASK_MEM;
- args->offset = bo->ttm_bo.offset;
+ args->offset = bo->ttm_bo.mem.start << PAGE_SHIFT;
args->map_handle = drm_vma_node_offset_addr(
&bo->ttm_bo.base.vma_node);
args->handle = handle;
@@ -145,7 +145,8 @@ via_gem_state(struct drm_device *dev, void *data, struct drm_file *file_priv)
args->size = bo->ttm_bo.mem.size;
args->domains = bo->ttm_bo.mem.placement &
TTM_PL_MASK_MEM;
- args->offset = bo->ttm_bo.offset;
+ args->offset = bo->ttm_bo.mem.start <<
+ PAGE_SHIFT;
args->map_handle = drm_vma_node_offset_addr(
&bo->ttm_bo.base.vma_node);
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index cf258d21774d..17124db4bc72 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -60,7 +60,6 @@ static int openchrome_bo_init_mem_type(struct ttm_bo_device *bdev,
case TTM_PL_VRAM:
man->flags = TTM_MEMTYPE_FLAG_FIXED |
TTM_MEMTYPE_FLAG_MAPPABLE;
- man->gpu_offset = 0;
man->available_caching = TTM_PL_FLAG_UNCACHED |
TTM_PL_FLAG_WC;
man->default_caching = TTM_PL_FLAG_WC;
commit b08abd32813d0c601026739cb50be5aa7991a48b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 10 17:23:31 2020 -0700
drm/openchrome: Remove _unlocked suffix in drm_gem_object_put_unlocked
Based on commit f11fb66 (drm/radeon: remove _unlocked suffix in
drm_gem_object_put_unlocked).
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 ad566eaa910f..cbab0f32793e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -93,7 +93,7 @@ static int openchrome_drm_driver_dumb_create(
}
ret = drm_gem_handle_create(file_priv, &bo->gem, &handle);
- drm_gem_object_put_unlocked(&bo->gem);
+ drm_gem_object_put(&bo->gem);
if (ret) {
goto exit;
}
@@ -127,7 +127,7 @@ static int openchrome_drm_driver_dumb_map_offset(
bo = container_of(gem, struct openchrome_bo, gem);
*offset = drm_vma_node_offset_addr(&bo->ttm_bo.base.vma_node);
- drm_gem_object_put_unlocked(gem);
+ drm_gem_object_put(gem);
exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
diff --git a/drivers/gpu/drm/openchrome/openchrome_fb.c b/drivers/gpu/drm/openchrome/openchrome_fb.c
index 46a29ac22bd5..5a8ef6d83837 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fb.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fb.c
@@ -54,7 +54,7 @@ via_user_framebuffer_destroy(struct drm_framebuffer *fb)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
if (via_fb->gem) {
- drm_gem_object_put_unlocked(via_fb->gem);
+ drm_gem_object_put(via_fb->gem);
via_fb->gem = NULL;
}
@@ -103,7 +103,7 @@ via_user_framebuffer_create(struct drm_device *dev,
drm_helper_mode_fill_fb_struct(dev, &via_fb->fb, mode_cmd);
ret = drm_framebuffer_init(dev, &via_fb->fb, &via_fb_funcs);
if (ret) {
- drm_gem_object_put_unlocked(via_fb->gem);
+ drm_gem_object_put(via_fb->gem);
via_fb->gem = NULL;
kfree(via_fb);
return ERR_PTR(ret);
@@ -252,7 +252,7 @@ out_err:
}
if (via_fb->gem) {
- drm_gem_object_put_unlocked(via_fb->gem);
+ drm_gem_object_put(via_fb->gem);
via_fb->gem = NULL;
}
exit:
diff --git a/drivers/gpu/drm/openchrome/openchrome_fbdev.c b/drivers/gpu/drm/openchrome/openchrome_fbdev.c
index 87b88242c163..464eb8407e5c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fbdev.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fbdev.c
@@ -97,7 +97,7 @@ void via_fbdev_fini(struct drm_device *dev)
}
if (via_fb->gem) {
- drm_gem_object_put_unlocked(via_fb->gem);
+ drm_gem_object_put(via_fb->gem);
via_fb->gem = NULL;
}
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioc32.c b/drivers/gpu/drm/openchrome/openchrome_ioc32.c
index ec0a890a7e13..1e47ed60e12c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioc32.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioc32.c
@@ -88,7 +88,7 @@ via_gem_alloc(struct drm_device *dev, void *data,
&handle);
/* Drop reference from allocate; handle holds it now. */
- drm_gem_object_put_unlocked(&bo->gem);
+ drm_gem_object_put(&bo->gem);
if (ret) {
openchrome_bo_destroy(bo, false);
commit 8c72cafc7d823868d54ca96a246903b5493231fd
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 10 17:10:45 2020 -0700
drm/openchrome: Nuke mode->vrefresh
Based on commit 0425662 (drm: Nuke mode->vrefresh).
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index 40fb49b6ec04..1810b4a539d3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -953,7 +953,6 @@ via_fp_get_modes(struct drm_connector *connector)
native_mode->vsync_end = 911;
native_mode->vtotal = 912;
native_mode->vscan = 0;
- native_mode->vrefresh = 50;
native_mode->type = DRM_MODE_TYPE_PREFERRED |
DRM_MODE_TYPE_DRIVER;
More information about the openchrome-devel
mailing list