mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-18 16:44:27 +08:00
a071fa0064
So from just a quick look we seem to have enough information to accurately figure out whether a given gem bo is used as a frontbuffer and where exactly: We have obj->pin_count as a first check with no false negatives and only negligible false positives. And then we can just walk the modeset objects and figure out where exactly a buffer is used as scanout. Except that we can't due to locking order: If we already hold dev->struct_mutex we can't acquire any modeset locks, so could potential chase freed pointers and other evil stuff. So we need something else. For that introduce a new set of bits obj->frontbuffer_bits to track where a buffer object is used. That we can then chase without grabbing any modeset locks. Of course the consumers of this (DRRS, PSR, FBC, ...) still need to be able to do their magic both when called from modeset and from gem code. But that can be easily achieved by adding locks for these specific subsystems which always nest within either kms or gem locking. This patch just adds the relevant update code to all places. Note that if we ever support multi-planar scanout targets then we need one frontbuffer tracking bit per attachment point that we expose to userspace. v2: - Fix more oopsen. Oops. - WARN if we leak obj->frontbuffer_bits when freeing a gem buffer. Fix the bugs this brought to light. - s/update_frontbuffer_bits/update_fb_bits/. More consistent with the fb tracking functions (fb for gem object, frontbuffer for raw bits). And the function name was way too long. v3: Size obj->frontbuffer_bits correctly so that all pipes fit in. v4: Don't update fb bits in set_base on failure. Noticed by Chris. v5: s/i915_gem_update_fb_bits/i915_gem_track_fb/ Also remove a few local enum pipe variables which are now no longer needed to make the function arguments no drop over the 80 char limit. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> |
||
---|---|---|
.. | ||
dvo_ch7xxx.c | ||
dvo_ch7017.c | ||
dvo_ivch.c | ||
dvo_ns2501.c | ||
dvo_sil164.c | ||
dvo_tfp410.c | ||
dvo.h | ||
i915_cmd_parser.c | ||
i915_debugfs.c | ||
i915_dma.c | ||
i915_drv.c | ||
i915_drv.h | ||
i915_gem_context.c | ||
i915_gem_debug.c | ||
i915_gem_dmabuf.c | ||
i915_gem_evict.c | ||
i915_gem_execbuffer.c | ||
i915_gem_gtt.c | ||
i915_gem_gtt.h | ||
i915_gem_render_state.c | ||
i915_gem_stolen.c | ||
i915_gem_tiling.c | ||
i915_gem_userptr.c | ||
i915_gem.c | ||
i915_gpu_error.c | ||
i915_ioc32.c | ||
i915_irq.c | ||
i915_params.c | ||
i915_reg.h | ||
i915_suspend.c | ||
i915_sysfs.c | ||
i915_trace_points.c | ||
i915_trace.h | ||
i915_ums.c | ||
intel_acpi.c | ||
intel_bios.c | ||
intel_bios.h | ||
intel_crt.c | ||
intel_ddi.c | ||
intel_display.c | ||
intel_dp.c | ||
intel_drv.h | ||
intel_dsi_cmd.c | ||
intel_dsi_cmd.h | ||
intel_dsi_panel_vbt.c | ||
intel_dsi_pll.c | ||
intel_dsi.c | ||
intel_dsi.h | ||
intel_dvo.c | ||
intel_fbdev.c | ||
intel_hdmi.c | ||
intel_i2c.c | ||
intel_lvds.c | ||
intel_modes.c | ||
intel_opregion.c | ||
intel_overlay.c | ||
intel_panel.c | ||
intel_pm.c | ||
intel_renderstate_gen6.c | ||
intel_renderstate_gen7.c | ||
intel_renderstate_gen8.c | ||
intel_renderstate.h | ||
intel_ringbuffer.c | ||
intel_ringbuffer.h | ||
intel_sdvo_regs.h | ||
intel_sdvo.c | ||
intel_sideband.c | ||
intel_sprite.c | ||
intel_tv.c | ||
intel_uncore.c | ||
Kconfig | ||
Makefile |