Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254257
b: refs/heads/master
c: 79d2427
h: refs/heads/master
i:
  254255: 4ee1a6f
v: v3
  • Loading branch information
Chris Wilson authored and Keith Packard committed Jun 30, 2011
1 parent 1469cf9 commit 4048b11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc501fbc4389f6c15a8da14684b5926e0d9553da
refs/heads/master: 79d2427338e8da362678de32a1c8af1dc8a9810a
17 changes: 10 additions & 7 deletions trunk/drivers/gpu/drm/i915/intel_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,15 +1409,18 @@ void intel_setup_overlay(struct drm_device *dev)
overlay = kzalloc(sizeof(struct intel_overlay), GFP_KERNEL);
if (!overlay)
return;

mutex_lock(&dev->struct_mutex);
if (WARN_ON(dev_priv->overlay))
goto out_free;

overlay->dev = dev;

reg_bo = i915_gem_alloc_object(dev, PAGE_SIZE);
if (!reg_bo)
goto out_free;
overlay->reg_bo = reg_bo;

mutex_lock(&dev->struct_mutex);

if (OVERLAY_NEEDS_PHYSICAL(dev)) {
ret = i915_gem_attach_phys_object(dev, reg_bo,
I915_GEM_PHYS_OVERLAY_REGS,
Expand All @@ -1442,8 +1445,6 @@ void intel_setup_overlay(struct drm_device *dev)
}
}

mutex_unlock(&dev->struct_mutex);

/* init all values */
overlay->color_key = 0x0101fe;
overlay->brightness = -19;
Expand All @@ -1452,7 +1453,7 @@ void intel_setup_overlay(struct drm_device *dev)

regs = intel_overlay_map_regs(overlay);
if (!regs)
goto out_free_bo;
goto out_unpin_bo;

memset(regs, 0, sizeof(struct overlay_registers));
update_polyphase_filter(regs);
Expand All @@ -1461,15 +1462,17 @@ void intel_setup_overlay(struct drm_device *dev)
intel_overlay_unmap_regs(overlay, regs);

dev_priv->overlay = overlay;
mutex_unlock(&dev->struct_mutex);
DRM_INFO("initialized overlay support\n");
return;

out_unpin_bo:
i915_gem_object_unpin(reg_bo);
if (!OVERLAY_NEEDS_PHYSICAL(dev))
i915_gem_object_unpin(reg_bo);
out_free_bo:
drm_gem_object_unreference(&reg_bo->base);
mutex_unlock(&dev->struct_mutex);
out_free:
mutex_unlock(&dev->struct_mutex);
kfree(overlay);
return;
}
Expand Down

0 comments on commit 4048b11

Please sign in to comment.