diff mbox

[v3,14/17] drm/i915: batch_obj vm offset must be u64

Message ID 1435764453-11954-15-git-send-email-michel.thierry@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michel Thierry July 1, 2015, 3:27 p.m. UTC
Otherwise it can overflow in 48-bit mode, and cause an incorrect
exec_start.

Before commit 5f19e2bff ("drm/i915: Merged the many do_execbuf()
parameters into a structure"), it was already an u64, so it could be
seen as a regression (or as an optimization that looked good at that time).

Cc: John Harrison <john.c.harrison@Intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

John Harrison July 1, 2015, 4:07 p.m. UTC | #1
On 01/07/2015 16:27, Michel Thierry wrote:
> Otherwise it can overflow in 48-bit mode, and cause an incorrect
> exec_start.
>
> Before commit 5f19e2bff ("drm/i915: Merged the many do_execbuf()
> parameters into a structure"), it was already an u64, so it could be
> seen as a regression (or as an optimization that looked good at that time).
Almost certainly a merge failure. The above patch moved the variable 
when it was a uint32_t but by the time it got merged, another patch had 
updated it to uint64_t. Unfortunately, the merge conflict either didn't 
conflict or didn't get resolved correctly. Either way, the downgrade was 
certainly not intentional.


> Cc: John Harrison <john.c.harrison@Intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_drv.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index d245c82..c720a18 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1664,7 +1664,7 @@ struct i915_execbuffer_params {
>   	struct drm_file                 *file;
>   	uint32_t                        dispatch_flags;
>   	uint32_t                        args_batch_start_offset;
> -	uint32_t                        batch_obj_vm_offset;
> +	uint64_t                        batch_obj_vm_offset;
>   	struct intel_engine_cs          *ring;
>   	struct drm_i915_gem_object      *batch_obj;
>   	struct intel_context            *ctx;
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d245c82..c720a18 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1664,7 +1664,7 @@  struct i915_execbuffer_params {
 	struct drm_file                 *file;
 	uint32_t                        dispatch_flags;
 	uint32_t                        args_batch_start_offset;
-	uint32_t                        batch_obj_vm_offset;
+	uint64_t                        batch_obj_vm_offset;
 	struct intel_engine_cs          *ring;
 	struct drm_i915_gem_object      *batch_obj;
 	struct intel_context            *ctx;