mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 13:21:45 +00:00
drm/i915/dsb: fix cmd_buf being wrongly set
The "err" label is not really "err", but rather "out" since the return path is shared between error condition and normal path. This broke when commit03cea61076
("drm/i915/dsb: fix extra warning on error path handling") added a "dsb->cmd_buf = NULL;" there, making DSB to stop working since now all writes would pass-through via mmio. Remove the set to NULL since it's actually not needed: we only set it if all steps are successful. While at it, rename the label so this confusion doesn't happen again. Fixes:03cea61076
("drm/i915/dsb: fix extra warning on error path handling") Resolves: https://gitlab.freedesktop.org/drm/intel/issues/8 Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Animesh Manna <animesh.manna@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191127221119.384754-1-lucas.demarchi@intel.com
This commit is contained in:
parent
ca851c2248
commit
13caf7bea4
1 changed files with 9 additions and 9 deletions
|
@ -116,34 +116,34 @@ intel_dsb_get(struct intel_crtc *crtc)
|
||||||
obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
|
obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
|
||||||
if (IS_ERR(obj)) {
|
if (IS_ERR(obj)) {
|
||||||
DRM_ERROR("Gem object creation failed\n");
|
DRM_ERROR("Gem object creation failed\n");
|
||||||
goto err;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, 0);
|
vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, 0);
|
||||||
if (IS_ERR(vma)) {
|
if (IS_ERR(vma)) {
|
||||||
DRM_ERROR("Vma creation failed\n");
|
DRM_ERROR("Vma creation failed\n");
|
||||||
i915_gem_object_put(obj);
|
i915_gem_object_put(obj);
|
||||||
goto err;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = i915_gem_object_pin_map(vma->obj, I915_MAP_WC);
|
buf = i915_gem_object_pin_map(vma->obj, I915_MAP_WC);
|
||||||
if (IS_ERR(buf)) {
|
if (IS_ERR(buf)) {
|
||||||
DRM_ERROR("Command buffer creation failed\n");
|
DRM_ERROR("Command buffer creation failed\n");
|
||||||
goto err;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
dsb->id = DSB1;
|
dsb->id = DSB1;
|
||||||
dsb->vma = vma;
|
dsb->vma = vma;
|
||||||
dsb->cmd_buf = buf;
|
dsb->cmd_buf = buf;
|
||||||
|
|
||||||
err:
|
out:
|
||||||
/*
|
/*
|
||||||
* Set cmd_buf to NULL so the writes pass-through, but leave the
|
* On error dsb->cmd_buf will continue to be NULL, making the writes
|
||||||
* dangling refcount to be removed later by the corresponding
|
* pass-through. Leave the dangling ref to be removed later by the
|
||||||
* intel_dsb_put(): the important error message will already be
|
* corresponding intel_dsb_put(): the important error message will
|
||||||
* logged above.
|
* already be logged above.
|
||||||
*/
|
*/
|
||||||
dsb->cmd_buf = NULL;
|
|
||||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||||
|
|
||||||
return dsb;
|
return dsb;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue