Re: [Intel-gfx] [PATCH] drm/i915: Clarify HW context size logic

2013-02-08 Thread Daniel Vetter
On Thu, Feb 07, 2013 at 01:34:19PM -0800, Ben Widawsky wrote:
 This was a rebase error from when the patches originally landed. Since
 the context size is unsigned, there is also no use in checking if it's
 less than 0.
 
 The existing code is not really wrong, but it's not simple as it should
 be.
 
 Signed-off-by: Ben Widawsky b...@bwidawsk.net

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Clarify HW context size logic

2013-02-07 Thread Ben Widawsky
This was a rebase error from when the patches originally landed. Since
the context size is unsigned, there is also no use in checking if it's
less than 0.

The existing code is not really wrong, but it's not simple as it should
be.

Signed-off-by: Ben Widawsky b...@bwidawsk.net
---
 drivers/gpu/drm/i915/i915_gem_context.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c 
b/drivers/gpu/drm/i915/i915_gem_context.c
index 37cac7e..080e90e 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -246,7 +246,6 @@ err_destroy:
 void i915_gem_context_init(struct drm_device *dev)
 {
struct drm_i915_private *dev_priv = dev-dev_private;
-   uint32_t ctx_size;
 
if (!HAS_HW_CONTEXTS(dev)) {
dev_priv-hw_contexts_disabled = true;
@@ -258,11 +257,9 @@ void i915_gem_context_init(struct drm_device *dev)
dev_priv-ring[RCS].default_context)
return;
 
-   ctx_size = get_context_size(dev);
-   dev_priv-hw_context_size = get_context_size(dev);
-   dev_priv-hw_context_size = round_up(dev_priv-hw_context_size, 4096);
+   dev_priv-hw_context_size = round_up(get_context_size(dev), 4096);
 
-   if (ctx_size = 0 || ctx_size  (120)) {
+   if (dev_priv-hw_context_size  (120)) {
dev_priv-hw_contexts_disabled = true;
return;
}
-- 
1.8.1.2

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx