summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panthor
diff options
context:
space:
mode:
authorSteven Price <steven.price@arm.com>2024-03-18 14:51:19 +0000
committerBoris Brezillon <boris.brezillon@collabora.com>2024-03-25 09:18:04 +0100
commit0b45921c2a8831834a5f8a52ddd0b25b5b1c6faf (patch)
tree8afcade1bc8ea052ca6149b86f808f34698252c2 /drivers/gpu/drm/panthor
parent0cd8363ed802922e39446d783f767b3e09335ddc (diff)
downloadlwn-0b45921c2a8831834a5f8a52ddd0b25b5b1c6faf.tar.gz
lwn-0b45921c2a8831834a5f8a52ddd0b25b5b1c6faf.zip
drm/panthor: Don't use virt_to_pfn()
virt_to_pfn() isn't available on x86 (except to xen) so breaks COMPILE_TEST builds. Avoid its use completely by instead storing the struct page pointer allocated in panthor_device_init() and using page_to_pfn() instead. Signed-off-by: Steven Price <steven.price@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240318145119.368582-1-steven.price@arm.com
Diffstat (limited to 'drivers/gpu/drm/panthor')
-rw-r--r--drivers/gpu/drm/panthor/panthor_device.c10
-rw-r--r--drivers/gpu/drm/panthor/panthor_device.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
index ba7aedbb4931..8b00f342d1b1 100644
--- a/drivers/gpu/drm/panthor/panthor_device.c
+++ b/drivers/gpu/drm/panthor/panthor_device.c
@@ -151,11 +151,12 @@ static bool panthor_device_is_initialized(struct panthor_device *ptdev)
static void panthor_device_free_page(struct drm_device *ddev, void *data)
{
- free_page((unsigned long)data);
+ __free_page(data);
}
int panthor_device_init(struct panthor_device *ptdev)
{
+ u32 *dummy_page_virt;
struct resource *res;
struct page *p;
int ret;
@@ -176,7 +177,8 @@ int panthor_device_init(struct panthor_device *ptdev)
if (!p)
return -ENOMEM;
- ptdev->pm.dummy_latest_flush = page_address(p);
+ ptdev->pm.dummy_latest_flush = p;
+ dummy_page_virt = page_address(p);
ret = drmm_add_action_or_reset(&ptdev->base, panthor_device_free_page,
ptdev->pm.dummy_latest_flush);
if (ret)
@@ -188,7 +190,7 @@ int panthor_device_init(struct panthor_device *ptdev)
* happens while the dummy page is mapped. Zero cannot be used because
* that means 'always flush'.
*/
- *ptdev->pm.dummy_latest_flush = 1;
+ *dummy_page_virt = 1;
INIT_WORK(&ptdev->reset.work, panthor_device_reset_work);
ptdev->reset.wq = alloc_ordered_workqueue("panthor-reset-wq", 0);
@@ -364,7 +366,7 @@ static vm_fault_t panthor_mmio_vm_fault(struct vm_fault *vmf)
if (active)
pfn = __phys_to_pfn(ptdev->phys_addr + CSF_GPU_LATEST_FLUSH_ID);
else
- pfn = virt_to_pfn(ptdev->pm.dummy_latest_flush);
+ pfn = page_to_pfn(ptdev->pm.dummy_latest_flush);
break;
default:
diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
index 51c9d61b6796..c84c27dcc92c 100644
--- a/drivers/gpu/drm/panthor/panthor_device.h
+++ b/drivers/gpu/drm/panthor/panthor_device.h
@@ -160,7 +160,7 @@ struct panthor_device {
* Used to replace the real LATEST_FLUSH page when the GPU
* is suspended.
*/
- u32 *dummy_latest_flush;
+ struct page *dummy_latest_flush;
} pm;
};