mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
drm/i915: Pass intel_display to intel_scanout_needs_vtd_wa()
Now that intel_scanout_needs_vtd_wa() is no longer used from the gem code we can convert it to take struct intel_display. which will help with converting the low level plane code over as well. Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250206185533.32306-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
7d94a9a1c4
commit
3eb1b39820
|
|
@ -780,13 +780,13 @@ unsigned int vlv_plane_min_alignment(struct intel_plane *plane,
|
|||
const struct drm_framebuffer *fb,
|
||||
int color_plane)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
|
||||
if (intel_plane_can_async_flip(plane, fb->modifier))
|
||||
return 256 * 1024;
|
||||
|
||||
/* FIXME undocumented so not sure what's actually needed */
|
||||
if (intel_scanout_needs_vtd_wa(i915))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
return 256 * 1024;
|
||||
|
||||
switch (fb->modifier) {
|
||||
|
|
@ -804,12 +804,12 @@ static unsigned int g4x_primary_min_alignment(struct intel_plane *plane,
|
|||
const struct drm_framebuffer *fb,
|
||||
int color_plane)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
|
||||
if (intel_plane_can_async_flip(plane, fb->modifier))
|
||||
return 256 * 1024;
|
||||
|
||||
if (intel_scanout_needs_vtd_wa(i915))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
return 256 * 1024;
|
||||
|
||||
switch (fb->modifier) {
|
||||
|
|
@ -865,6 +865,7 @@ static const struct drm_plane_funcs i8xx_plane_funcs = {
|
|||
struct intel_plane *
|
||||
intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct intel_plane *plane;
|
||||
const struct drm_plane_funcs *plane_funcs;
|
||||
unsigned int supported_rotations;
|
||||
|
|
@ -959,7 +960,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
|||
plane->min_alignment = i9xx_plane_min_alignment;
|
||||
|
||||
/* FIXME undocumented for VLV/CHV so not sure what's actually needed */
|
||||
if (intel_scanout_needs_vtd_wa(dev_priv))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
plane->vtd_guard = 128;
|
||||
|
||||
if (IS_I830(dev_priv) || IS_I845G(dev_priv)) {
|
||||
|
|
|
|||
|
|
@ -372,9 +372,9 @@ static unsigned int i9xx_cursor_min_alignment(struct intel_plane *plane,
|
|||
const struct drm_framebuffer *fb,
|
||||
int color_plane)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
|
||||
if (intel_scanout_needs_vtd_wa(i915))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
return 64 * 1024;
|
||||
|
||||
return 4 * 1024; /* physical for i915/i945 */
|
||||
|
|
@ -989,6 +989,7 @@ struct intel_plane *
|
|||
intel_cursor_plane_create(struct drm_i915_private *dev_priv,
|
||||
enum pipe pipe)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct intel_plane *cursor;
|
||||
int ret, zpos;
|
||||
u64 *modifiers;
|
||||
|
|
@ -1019,7 +1020,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
|
|||
else
|
||||
cursor->min_alignment = i9xx_cursor_min_alignment;
|
||||
|
||||
if (intel_scanout_needs_vtd_wa(dev_priv))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
cursor->vtd_guard = 2;
|
||||
|
||||
cursor->update_arm = i9xx_cursor_update_arm;
|
||||
|
|
|
|||
|
|
@ -8784,7 +8784,9 @@ void intel_hpd_poll_fini(struct drm_i915_private *i915)
|
|||
drm_connector_list_iter_end(&conn_iter);
|
||||
}
|
||||
|
||||
bool intel_scanout_needs_vtd_wa(struct drm_i915_private *i915)
|
||||
bool intel_scanout_needs_vtd_wa(struct intel_display *display)
|
||||
{
|
||||
return IS_DISPLAY_VER(i915, 6, 11) && i915_vtd_active(i915);
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
return IS_DISPLAY_VER(display, 6, 11) && i915_vtd_active(i915);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ bool assert_port_valid(struct drm_i915_private *i915, enum port port);
|
|||
unlikely(__ret_warn_on); \
|
||||
})
|
||||
|
||||
bool intel_scanout_needs_vtd_wa(struct drm_i915_private *i915);
|
||||
bool intel_scanout_needs_vtd_wa(struct intel_display *display);
|
||||
int intel_crtc_num_joined_pipes(const struct intel_crtc_state *crtc_state);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -980,9 +980,9 @@ static unsigned int g4x_sprite_min_alignment(struct intel_plane *plane,
|
|||
const struct drm_framebuffer *fb,
|
||||
int color_plane)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
|
||||
if (intel_scanout_needs_vtd_wa(i915))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
return 128 * 1024;
|
||||
|
||||
return 4 * 1024;
|
||||
|
|
@ -1610,7 +1610,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
|
|||
plane->min_cdclk = vlv_plane_min_cdclk;
|
||||
|
||||
/* FIXME undocumented for VLV/CHV so not sure what's actually needed */
|
||||
if (intel_scanout_needs_vtd_wa(dev_priv))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
plane->vtd_guard = 128;
|
||||
|
||||
if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
|
||||
|
|
@ -1639,7 +1639,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
|
|||
|
||||
plane->min_alignment = g4x_sprite_min_alignment;
|
||||
|
||||
if (intel_scanout_needs_vtd_wa(dev_priv))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
plane->vtd_guard = 64;
|
||||
|
||||
formats = snb_sprite_formats;
|
||||
|
|
@ -1656,7 +1656,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
|
|||
plane->min_alignment = g4x_sprite_min_alignment;
|
||||
plane->min_cdclk = g4x_sprite_min_cdclk;
|
||||
|
||||
if (intel_scanout_needs_vtd_wa(dev_priv))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
plane->vtd_guard = 64;
|
||||
|
||||
if (IS_SANDYBRIDGE(dev_priv)) {
|
||||
|
|
|
|||
|
|
@ -2697,6 +2697,7 @@ struct intel_plane *
|
|||
skl_universal_plane_create(struct drm_i915_private *dev_priv,
|
||||
enum pipe pipe, enum plane_id plane_id)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
const struct drm_plane_funcs *plane_funcs;
|
||||
struct intel_plane *plane;
|
||||
enum drm_plane_type plane_type;
|
||||
|
|
@ -2750,7 +2751,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
|
|||
else
|
||||
plane->min_alignment = skl_plane_min_alignment;
|
||||
|
||||
if (intel_scanout_needs_vtd_wa(dev_priv))
|
||||
if (intel_scanout_needs_vtd_wa(display))
|
||||
plane->vtd_guard = DISPLAY_VER(dev_priv) >= 10 ? 168 : 136;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 11) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user