Commit 07ea0d85 authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter

drm/i915: Clarify HW context size logic

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: default avatarBen Widawsky <ben@bwidawsk.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent cf0a6584
...@@ -242,7 +242,6 @@ static int create_default_context(struct drm_i915_private *dev_priv) ...@@ -242,7 +242,6 @@ static int create_default_context(struct drm_i915_private *dev_priv)
void i915_gem_context_init(struct drm_device *dev) void i915_gem_context_init(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t ctx_size;
if (!HAS_HW_CONTEXTS(dev)) { if (!HAS_HW_CONTEXTS(dev)) {
dev_priv->hw_contexts_disabled = true; dev_priv->hw_contexts_disabled = true;
...@@ -254,11 +253,9 @@ void i915_gem_context_init(struct drm_device *dev) ...@@ -254,11 +253,9 @@ void i915_gem_context_init(struct drm_device *dev)
dev_priv->ring[RCS].default_context) dev_priv->ring[RCS].default_context)
return; return;
ctx_size = get_context_size(dev); dev_priv->hw_context_size = round_up(get_context_size(dev), 4096);
dev_priv->hw_context_size = get_context_size(dev);
dev_priv->hw_context_size = round_up(dev_priv->hw_context_size, 4096);
if (ctx_size <= 0 || ctx_size > (1<<20)) { if (dev_priv->hw_context_size > (1<<20)) {
dev_priv->hw_contexts_disabled = true; dev_priv->hw_contexts_disabled = true;
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment