diff mbox

[11/12] drm/i915: Rearrange i915_gem_context

Message ID 1463922152-2709-11-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson May 22, 2016, 1:02 p.m. UTC
Pack the integers and related types together inside the struct.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

Comments

Tvrtko Ursulin May 23, 2016, 10:27 a.m. UTC | #1
On 22/05/16 14:02, Chris Wilson wrote:
> Pack the integers and related types together inside the struct.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_drv.h | 16 +++++++++-------
>   1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 259a0ee7a601..3b5cf15d85ab 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -829,7 +829,6 @@ struct i915_ctx_hang_stats {
>   /* This must match up with the value previously used for execbuf2.rsvd1. */
>   #define DEFAULT_CONTEXT_HANDLE 0
>
> -#define CONTEXT_NO_ZEROMAP (1<<0)
>   /**
>    * struct i915_gem_context - as the name implies, represents a context.
>    * @ref: reference count.
> @@ -851,28 +850,31 @@ struct i915_ctx_hang_stats {
>    */
>   struct i915_gem_context {
>   	struct kref ref;
> -	int user_handle;
> -	uint8_t remap_slice;
>   	struct drm_i915_private *i915;
> -	int flags;
>   	struct drm_i915_file_private *file_priv;
> -	struct i915_ctx_hang_stats hang_stats;
>   	struct i915_hw_ppgtt *ppgtt;
>
> +	struct i915_ctx_hang_stats hang_stats;
> +
>   	/* Unique identifier for this context, used by the hw for tracking */
>   	unsigned hw_id;
> +	uint32_t user_handle;
> +	unsigned long flags;
> +#define CONTEXT_NO_ZEROMAP		(1<<0)
>
>   	struct intel_context {
>   		struct drm_i915_gem_object *state;
>   		struct intel_ringbuffer *ringbuf;
> -		int pin_count;
>   		struct i915_vma *lrc_vma;
> -		u64 lrc_desc;
>   		uint32_t *lrc_reg_state;
> +		u64 lrc_desc;
> +		int pin_count;
>   		bool initialised;
>   	} engine[I915_NUM_ENGINES];
>
>   	struct list_head link;
> +
> +	uint8_t remap_slice;
>   };
>
>   enum fb_op_origin {
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 259a0ee7a601..3b5cf15d85ab 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -829,7 +829,6 @@  struct i915_ctx_hang_stats {
 /* This must match up with the value previously used for execbuf2.rsvd1. */
 #define DEFAULT_CONTEXT_HANDLE 0
 
-#define CONTEXT_NO_ZEROMAP (1<<0)
 /**
  * struct i915_gem_context - as the name implies, represents a context.
  * @ref: reference count.
@@ -851,28 +850,31 @@  struct i915_ctx_hang_stats {
  */
 struct i915_gem_context {
 	struct kref ref;
-	int user_handle;
-	uint8_t remap_slice;
 	struct drm_i915_private *i915;
-	int flags;
 	struct drm_i915_file_private *file_priv;
-	struct i915_ctx_hang_stats hang_stats;
 	struct i915_hw_ppgtt *ppgtt;
 
+	struct i915_ctx_hang_stats hang_stats;
+
 	/* Unique identifier for this context, used by the hw for tracking */
 	unsigned hw_id;
+	uint32_t user_handle;
+	unsigned long flags;
+#define CONTEXT_NO_ZEROMAP		(1<<0)
 
 	struct intel_context {
 		struct drm_i915_gem_object *state;
 		struct intel_ringbuffer *ringbuf;
-		int pin_count;
 		struct i915_vma *lrc_vma;
-		u64 lrc_desc;
 		uint32_t *lrc_reg_state;
+		u64 lrc_desc;
+		int pin_count;
 		bool initialised;
 	} engine[I915_NUM_ENGINES];
 
 	struct list_head link;
+
+	uint8_t remap_slice;
 };
 
 enum fb_op_origin {