Skip to contentSkip to conversation

drm/i915: i915_gem_alloc_context_obj can be static

PATCH Superseded Tvrtko Ursulin 4 participants 5 messages Nov 23, 2016

Subsystems (2)
lore
Share & tools
lore

Tvrtko Ursulin

author maintainer
#0 lore raw

PATCH 1/1 drm/i915: i915_gem_alloc_context_obj can be static

From: Tvrtko Ursulin <[email protected]>

It has only one call site from the same file.

---
 drivers/gpu/drm/i915/i915_drv.h         | 2 --
 drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -2
index 970e50bf9884..c44f2410f10f 100644
@@ -3342,8 +3342,6 @@ struct i915_vma *
 i915_gem_context_pin_legacy(struct i915_gem_context *ctx,
 			    unsigned int flags);
 void i915_gem_context_free(struct kref *ctx_ref);
-struct drm_i915_gem_object *
-i915_gem_alloc_context_obj(struct drm_device *dev, size_t size);
 struct i915_gem_context *
 i915_gem_context_create_gvt(struct drm_device *dev);
 
drivers/gpu/drm/i915/i915_gem_context.c +1 -1
index f82936a2fcce..7c1364801cfe 100644
@@ -166,7 +166,7 @@ void i915_gem_context_free(struct kref *ctx_ref)
 	kfree(ctx);
 }
 
-struct drm_i915_gem_object *
+static struct drm_i915_gem_object *
 i915_gem_alloc_context_obj(struct drm_device *dev, size_t size)
 {
 	struct drm_i915_gem_object *obj;
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

It has only one call site from the same file.

---
 drivers/gpu/drm/i915/i915_drv.h         | 2 --
 drivers/gpu/drm/i915/i915_gem_context.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -2
index 970e50bf9884..c44f2410f10f 100644
@@ -3342,8 +3342,6 @@ struct i915_vma *
 i915_gem_context_pin_legacy(struct i915_gem_context *ctx,
 			    unsigned int flags);
 void i915_gem_context_free(struct kref *ctx_ref);
-struct drm_i915_gem_object *
-i915_gem_alloc_context_obj(struct drm_device *dev, size_t size);
 struct i915_gem_context *
 i915_gem_context_create_gvt(struct drm_device *dev);
 
drivers/gpu/drm/i915/i915_gem_context.c +0 -0
index f82936a2fcce..7c1364801cfe 100644

drivers/gpu/drm/i915/i915_gem_context.c void i915_gem_context_free(struct kref *ctx_ref) · line 170

Quoted 6 lines
drivers/gpu/drm/i915/i915_gem_context.c +1 -1
@@ -166,7 +166,7 @@ void i915_gem_context_free(struct kref *ctx_ref)
 	kfree(ctx);
 }
 
-struct drm_i915_gem_object *
+static struct drm_i915_gem_object *
 i915_gem_alloc_context_obj(struct drm_device *dev, size_t size)

Could we shrink it a bit so the caller fits onto one line? alloc_context_obj?

And size_t is not the right type (u64 is overkill but matches the interface and gcc should be fine).

Other than that, have a preemptive

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#2 lore raw

PATCH v2 1/1 drm/i915: i915_gem_alloc_context_obj can be static

From: Tvrtko Ursulin <[email protected]>

It has only one call site from the same file.

v2: Also rename it to alloc_context_obj. (Chris Wilson)

---
 drivers/gpu/drm/i915/i915_drv.h         | 2 --
 drivers/gpu/drm/i915/i915_gem_context.c | 7 +++----
 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -2
index 970e50bf9884..c44f2410f10f 100644
@@ -3342,8 +3342,6 @@ struct i915_vma *
 i915_gem_context_pin_legacy(struct i915_gem_context *ctx,
 			    unsigned int flags);
 void i915_gem_context_free(struct kref *ctx_ref);
-struct drm_i915_gem_object *
-i915_gem_alloc_context_obj(struct drm_device *dev, size_t size);
 struct i915_gem_context *
 i915_gem_context_create_gvt(struct drm_device *dev);
 
drivers/gpu/drm/i915/i915_gem_context.c +3 -4
index f82936a2fcce..a6add0c14045 100644
@@ -166,8 +166,8 @@ void i915_gem_context_free(struct kref *ctx_ref)
 	kfree(ctx);
 }
 
-struct drm_i915_gem_object *
-i915_gem_alloc_context_obj(struct drm_device *dev, size_t size)
+static struct drm_i915_gem_object *
+alloc_context_obj(struct drm_device *dev, u64 size)
 {
 	struct drm_i915_gem_object *obj;
 	int ret;
@@ -286,8 +286,7 @@ __create_hw_context(struct drm_device *dev,
 		struct drm_i915_gem_object *obj;
 		struct i915_vma *vma;
 
-		obj = i915_gem_alloc_context_obj(dev,
-						 dev_priv->hw_context_size);
+		obj = alloc_context_obj(dev, dev_priv->hw_context_size);
 		if (IS_ERR(obj)) {
 			ret = PTR_ERR(obj);
 			goto err_out;
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✓ Fi.CI.BAT: success for drm/i915: i915_gem_alloc_context_obj can be static (rev2)

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915: i915_gem_alloc_context_obj can be static (rev2)
URL : https://patchwork.freedesktop.org/series/15804/
State : success

== Summary ==

Series 15804v2 drm/i915: i915_gem_alloc_context_obj can be static
https://patchwork.freedesktop.org/api/1.0/series/15804/revisions/2/mbox/

fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 

d8db619985b5a8e4416ab78017ea9252e7f24689 drm-intel-nightly: 2016y-11m-23d-07h-34m-41s UTC integration manifest 0ff8a90 drm/i915: i915_gem_alloc_context_obj can be static

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3090/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Re: ✓ Fi.CI.BAT: success for drm/i915: i915_gem_alloc_context_obj can be static (rev2)

Quoted 30 lines · Patchwork

== Series Details ==

Series: drm/i915: i915_gem_alloc_context_obj can be static (rev2)
URL : https://patchwork.freedesktop.org/series/15804/
State : success

== Summary ==

Series 15804v2 drm/i915: i915_gem_alloc_context_obj can be static
https://patchwork.freedesktop.org/api/1.0/series/15804/revisions/2/mbox/

fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28
fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21
fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21
fi-skl-6770hq    total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33
Quoted 2 lines

d8db619985b5a8e4416ab78017ea9252e7f24689 drm-intel-nightly: 2016y-11m-23d-07h-34m-41s UTC integration manifest 0ff8a90 drm/i915: i915_gem_alloc_context_obj can be static

Pushed, thanks for the review!

Regards,

Tvrtko

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx