Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/qxl: User page size macro for qxl release bo

Some architectures have different default page size, this patch
replaces hardcoded 4096 with PAGE_SIZE macro, since cmd bo size
is page aligned.

Signed-off-by: bibo mao <maobibo@loongson.cn>
Link: http://patchwork.freedesktop.org/patch/msgid/20210914062352.6102-1-maobibo@loongson.cn
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

authored by

bibo mao and committed by
Gerd Hoffmann
0b738333 5ad2d11f

+2 -2
+2 -2
drivers/gpu/drm/qxl/qxl_release.c
··· 36 36 /* manage releaseables */ 37 37 /* stack them 16 high for now -drawable object is 191 */ 38 38 #define RELEASE_SIZE 256 39 - #define RELEASES_PER_BO (4096 / RELEASE_SIZE) 39 + #define RELEASES_PER_BO (PAGE_SIZE / RELEASE_SIZE) 40 40 /* put an alloc/dealloc surface cmd into one bo and round up to 128 */ 41 41 #define SURFACE_RELEASE_SIZE 128 42 - #define SURFACE_RELEASES_PER_BO (4096 / SURFACE_RELEASE_SIZE) 42 + #define SURFACE_RELEASES_PER_BO (PAGE_SIZE / SURFACE_RELEASE_SIZE) 43 43 44 44 static const int release_size_per_bo[] = { RELEASE_SIZE, SURFACE_RELEASE_SIZE, RELEASE_SIZE }; 45 45 static const int releases_per_bo[] = { RELEASES_PER_BO, SURFACE_RELEASES_PER_BO, RELEASES_PER_BO };