mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
drm/rockchip: logo: Warn when logo memory alignment is not expected
Signed-off-by: Sandy Huang <hjc@rock-chips.com> Change-Id: I7b2068e4d322f78a691746eaf529e0eb73457894
This commit is contained in:
@@ -205,7 +205,7 @@ void rockchip_free_loader_memory(struct drm_device *drm)
|
||||
}
|
||||
|
||||
memblock_free(logo->start, logo->size);
|
||||
rockchip_drm_free_reserved_area(logo->dma_addr, logo->dma_addr + logo->size,
|
||||
rockchip_drm_free_reserved_area(logo->start, logo->start + logo->size,
|
||||
-1, "drm_logo");
|
||||
kfree(logo);
|
||||
private->logo = NULL;
|
||||
@@ -240,6 +240,11 @@ static int init_loader_memory(struct drm_device *drm_dev)
|
||||
size = resource_size(&res);
|
||||
if (!size)
|
||||
return -ENOMEM;
|
||||
if (!IS_ALIGNED(res.start, PAGE_SIZE) || !IS_ALIGNED(size, PAGE_SIZE))
|
||||
DRM_ERROR("Reserved logo memory should be aligned as:0x%lx, cureent is:start[%pad] size[%pad]\n",
|
||||
PAGE_SIZE, &res.start, &size);
|
||||
if (pg_size != PAGE_SIZE)
|
||||
DRM_WARN("iommu page size[0x%x] isn't equal to OS page size[0x%lx]\n", pg_size, PAGE_SIZE);
|
||||
|
||||
logo = kmalloc(sizeof(*logo), GFP_KERNEL);
|
||||
if (!logo)
|
||||
@@ -260,6 +265,7 @@ static int init_loader_memory(struct drm_device *drm_dev)
|
||||
}
|
||||
|
||||
logo->dma_addr = start;
|
||||
logo->start = res.start;
|
||||
logo->size = size;
|
||||
logo->count = 1;
|
||||
private->logo = logo;
|
||||
@@ -279,6 +285,9 @@ static int init_loader_memory(struct drm_device *drm_dev)
|
||||
size = resource_size(&res);
|
||||
if (!size)
|
||||
return 0;
|
||||
if (!IS_ALIGNED(res.start, PAGE_SIZE) || !IS_ALIGNED(size, PAGE_SIZE))
|
||||
DRM_ERROR("Reserved drm cubic memory should be aligned as:0x%lx, cureent is:start[%pad] size[%pad]\n",
|
||||
PAGE_SIZE, &res.start, &size);
|
||||
|
||||
private->cubic_lut_kvaddr = phys_to_virt(start);
|
||||
if (private->domain) {
|
||||
|
||||
Reference in New Issue
Block a user