author: Changhuang Liang <changhuang.liang@starfivetech.com> 2023-03-14 16:05:33 +0800
committer: Changhuang Liang <changhuang.liang@starfivetech.com> 2023-03-14 16:05:33 +0800
commit: 2432653b226192e226ca87707073d6ffbedc25f8
parent: c395ddee784d5e421176a837845e9e17acc6f277
Commit Summary:
Diffstat:
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/verisilicon/vs_drv.c b/drivers/gpu/drm/verisilicon/vs_drv.c
index ab1f2c24c725..689a1e04dc15 100644
--- a/drivers/gpu/drm/verisilicon/vs_drv.c
+++ b/drivers/gpu/drm/verisilicon/vs_drv.c
@@ -252,6 +252,8 @@ static int vs_drm_bind(struct device *dev)
if (ret)
goto err_helper;
+ drm_fbdev_generic_setup(drm_dev, 32);
+
return 0;
err_helper:
diff --git a/drivers/gpu/drm/verisilicon/vs_gem.c b/drivers/gpu/drm/verisilicon/vs_gem.c
index 31f484b428b2..42d0355be9ff 100755
--- a/drivers/gpu/drm/verisilicon/vs_gem.c
+++ b/drivers/gpu/drm/verisilicon/vs_gem.c
@@ -121,7 +121,7 @@ static int vs_gem_alloc_buf(struct vs_gem_object *vs_obj)
&vs_obj->dma_addr, GFP_KERNEL,
vs_obj->dma_attrs);
- DRM_DEV_DEBUG(dev->dev,"Allocated coherent memory, vaddr: 0x%0llX, paddr: 0x%0llX, size: %d\n",
+ DRM_DEV_DEBUG(dev->dev,"Allocated coherent memory, vaddr: 0x%0llX, paddr: 0x%0llX, size: %d\n",
(u64)vs_obj->cookie,vs_obj->dma_addr,vs_obj->size);
if (!vs_obj->cookie) {
#ifdef CONFIG_VERISILICON_MMU
@@ -388,7 +388,12 @@ struct sg_table *vs_gem_prime_get_sg_table(struct drm_gem_object *obj)
static void *vs_gem_prime_vmap(struct drm_gem_object *obj)
{
- return NULL;
+ struct vs_gem_object *vs_obj = to_vs_gem_object(obj);
+
+ void *vaddr = vs_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING ?
+ page_address(vs_obj->cookie) : vs_obj->cookie;
+
+ return vaddr;
}
static void vs_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)