diff mbox series

[v7,5/9] drm/i915/selftest_migrate: Consider the possible roundup of size

Message ID 20220328190736.19697-6-ramalingam.c@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/ttm: Evict and restore of compressed object | expand

Commit Message

Ramalingam C March 28, 2022, 7:07 p.m. UTC
Consider the possible round up happened at obj size alignment to
min_page_size during the obj allocation.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_migrate.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Hellström (Intel) March 29, 2022, 6:53 a.m. UTC | #1
On 3/28/22 21:07, Ramalingam C wrote:
> Consider the possible round up happened at obj size alignment to
> min_page_size during the obj allocation.
>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


> ---
>   drivers/gpu/drm/i915/gt/selftest_migrate.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c
> index c9c4f391c5cc..b5da8b8cd039 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c
> @@ -152,6 +152,9 @@ static int clear(struct intel_migrate *migrate,
>   	if (IS_ERR(obj))
>   		return 0;
>   
> +	/* Consider the rounded up memory too */
> +	sz = obj->base.size;
> +
>   	for_i915_gem_ww(&ww, err, true) {
>   		err = i915_gem_object_lock(obj, &ww);
>   		if (err)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c
index c9c4f391c5cc..b5da8b8cd039 100644
--- a/drivers/gpu/drm/i915/gt/selftest_migrate.c
+++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c
@@ -152,6 +152,9 @@  static int clear(struct intel_migrate *migrate,
 	if (IS_ERR(obj))
 		return 0;
 
+	/* Consider the rounded up memory too */
+	sz = obj->base.size;
+
 	for_i915_gem_ww(&ww, err, true) {
 		err = i915_gem_object_lock(obj, &ww);
 		if (err)