Commit 16490922 authored by Igor Torrente's avatar Igor Torrente Committed by Melissa Wen

drm: vkms: Alloc the compose frame using vzalloc

Currently, the memory to the composition frame is being allocated using
the kzmalloc. This comes with the limitation of maximum size of one
page size(which in the x86_64 is 4Kb and 4MB for default and hugepage
respectively).

Somes test of igt (e.g. kms_plane@pixel-format) uses more than 4MB when
testing some pixel formats like ARGB16161616 and the following error were
showing up when running kms_plane@plane-panning-bottom-right*:

[drm:vkms_composer_worker [vkms]] *ERROR* Cannot allocate memory for
output frame.

This problem is addessed by allocating the memory using kvzalloc that
circunvents this limitation.

V5: Improve the commit message and drop the debugging issues in VKMS
TO-DO(Melissa Wen).
Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarIgor Torrente <igormtorrente@gmail.com>
Signed-off-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220404204515.42144-2-igormtorrente@gmail.com
parent 24f6fe32
...@@ -102,12 +102,6 @@ Debugging: ...@@ -102,12 +102,6 @@ Debugging:
- kms_plane: some test cases are failing due to timeout on capturing CRC; - kms_plane: some test cases are failing due to timeout on capturing CRC;
- kms_flip: when running test cases in sequence, some successful individual
test cases are failing randomly; when individually, some successful test
cases display in the log the following error::
[drm:vkms_prepare_fb [vkms]] ERROR vmap failed: -4
Virtual hardware (vblank-less) mode: Virtual hardware (vblank-less) mode:
- VKMS already has support for vblanks simulated via hrtimers, which can be - VKMS already has support for vblanks simulated via hrtimers, which can be
......
...@@ -180,7 +180,7 @@ static int compose_active_planes(void **vaddr_out, ...@@ -180,7 +180,7 @@ static int compose_active_planes(void **vaddr_out,
int i; int i;
if (!*vaddr_out) { if (!*vaddr_out) {
*vaddr_out = kzalloc(gem_obj->size, GFP_KERNEL); *vaddr_out = kvzalloc(gem_obj->size, GFP_KERNEL);
if (!*vaddr_out) { if (!*vaddr_out) {
DRM_ERROR("Cannot allocate memory for output frame."); DRM_ERROR("Cannot allocate memory for output frame.");
return -ENOMEM; return -ENOMEM;
...@@ -263,7 +263,7 @@ void vkms_composer_worker(struct work_struct *work) ...@@ -263,7 +263,7 @@ void vkms_composer_worker(struct work_struct *work)
crtc_state); crtc_state);
if (ret) { if (ret) {
if (ret == -EINVAL && !wb_pending) if (ret == -EINVAL && !wb_pending)
kfree(vaddr_out); kvfree(vaddr_out);
return; return;
} }
...@@ -275,7 +275,7 @@ void vkms_composer_worker(struct work_struct *work) ...@@ -275,7 +275,7 @@ void vkms_composer_worker(struct work_struct *work)
crtc_state->wb_pending = false; crtc_state->wb_pending = false;
spin_unlock_irq(&out->composer_lock); spin_unlock_irq(&out->composer_lock);
} else { } else {
kfree(vaddr_out); kvfree(vaddr_out);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment