[PATCH v1 1/2] drm/i915/display: use PAGE_SIZE macro for FBC cfb alloc

Vinod Govindapillai vinod.govindapillai at intel.com
Wed Jan 10 11:00:08 UTC 2024


FBC compressed frame buffer size need to be PAGE_SIZE aligned
and the corresponding the drm_gem functions check the object
size alignment using PAGE_SIZE macro. Use the PAGE_SIZE macro
in the cfb alloc as well instead of the magic number.

Signed-off-by: Vinod Govindapillai <vinod.govindapillai at intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index f17a1afb4929..9b9c8715d664 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -764,13 +764,15 @@ static int find_compression_limit(struct intel_fbc *fbc,
 
 	/* Try to over-allocate to reduce reallocations and fragmentation. */
 	ret = i915_gem_stolen_insert_node_in_range(i915, &fbc->compressed_fb,
-						   size <<= 1, 4096, 0, end);
+						   size <<= 1, PAGE_SIZE, 0,
+						   end);
 	if (ret == 0)
 		return limit;
 
 	for (; limit <= intel_fbc_max_limit(i915); limit <<= 1) {
 		ret = i915_gem_stolen_insert_node_in_range(i915, &fbc->compressed_fb,
-							   size >>= 1, 4096, 0, end);
+							   size >>= 1, PAGE_SIZE, 0,
+							   end);
 		if (ret == 0)
 			return limit;
 	}
-- 
2.34.1



More information about the Intel-gfx mailing list