[Intel-gfx] [PATCH] drm/i915: Remove intel_fronbuffer forward declaration from gem/i915_gem_object_types.h
Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h index 15f8297dc34e..9a1c64d8b778 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h @@ -14,7 +14,6 @@ #include "i915_selftest.h" struct drm_i915_gem_object; -struct intel_fronbuffer; /* * struct i915_lut_handle tracks the fast lookups from handle to vma used -- 2.24.0.rc1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 08/11] drm/i915: Link planes in a bigjoiner configuration, v3.
Make sure that when a plane is set in a bigjoiner mode, we will add their counterpart to the atomic state as well. This will allow us to make sure all state is available when planes are checked. Because of the funny interactions with bigjoiner and planar YUV formats, we may end up adding a lot of planes, so we have to keep iterating until we no longer add any planes. Also fix the atomic intel plane iterator, so things watermarks start working automagically. Changes since v1: - Rebase on top of plane_state split, cleaning up the code a lot. - Make intel_atomic_crtc_state_for_each_plane_state() bigjoiner capable. - Add iter macro to intel_atomic_crtc_state_for_each_plane_state() to keep iteration working. Changes since v2: - Add icl_(un)set_bigjoiner_plane_links, to make it more clear where links are made and broken. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 47 +++- .../gpu/drm/i915/display/intel_atomic_plane.h | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 207 -- drivers/gpu/drm/i915/display/intel_display.h | 18 +- .../drm/i915/display/intel_display_types.h| 11 + drivers/gpu/drm/i915/intel_pm.c | 16 +- 6 files changed, 268 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 42b3b3449d2e..b26e10519ca4 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -190,12 +190,17 @@ static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state) memset(&plane_state->hw, 0, sizeof(plane_state->hw)); } -void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, +void intel_plane_copy_uapi_to_hw_state(const struct intel_crtc_state *crtc_state, + struct intel_plane_state *plane_state, const struct intel_plane_state *from_plane_state) { intel_plane_clear_hw_state(plane_state); - plane_state->hw.crtc = from_plane_state->uapi.crtc; + if (from_plane_state->uapi.crtc) + plane_state->hw.crtc = crtc_state->uapi.crtc; + else + plane_state->hw.crtc = NULL; + plane_state->hw.fb = from_plane_state->uapi.fb; if (plane_state->hw.fb) drm_framebuffer_get(plane_state->hw.fb); @@ -214,10 +219,20 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); + struct intel_plane_state *new_master_plane_state = new_plane_state; + struct intel_atomic_state *state = + to_intel_atomic_state(new_plane_state->uapi.state); const struct drm_framebuffer *fb; int ret; - intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state); + if (new_plane_state->bigjoiner_slave) + new_master_plane_state = + intel_atomic_get_new_plane_state(state, + new_plane_state->bigjoiner_plane); + + intel_plane_copy_uapi_to_hw_state(new_crtc_state, + new_plane_state, + new_master_plane_state); fb = new_plane_state->hw.fb; new_crtc_state->active_planes &= ~BIT(plane->id); @@ -257,15 +272,36 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ } static struct intel_crtc * -get_crtc_from_states(const struct intel_plane_state *old_plane_state, +get_crtc_from_states(struct intel_atomic_state *state, +const struct intel_plane_state *old_plane_state, const struct intel_plane_state *new_plane_state) { + struct drm_i915_private *dev_priv = to_i915(state->base.dev); + struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); + if (new_plane_state->uapi.crtc) return to_intel_crtc(new_plane_state->uapi.crtc); if (old_plane_state->uapi.crtc) return to_intel_crtc(old_plane_state->uapi.crtc); + if (new_plane_state->bigjoiner_slave) { + const struct intel_plane_state *new_master_plane_state = + intel_atomic_get_new_plane_state(state, new_plane_state->bigjoiner_plane); + + /* need to use uapi here, new_master_plane_state might not be copied to hw yet */ + if (new_master_plane_state->uapi.crtc) + return intel_get_crtc_for_pipe(dev_priv, plane->pipe); + } + + if (old_plane_state->bigjoiner_slave) { + const struct intel_pl
[Intel-gfx] [PATCH 11/11] drm/i915: Add debugfs dumping for bigjoiner, v2.
It's useful to know what the actual clipped state is, rather than the unclipped crtc properties. This is useful when a plane is spread across 2 crtc's, where the slave crtc has no own plane properties but derives its clipped values from the master crtc. Changes since v1: - Report planar slaves as such, now that we have the plane_state switch. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_debugfs.c | 49 +++-- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index cab632791f73..aeefe4a726f4 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -2589,6 +2589,17 @@ static void plane_rotation(char *buf, size_t bufsize, unsigned int rotation) rotation); } +static const char *plane_visibility(struct intel_plane_state *plane_state) +{ + if (plane_state->uapi.visible) + return "visible"; + + if (plane_state->planar_slave) + return "planar-slave"; + + return "hidden"; +} + static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc) { struct drm_i915_private *dev_priv = node_to_i915(m->private); @@ -2596,42 +2607,29 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc) struct intel_plane *intel_plane; for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) { - struct drm_plane_state *state; + struct intel_plane_state *state; struct drm_plane *plane = &intel_plane->base; struct drm_format_name_buf format_name; char rot_str[48]; - if (!plane->state) { - seq_puts(m, "plane->state is NULL!\n"); - continue; - } - - state = plane->state; + state = to_intel_plane_state(plane->state); - if (state->fb) { - drm_get_format_name(state->fb->format->format, + if (state->hw.fb) { + drm_get_format_name(state->hw.fb->format->format, &format_name); } else { sprintf(format_name.str, "N/A"); } - plane_rotation(rot_str, sizeof(rot_str), state->rotation); + plane_rotation(rot_str, sizeof(rot_str), state->hw.rotation); - seq_printf(m, "\t--Plane id %d: type=%s, crtc_pos=%4dx%4d, crtc_size=%4dx%4d, src_pos=%d.%04ux%d.%04u, src_size=%d.%04ux%d.%04u, format=%s, rotation=%s\n", + seq_printf(m, "\t--Plane id %d: type=%s, %s, clipped crtc="DRM_RECT_FMT", clipped src="DRM_RECT_FP_FMT", format=%s, rotation=%s\n", plane->base.id, plane_type(intel_plane->base.type), - state->crtc_x, state->crtc_y, - state->crtc_w, state->crtc_h, - (state->src_x >> 16), - ((state->src_x & 0x) * 15625) >> 10, - (state->src_y >> 16), - ((state->src_y & 0x) * 15625) >> 10, - (state->src_w >> 16), - ((state->src_w & 0x) * 15625) >> 10, - (state->src_h >> 16), - ((state->src_h & 0x) * 15625) >> 10, - format_name.str, - rot_str); + plane_visibility(state), + DRM_RECT_ARG(&state->uapi.dst), + DRM_RECT_FP_ARG(&state->uapi.src), + format_name.str, rot_str); } } @@ -2687,6 +2685,11 @@ static int i915_display_info(struct seq_file *m, void *unused) yesno(pipe_config->hw.active), pipe_config->pipe_src_w, pipe_config->pipe_src_h, yesno(pipe_config->dither), pipe_config->pipe_bpp); + if (pipe_config->bigjoiner) + seq_printf(m, "\tLinked to [CRTC:%d:%s] as a %s\n", + pipe_config->bigjoiner_linked_crtc->base.base.id, + pipe_config->bigjoiner_linked_crtc->base.name, + pipe_config->bigjoiner_slave ? "slave" : "master"); if (pipe_config->hw.active) { struct intel_plane *cursor = -- 2.24.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Small changes to intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet. eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port. Changes since v1: - Disallow bigjoiner on eDP. Changes since v2: - Rename intel_dp_downstream_max_dotclock to intel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville) Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_dp.c | 117 ++-- 1 file changed, 89 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 3123958e2081..9b7df8e85ea2 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -243,25 +243,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes) return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock(struct intel_dp *intel_dp) +static int source_max_dotclock(struct intel_dp *intel_dp, bool allow_bigjoiner) { struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *encoder = &intel_dig_port->base; - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); - int max_dotclk = dev_priv->max_dotclk_freq; - int ds_max_dotclk; + struct drm_i915_private *i915 = to_i915(encoder->base.dev); + + if (allow_bigjoiner && INTEL_GEN(i915) >= 11 && !intel_dp_is_edp(intel_dp)) + return 2 * i915->max_dotclk_freq; + + return i915->max_dotclk_freq; +} +static int downstream_max_dotclock(struct intel_dp *intel_dp) +{ int type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK; if (type != DP_DS_PORT_TYPE_VGA) - return max_dotclk; + return 0; - ds_max_dotclk = drm_dp_downstream_max_clock(intel_dp->dpcd, - intel_dp->downstream_ports); + return drm_dp_downstream_max_clock(intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock(struct intel_dp *intel_dp, bool allow_bigjoiner) +{ + int max_dotclk = source_max_dotclock(intel_dp, allow_bigjoiner); + int ds_max_dotclk = downstream_max_dotclock(intel_dp); if (ds_max_dotclk != 0) - max_dotclk = min(max_dotclk, ds_max_dotclk); + return min(max_dotclk, ds_max_dotclk); return max_dotclk; } @@ -506,7 +518,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915) static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, u32 link_clock, u32 lane_count, - u32 mode_clock, u32 mode_hdisplay) + u32 mode_clock, u32 mode_hdisplay, + bool bigjoiner) { u32 bits_per_pixel, max_bpp_small_joiner_ram; int i; @@ -524,6 +537,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, /* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram = small_joiner_ram_size_bits(i915) / mode_hdisplay; + + if (bigjoiner) + max_bpp_small_joiner_ram *= 2; + DRM_DEBUG_KMS("Max small joiner bpp: %u\n", max_bpp_small_joiner_ram); /* @@ -532,6 +549,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, */ bits_per_pixel = min(bits_per_pixel, max_bpp_small_joiner_ram); + if (bigjoiner) { + u32 max_bpp_bigjoiner = + i915->max_cdclk_freq * 48 / + intel_dp_mode_to_fec_clock(mode_clock); + + DRM_DEBUG_KMS("Max big joiner bpp: %u\n", max_bpp_bigjoiner); + bits_per_pixel = min(bits_per_pixel, max_bpp_bigjoiner); + } + /* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0]) { DRM_DEBUG_KMS("Unsupported BPP %u, min %u\n", @@ -554,7 +580,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, } static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, - int mode_clock, int mode_hdisplay) + int mode_clock, int mode_hdisplay, + bool bigjoiner) { u8 min_slice_count, i; int max_slice_width; @@ -579,12 +606,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, /* Find the closest match to the valid slice count values */
[Intel-gfx] [PATCH 10/11] drm/i915: Add intel_update_bigjoiner handling.
Enabling is done in a special sequence and so should plane updates be. Ideally the end user never notices the second pipe is used, so use the vblank evasion to cover both pipes. This way ideally everything will be tear free, and updates are really atomic as userspace expects it. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 113 --- drivers/gpu/drm/i915/display/intel_sprite.c | 22 +++- drivers/gpu/drm/i915/display/intel_sprite.h | 3 +- 3 files changed, 119 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 4c4e51e409f6..f3fc89e52b1b 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -14826,7 +14826,7 @@ static void intel_update_crtc(struct intel_crtc *crtc, else i9xx_update_planes_on_crtc(state, crtc); - intel_pipe_update_end(new_crtc_state); + intel_pipe_update_end(new_crtc_state, NULL); /* * We usually enable FIFO underrun interrupts as part of the @@ -14973,6 +14973,54 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) } } +static void intel_update_bigjoiner(struct intel_crtc *crtc, + struct intel_atomic_state *state, + struct intel_crtc_state *old_crtc_state, + struct intel_crtc_state *new_crtc_state) +{ + struct drm_i915_private *dev_priv = to_i915(state->base.dev); + bool modeset = needs_modeset(new_crtc_state); + struct intel_crtc *slave = new_crtc_state->bigjoiner_linked_crtc; + struct intel_crtc_state *new_slave_crtc_state = + intel_atomic_get_new_crtc_state(state, slave); + struct intel_crtc_state *old_slave_crtc_state = + intel_atomic_get_old_crtc_state(state, slave); + + if (modeset) { + /* Enable slave first */ + intel_crtc_update_active_timings(new_slave_crtc_state); + dev_priv->display.crtc_enable(new_slave_crtc_state, state); + + /* Then master */ + intel_crtc_update_active_timings(new_crtc_state); + dev_priv->display.crtc_enable(new_crtc_state, state); + + /* vblanks work again, re-enable pipe CRC. */ + intel_crtc_enable_pipe_crc(crtc); + + } else { + intel_pre_plane_update(old_crtc_state, new_crtc_state); + intel_pre_plane_update(old_slave_crtc_state, new_slave_crtc_state); + + if (new_crtc_state->update_pipe) + intel_encoders_update_pipe(crtc, new_crtc_state, state); + } + + /* +* Perform vblank evasion around commit operation, and make sure to +* commit both planes simultaneously for best results. +*/ + intel_pipe_update_start(new_crtc_state); + + commit_pipe_config(state, old_crtc_state, new_crtc_state); + commit_pipe_config(state, old_slave_crtc_state, new_slave_crtc_state); + + skl_update_planes_on_crtc(state, crtc); + skl_update_planes_on_crtc(state, slave); + + intel_pipe_update_end(new_crtc_state, new_slave_crtc_state); +} + static void intel_commit_modeset_enables(struct intel_atomic_state *state) { struct intel_crtc *crtc; @@ -15036,7 +15084,7 @@ static void intel_post_crtc_enable_updates(struct intel_crtc *crtc, intel_pipe_update_start(new_crtc_state); commit_pipe_config(state, old_crtc_state, new_crtc_state); skl_update_planes_on_crtc(state, crtc); - intel_pipe_update_end(new_crtc_state); + intel_pipe_update_end(new_crtc_state, NULL); /* * We usually enable FIFO underrun interrupts as part of the @@ -15098,7 +15146,7 @@ static void intel_update_trans_port_sync_crtcs(struct intel_crtc *crtc, static void skl_commit_modeset_enables(struct intel_atomic_state *state) { struct drm_i915_private *dev_priv = to_i915(state->base.dev); - struct intel_crtc *crtc; + struct intel_crtc *crtc, *slave; struct intel_crtc_state *old_crtc_state, *new_crtc_state; unsigned int updated = 0; bool progress; @@ -15106,11 +15154,47 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state) u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices; u8 required_slices = state->wm_results.ddb.enabled_slices; struct skl_ddb_entry entries[I915_MAX_PIPES] = {}; + struct skl_ddb_entry new_entries[I915_MAX_PIPES] = {}; + const struct intel_crtc_state *slave_crtc_state; + u32 dirty_pipes = state->wm_results.dirty_pipes; + + for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { + if (new_crtc_state->bigjoiner_slave) { +
[Intel-gfx] [PATCH 02/11] drm/i915: Remove hw.mode
The members in hw.mode can be used from adjusted_mode as well, use that when available. Some places that use hw.mode can be converted to use adjusted_mode as well. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 49 ++- .../drm/i915/display/intel_display_types.h| 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 +++--- 4 files changed, 34 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index adf50c4b38ad..18acecc3642d 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -8440,9 +8440,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp = I915_READ(PIPESRC(crtc->pipe)); pipe_config->pipe_src_h = (tmp & 0x) + 1; pipe_config->pipe_src_w = ((tmp >> 16) & 0x) + 1; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode, @@ -12098,8 +12095,8 @@ static int icl_add_sync_mode_crtcs(struct intel_crtc_state *crtc_state) continue; if (!connector->has_tile) continue; - if (crtc_state->hw.mode.hdisplay != connector->tile_h_size || - crtc_state->hw.mode.vdisplay != connector->tile_v_size) + if (crtc_state->hw.adjusted_mode.crtc_hdisplay != connector->tile_h_size || + crtc_state->hw.adjusted_mode.crtc_vdisplay != connector->tile_v_size) return 0; if (connector->tile_h_loc == connector->num_h_tile - 1 && connector->tile_v_loc == connector->num_v_tile - 1) @@ -12506,7 +12503,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config, intel_dump_infoframe(dev_priv, &pipe_config->infoframes.hdmi); DRM_DEBUG_KMS("requested mode:\n"); - drm_mode_debug_printmodeline(&pipe_config->hw.mode); + drm_mode_debug_printmodeline(&pipe_config->uapi.mode); DRM_DEBUG_KMS("adjusted mode:\n"); drm_mode_debug_printmodeline(&pipe_config->hw.adjusted_mode); intel_dump_crtc_timings(&pipe_config->hw.adjusted_mode); @@ -12640,16 +12637,16 @@ intel_crtc_copy_uapi_to_hw_state(struct intel_crtc_state *crtc_state) { crtc_state->hw.enable = crtc_state->uapi.enable; crtc_state->hw.active = crtc_state->uapi.active; - crtc_state->hw.mode = crtc_state->uapi.mode; crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode; intel_crtc_copy_uapi_to_hw_state_nomodeset(crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active; - WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, &crtc_state->hw.mode) < 0); + WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, user_mode) < 0); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode; @@ -12702,6 +12699,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state) memcpy(crtc_state, saved_state, sizeof(*crtc_state)); kfree(saved_state); + /* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags = 0; + crtc_state->uapi.adjusted_mode.private_flags = 0; + intel_crtc_copy_uapi_to_hw_state(crtc_state); return 0; @@ -12750,7 +12751,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config) * computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ - drm_mode_get_hv_timing(&pipe_config->hw.mode, + drm_mode_get_hv_timing(&pipe_config->hw.pipe_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h); @@ -12852,6 +12853,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config) */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; + /* without bigjoiner, pipe_mode == adjusted_mode */ + pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode; return 0; } @@ -12995,8 +12998,8
[Intel-gfx] [PATCH 03/11] drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 47 +- .../drm/i915/display/intel_display_types.h| 11 ++- drivers/gpu/drm/i915/intel_pm.c | 94 +-- 3 files changed, 81 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 18acecc3642d..7a6da85823af 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -151,7 +151,7 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc, static int intel_framebuffer_init(struct intel_framebuffer *ifb, struct drm_i915_gem_object *obj, struct drm_mode_fb_cmd2 *mode_cmd); -static void intel_set_pipe_timings(const struct intel_crtc_state *crtc_state); +static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state); static void intel_set_pipe_src_size(const struct intel_crtc_state *crtc_state); static void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, const struct intel_link_m_n *m_n, @@ -5651,7 +5651,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, */ int skl_update_scaler_crtc(struct intel_crtc_state *state) { - const struct drm_display_mode *adjusted_mode = &state->hw.adjusted_mode; + const struct drm_display_mode *pipe_mode = &state->hw.pipe_mode; bool need_scaler = false; if (state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) @@ -5660,8 +5660,8 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) return skl_update_scaler(state, !state->hw.active, SKL_CRTC_INDEX, &state->scaler_state.scaler_id, state->pipe_src_w, state->pipe_src_h, -adjusted_mode->crtc_hdisplay, -adjusted_mode->crtc_vdisplay, NULL, need_scaler); +pipe_mode->crtc_hdisplay, +pipe_mode->crtc_vdisplay, NULL, need_scaler); } /** @@ -6480,7 +6480,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config, if (intel_crtc_has_dp_encoder(pipe_config)) intel_dp_set_m_n(pipe_config, M1_N1); - intel_set_pipe_timings(pipe_config); + intel_set_transcoder_timings(pipe_config); intel_set_pipe_src_size(pipe_config); if (pipe_config->has_pch_encoder) { @@ -6607,7 +6607,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config, intel_dp_set_m_n(pipe_config, M1_N1); if (!transcoder_is_dsi(cpu_transcoder)) - intel_set_pipe_timings(pipe_config); + intel_set_transcoder_timings(pipe_config); if (INTEL_GEN(dev_priv) >= 11) icl_enable_trans_port_sync(pipe_config); @@ -7015,7 +7015,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config, if (intel_crtc_has_dp_encoder(pipe_config)) intel_dp_set_m_n(pipe_config, M1_N1); - intel_set_pipe_timings(pipe_config); + intel_set_transcoder_timings(pipe_config); intel_set_pipe_src_size(pipe_config); if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) { @@ -7083,7 +7083,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config, if (intel_crtc_has_dp_encoder(pipe_config)) intel_dp_set_m_n(pipe_config, M1_N1); - intel_set_pipe_timings(pipe_config); + intel_set_transcoder_timings(pipe_config); intel_set_pipe_src_size(pipe_config); i9xx_set_pipeconf(pipe_config); @@ -7528,7 +7528,7 @@ static u32 ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config) { u32 pixel_rate; - pixel_rate = pipe_config->hw.adjusted_mode.crtc_clock; + pixel_rate = pipe_config->hw.pipe_mode.crtc_clock; /* * We only use IF-ID interlacing. If we ever use @@ -7566,7 +7566,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state) if (HAS_GMCH(dev_priv)) /* FIXME calculate proper pipe pixel rate for GMCH pfit */ crtc_state->pixel_rate = - crtc_state->hw.adjusted_mode.crtc_clock; + crtc_state->hw.pipe_mode.crtc_clock; else crtc_state->pixel_rate = ilk_pipe_pixel_rate(crtc_state); @@ -7576,7 +7576,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); - const struct drm_display_mode *adjusted_mode =
[Intel-gfx] [PATCH 09/11] drm/i915: Add bigjoiner aware plane clipping checks
We need to look at hw.fb for the framebuffer, and add the translation for the slave_plane_state. With these changes we set the correct rectangle on the bigjoiner slave, and don't set incorrect src/dst/visibility on the slave plane. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 60 +++ .../gpu/drm/i915/display/intel_atomic_plane.h | 4 ++ drivers/gpu/drm/i915/display/intel_display.c | 19 +++--- drivers/gpu/drm/i915/display/intel_sprite.c | 21 +++ 4 files changed, 80 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index b26e10519ca4..c516f8097945 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -211,6 +211,9 @@ void intel_plane_copy_uapi_to_hw_state(const struct intel_crtc_state *crtc_state plane_state->hw.rotation = from_plane_state->uapi.rotation; plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; plane_state->hw.color_range = from_plane_state->uapi.color_range; + + plane_state->uapi.src = drm_plane_state_src(&from_plane_state->uapi); + plane_state->uapi.dst = drm_plane_state_dest(&from_plane_state->uapi); } int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state, @@ -448,6 +451,63 @@ void i9xx_update_planes_on_crtc(struct intel_atomic_state *state, } } +int intel_atomic_plane_check_clipping(struct intel_plane_state *plane_state, + struct intel_crtc_state *crtc_state, + int min_scale, int max_scale, + bool can_position) +{ + struct drm_framebuffer *fb = plane_state->hw.fb; + struct drm_rect *src = &plane_state->uapi.src; + struct drm_rect *dst = &plane_state->uapi.dst; + unsigned int rotation = plane_state->uapi.rotation; + struct drm_rect clip = {}; + int hscale, vscale; + + if (!fb) { + plane_state->uapi.visible = false; + return 0; + } + + drm_rect_rotate(src, fb->width << 16, fb->height << 16, rotation); + + /* Check scaling */ + hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale); + vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale); + if (hscale < 0 || vscale < 0) { + DRM_DEBUG_KMS("Invalid scaling of plane\n"); + drm_rect_debug_print("src: ", src, true); + drm_rect_debug_print("dst: ", dst, false); + return -ERANGE; + } + + if (crtc_state->hw.enable) { + clip.x2 = crtc_state->pipe_src_w; + clip.y2 = crtc_state->pipe_src_h; + } + + /* right side of the image is on the slave crtc, adjust dst to match */ + if (crtc_state->bigjoiner_slave) + drm_rect_translate(dst, -crtc_state->pipe_src_w, 0); + + /* +* FIXME: This might need further adjustment for seamless scaling +* with phase information, for the 2p2 and 2p1 scenarios. +*/ + plane_state->uapi.visible = drm_rect_clip_scaled(src, dst, &clip); + + drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation); + + if (!can_position && plane_state->uapi.visible && + !drm_rect_equals(dst, &clip)) { + DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); + drm_rect_debug_print("dst: ", dst, false); + drm_rect_debug_print("clip: ", &clip, false); + return -EINVAL; + } + + return 0; +} + const struct drm_plane_helper_funcs intel_plane_helper_funcs = { .prepare_fb = intel_prepare_plane_fb, .cleanup_fb = intel_cleanup_plane_fb, diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index 3129faa30eb6..26838d368cb4 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -49,5 +49,9 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_stat struct intel_plane_state *plane_state); bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, struct intel_plane *plane); +int intel_atomic_plane_check_clipping(struct intel_plane_state *plane_state, + struct intel_crtc_state *crtc_state, + int min_scale, int max_scale, + bool can_position); #endif /* __INTEL_ATOMIC_PLANE_H__ */ diff -
[Intel-gfx] [PATCH 05/11] drm/i915: Try to make bigjoiner work in atomic check, v3.
When the clock is higher than the dotclock, try with 2 pipes enabled. If we can enable 2, then we will go into big joiner mode, and steal the adjacent crtc. This only links the crtc's in software, no hardware or plane programming is done yet. Blobs are also copied from the master's crtc_state, so it doesn't depend at commit time on the other crtc_state. Changes since v1: - Rename pipe timings to transcoder timings, as they are now different. Changes since v2: - Rework bigjoiner checks; always disable slave when recalculating master. No need to have a separate bigjoiner pass any more. - Use pipe_mode instead of transcoder_mode, to clean up the code. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 9 +- drivers/gpu/drm/i915/display/intel_atomic.h | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 198 -- .../drm/i915/display/intel_display_types.h| 9 + drivers/gpu/drm/i915/display/intel_dp.c | 22 +- 5 files changed, 207 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index fd0026fc3618..b5c17d8c0208 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -229,14 +229,15 @@ void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) intel_crtc_put_color_blobs(crtc_state); } -void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) { drm_property_replace_blob(&crtc_state->hw.degamma_lut, - crtc_state->uapi.degamma_lut); + from_crtc_state->uapi.degamma_lut); drm_property_replace_blob(&crtc_state->hw.gamma_lut, - crtc_state->uapi.gamma_lut); + from_crtc_state->uapi.gamma_lut); drm_property_replace_blob(&crtc_state->hw.ctm, - crtc_state->uapi.ctm); + from_crtc_state->uapi.ctm); } /** diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h b/drivers/gpu/drm/i915/display/intel_atomic.h index 7b49623419ba..e64473227285 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.h +++ b/drivers/gpu/drm/i915/display/intel_atomic.h @@ -37,7 +37,8 @@ struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc); void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state); void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); -void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state); +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state); struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); void intel_atomic_state_clear(struct drm_atomic_state *state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7a6da85823af..2dc63ef5caf8 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7576,9 +7576,25 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); - const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; + struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; int clock_limit = dev_priv->max_dotclk_freq; + *pipe_mode = pipe_config->hw.adjusted_mode; + + /* Adjust pipe_mode for bigjoiner, with half the horizontal mode */ + if (pipe_config->bigjoiner) { + pipe_mode->crtc_clock /= 2; + pipe_mode->crtc_hdisplay /= 2; + pipe_mode->crtc_hblank_start /= 2; + pipe_mode->crtc_hblank_end /= 2; + pipe_mode->crtc_hsync_start /= 2; + pipe_mode->crtc_hsync_end /= 2; + pipe_mode->crtc_htotal /= 2; + pipe_mode->crtc_hskew /= 2; + + pipe_config->pipe_src_w /= 2; + } + if (INTEL_GEN(dev_priv) < 4) { clock_limit = dev_priv->max_cdclk_freq * 9 / 10; @@ -7635,7 +7651,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, * WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN(dev_priv) > 4 || IS_G4X(dev_priv)) && - pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay) + pipe_config->hw
[Intel-gfx] [PATCH 01/11] HAX to make DSC work on the icelake test system
DSC is available on the display emulator, but not set in DPCD. Override the entries to allow bigjoiner testing. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/drm_dp_helper.c | 4 ++-- include/drm/drm_dp_helper.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 2c7870aef469..3d6038f35ea2 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1261,7 +1261,7 @@ u8 drm_dp_dsc_sink_max_slice_count(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE], if (slice_cap1 & DP_DSC_4_PER_DP_DSC_SINK) return 4; if (slice_cap1 & DP_DSC_2_PER_DP_DSC_SINK) - return 2; + return 4; if (slice_cap1 & DP_DSC_1_PER_DP_DSC_SINK) return 1; } else { @@ -1285,7 +1285,7 @@ u8 drm_dp_dsc_sink_max_slice_count(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE], if (slice_cap1 & DP_DSC_4_PER_DP_DSC_SINK) return 4; if (slice_cap1 & DP_DSC_2_PER_DP_DSC_SINK) - return 2; + return 4; if (slice_cap1 & DP_DSC_1_PER_DP_DSC_SINK) return 1; } diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 51ecb5112ef8..2ebd7feffd90 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1270,6 +1270,7 @@ int drm_dp_dsc_sink_supported_input_bpcs(const u8 dsc_dpc[DP_DSC_RECEIVER_CAP_SI static inline bool drm_dp_sink_supports_dsc(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE]) { + return dsc_dpcd[DP_DSC_REV - DP_DSC_SUPPORT]; return dsc_dpcd[DP_DSC_SUPPORT - DP_DSC_SUPPORT] & DP_DSC_DECOMPRESSION_IS_SUPPORTED; } -- 2.24.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 07/11] drm/i915: Make hardware readout work on i915.
Unfortunately I have no way to test this, but it should be correct if the bios sets up bigjoiner in a sane way. Skip iterating over bigjoiner slaves, only the master has the state we care about. Add the width of the bigjoiner slave to the reconstructed fb. Hide the bigjoiner slave to userspace, and double the mode on bigjoiner master. And last, disable bigjoiner slave from primary if reconstruction fails. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 65 +++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 94e4cab00a66..b1085ef3f1d0 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -3231,6 +3231,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, struct intel_plane *intel_plane = to_intel_plane(primary); struct intel_plane_state *intel_state = to_intel_plane_state(plane_state); + struct intel_crtc_state *crtc_state = + to_intel_crtc_state(intel_crtc->base.state); struct drm_framebuffer *fb; if (!plane_config->fb) @@ -3253,7 +3255,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, if (c == &intel_crtc->base) continue; - if (!to_intel_crtc(c)->active) + if (!to_intel_crtc_state(c->state)->uapi.active) continue; state = to_intel_plane_state(c->primary->state); @@ -3275,6 +3277,12 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, * pretend the BIOS never had it enabled. */ intel_plane_disable_noatomic(intel_crtc, intel_plane); + if (crtc_state->bigjoiner) { + struct intel_crtc *slave = + crtc_state->bigjoiner_linked_crtc; + + intel_plane_disable_noatomic(slave, to_intel_plane(slave->base.primary)); + } return; @@ -10078,6 +10086,7 @@ static void skylake_get_initial_plane_config(struct intel_crtc *crtc, struct intel_initial_plane_config *plane_config) { + struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); struct drm_device *dev = crtc->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_plane *plane = to_intel_plane(crtc->base.primary); @@ -10181,6 +10190,18 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, fb->height = ((val >> 16) & 0x) + 1; fb->width = ((val >> 0) & 0x) + 1; + /* add bigjoiner slave as well, if the fb stretches both */ + if (crtc_state->bigjoiner) { + enum pipe bigjoiner_pipe = crtc_state->bigjoiner_linked_crtc->pipe; + + if (fb->width == crtc_state->pipe_src_w && + (I915_READ(PLANE_SURF(bigjoiner_pipe, plane_id)) & 0xf000) == plane_config->base) { + val = I915_READ(PLANE_SIZE(crtc_state->bigjoiner_linked_crtc->pipe, plane_id)); + fb->height += ((val >> 16) & 0xfff) + 1; + fb->width += ((val >> 0) & 0x1fff) + 1; + } + } + val = I915_READ(PLANE_STRIDE(pipe, plane_id)); stride_mult = skl_plane_stride_mult(fb, 0, DRM_MODE_ROTATE_0); fb->pitches[0] = (val & 0x3ff) * stride_mult; @@ -17535,7 +17556,8 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc, /* Adjust the state of the output pipe according to whether we * have active connectors/encoders. */ - if (crtc_state->hw.active && !intel_crtc_has_encoders(crtc)) + if (crtc_state->hw.active && !intel_crtc_has_encoders(crtc) && + !crtc_state->bigjoiner_slave) intel_crtc_disable_noatomic(&crtc->base, ctx); if (crtc_state->hw.active || HAS_GMCH(dev_priv)) { @@ -17825,6 +17847,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) struct intel_plane *plane; int min_cdclk = 0; + if (crtc_state->bigjoiner_slave) + continue; + if (crtc_state->hw.active) { struct drm_display_mode mode; @@ -17849,6 +17874,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) mode.hdisplay = crtc_state->pipe_src_w; mode.vdisplay = crtc_state->pipe_src_h; + if (crtc_state->bigjoiner) + mode.hdisplay *= 2; + intel_crtc_compute_pixel_rate(crtc_state);
[Intel-gfx] [PATCH 06/11] drm/i915: Enable big joiner support in enable and disable sequences.
Make vdsc work when no output is enabled. The big joiner needs VDSC on the slave, so enable it and set the appropriate bits. Also update timestamping constants, because slave crtc's are not updated in drm_atomic_helper_update_legacy_modeset_state(). This should be enough to bring up CRTC's in a big joiner configuration, without any plane configuration on the second pipe yet. HOWEVER, we still bring up the crtc's in the wrong order. We need to make sure that the master crtc is brought up after the slave crtc. This is done correctly later in this series. The next steps are to enable planes correctly, and make sure we enable and update both master and slave in the correct order. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_ddi.c | 48 ++- drivers/gpu/drm/i915/display/intel_display.c | 399 -- .../drm/i915/display/intel_display_types.h| 22 + drivers/gpu/drm/i915/display/intel_dp.c | 21 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 122 -- drivers/gpu/drm/i915/display/intel_vdsc.h | 2 + 6 files changed, 408 insertions(+), 206 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 8f817de34460..1215f619da36 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -2218,13 +2218,6 @@ static void intel_ddi_get_power_domains(struct intel_encoder *encoder, intel_phy_is_tc(dev_priv, phy)) intel_display_power_get(dev_priv, intel_ddi_main_link_aux_domain(dig_port)); - - /* -* VDSC power is needed when DSC is enabled -*/ - if (crtc_state->dsc.compression_enable) - intel_display_power_get(dev_priv, - intel_dsc_power_domain(crtc_state)); } void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state) @@ -3557,7 +3550,8 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder, /* 7.l Configure and enable FEC if needed */ intel_ddi_enable_fec(encoder, crtc_state); - intel_dsc_enable(encoder, crtc_state); + if (!crtc_state->bigjoiner) + intel_dsc_enable(encoder, crtc_state); } static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder, @@ -3629,7 +3623,8 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder, if (!is_mst) intel_ddi_enable_pipe_clock(crtc_state); - intel_dsc_enable(encoder, crtc_state); + if (!crtc_state->bigjoiner) + intel_dsc_enable(encoder, crtc_state); } static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder, @@ -4252,19 +4247,18 @@ void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv, crtc_state->min_voltage_level = 2; } -void intel_ddi_get_config(struct intel_encoder *encoder, - struct intel_crtc_state *pipe_config) +static void intel_ddi_read_func_ctl(struct intel_encoder *encoder, + struct intel_crtc_state *pipe_config) { struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc); enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; u32 temp, flags = 0; - /* XXX: DSI transcoder paranoia */ - if (WARN_ON(transcoder_is_dsi(cpu_transcoder))) + temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder)); + if (!(temp & TRANS_DDI_FUNC_ENABLE)) return; - temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder)); if (temp & TRANS_DDI_PHSYNC) flags |= DRM_MODE_FLAG_PHSYNC; else @@ -4350,6 +4344,29 @@ void intel_ddi_get_config(struct intel_encoder *encoder, default: break; } +} + +void intel_ddi_get_config(struct intel_encoder *encoder, + struct intel_crtc_state *pipe_config) +{ + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; + + /* XXX: DSI transcoder paranoia */ + if (WARN_ON(transcoder_is_dsi(cpu_transcoder))) + return; + + intel_ddi_read_func_ctl(encoder, pipe_config); + if (pipe_config->bigjoiner_slave) { + /* read out pipe settings from master */ + enum transcoder save = pipe_config->cpu_transcoder; + +/* Our own transcoder needs to be disabled when reading it in intel_ddi_read_func_ctl() */ + WARN_ON(pipe_config->output_types); + pipe_config->cpu_transcoder = (enum transcoder)pipe_config->bigjoiner_linked_crtc->pipe; + intel_ddi_read_func_ctl(encoder, pipe_config); +
Re: [Intel-gfx] [PULL] topic/drm-mipi-dsi-dsc-updates
Op 14-11-2019 om 15:35 schreef Jani Nikula: > On Mon, 11 Nov 2019, Jani Nikula wrote: >> Hi Sean, Maarten and Maxime - >> >> Here's the topic branch about DSI changes as I wrote in [1]. Once you've >> pulled this in drm-misc, I'll follow suit in i915. > Ping. > > FWIW Daniel acked the approach on IRC. > > BR, > Jani. > > Pushed, thanks. :) ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 2/3] dma-resv: Also prime acquire ctx for lockdep
Op 20-11-2019 om 12:30 schreef Christian König: > Am 19.11.19 um 22:08 schrieb Daniel Vetter: >> Semnatically it really doesn't matter where we grab the ticket. But >> since the ticket is a fake lockdep lock, it matters for lockdep >> validation purposes. >> >> This means stuff like grabbing a ticket and then doing >> copy_from/to_user isn't allowed anymore. This is a changed compared to >> the current ttm fault handler, which doesn't bother with having a full >> reservation. Since I'm looking into fixing the TODO entry in >> ttm_mem_evict_wait_busy() I think that'll have to change sooner or >> later anyway, better get started. A bit more context on why I'm >> looking into this: For backwards compat with existing i915 gem code I >> think we'll have to do full slowpath locking in the i915 equivalent of >> the eviction code. And with dynamic dma-buf that will leak across >> drivers, so another thing we need to standardize and make sure it's >> done the same way everyway. >> >> Unfortunately this means another full audit of all drivers: >> >> - gem helpers: acquire_init is done right before taking locks, so no >> problem. Same for acquire_fini and unlocking, which means nothing >> that's not already covered by the dma_resv_lock rules will be caught >> with this extension here to the acquire_ctx. >> >> - etnaviv: An absolute massive amount of code is run between the >> acquire_init and the first lock acquisition in submit_lock_objects. >> But nothing that would touch user memory and could cause a fault. >> Furthermore nothing that uses the ticket, so even if I missed >> something, it would be easy to fix by pushing the acquire_init right >> before the first use. Similar on the unlock/acquire_fini side. >> >> - i915: Right now (and this will likely change a lot rsn) the acquire >> ctx and actual locks are right next to each another. No problem. >> >> - msm has a problem: submit_create calls acquire_init, but then >> submit_lookup_objects() has a bunch of copy_from_user to do the >> object lookups. That's the only thing before submit_lock_objects >> call dma_resv_lock(). Despite all the copypasta to etnaviv, etnaviv >> does not have this issue since it copies all the userspace structs >> earlier. submit_cleanup does not have any such issues. >> >> With the prep patch to pull out the acquire_ctx and reorder it msm >> is going to be safe too. >> >> - nouveau: acquire_init is right next to ttm_bo_reserve, so all good. >> Similar on the acquire_fini/ttm_bo_unreserve side. >> >> - ttm execbuf utils: acquire context and locking are even in the same >> functions here (one function to reserve everything, the other to >> unreserve), so all good. >> >> - vc4: Another case where acquire context and locking are handled in >> the same functions (one function to lock everything, the other to >> unlock). >> >> Cc: Maarten Lankhorst >> Cc: Chris Wilson >> Cc: Christian König >> Cc: Sumit Semwal >> Cc: linux-me...@vger.kernel.org >> Cc: linaro-mm-...@lists.linaro.org >> Cc: Huang Rui >> Cc: Eric Anholt >> Cc: Ben Skeggs >> Cc: Alex Deucher >> Cc: Rob Herring >> Cc: Lucas Stach >> Cc: Russell King >> Cc: Christian Gmeiner >> Cc: Rob Clark >> Cc: Sean Paul >> Signed-off-by: Daniel Vetter > > Acked-by: Christian König > >> --- >> drivers/dma-buf/dma-resv.c | 8 +++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c >> index d3c760e19991..079e38fde33a 100644 >> --- a/drivers/dma-buf/dma-resv.c >> +++ b/drivers/dma-buf/dma-resv.c >> @@ -100,7 +100,9 @@ static void dma_resv_list_free(struct dma_resv_list >> *list) >> static void __init dma_resv_lockdep(void) >> { >> struct mm_struct *mm = mm_alloc(); >> + struct ww_acquire_ctx ctx; >> struct dma_resv obj; >> + int ret; >> if (!mm) >> return; >> @@ -108,10 +110,14 @@ static void __init dma_resv_lockdep(void) >> dma_resv_init(&obj); >> down_read(&mm->mmap_sem); >> - ww_mutex_lock(&obj.lock, NULL); >> + ww_acquire_init(&ctx, &reservation_ww_class); >> + ret = dma_resv_lock(&obj, &ctx); >> + if (ret == -EDEADLK) >> + dma_resv_lock_slow(&obj, &ctx); >> fs_reclaim_acquire(GFP_KERNEL); >> fs_reclaim_release(GFP_KERNEL); >> ww_mutex_unlock(&obj.lock); >> + ww_acquire_fini(&ctx); >> up_read(&mm->mmap_sem); >> >> mmput(mm); > For whole series: Reviewed-by: Maarten Lankhorst typo in patch 3 btw :) ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v2 14/14] drm/i915/fbc: Reallocate cfb if we need more of it
Op 27-11-2019 om 21:12 schreef Ville Syrjala: > From: Ville Syrjälä > > The code assumes we can omit the cfb allocation once fbc > has been enabled once. That's nonsense. Let's try to > reallocate it if we need to. > > The code is still a mess, but maybe this is enough to get > fbc going in some cases where it initially underallocates > the cfb and there's no full modeset to fix it up. > > Cc: Daniel Drake > Cc: Paulo Zanoni > Cc: Jian-Hong Pan > Cc: Maarten Lankhorst > Signed-off-by: Ville Syrjälä > --- > drivers/gpu/drm/i915/display/intel_fbc.c | 22 +++--- > 1 file changed, 15 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c > b/drivers/gpu/drm/i915/display/intel_fbc.c > index c976698b0729..928059a5da80 100644 > --- a/drivers/gpu/drm/i915/display/intel_fbc.c > +++ b/drivers/gpu/drm/i915/display/intel_fbc.c > @@ -672,6 +672,14 @@ static void intel_fbc_update_state_cache(struct > intel_crtc *crtc, > cache->fence_id = -1; > } > > +static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv) > +{ > + struct intel_fbc *fbc = &dev_priv->fbc; > + > + return intel_fbc_calculate_cfb_size(dev_priv, &fbc->state_cache) > > + fbc->compressed_fb.size * fbc->threshold; > +} > + > static bool intel_fbc_can_activate(struct intel_crtc *crtc) > { > struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); > @@ -757,8 +765,7 @@ static bool intel_fbc_can_activate(struct intel_crtc > *crtc) >* we didn't get any invalidate/deactivate calls, but this would require >* a lot of tracking just for a specific case. If we conclude it's an >* important case, we can implement it later. */ > - if (intel_fbc_calculate_cfb_size(dev_priv, &fbc->state_cache) > > - fbc->compressed_fb.size * fbc->threshold) { > + if (intel_fbc_cfb_size_changed(dev_priv)) { > fbc->no_fbc_reason = "CFB requirements changed"; > return false; > } > @@ -1112,12 +1119,12 @@ void intel_fbc_enable(struct intel_crtc *crtc, > mutex_lock(&fbc->lock); > > if (fbc->crtc) { > - WARN_ON(fbc->crtc == crtc && !crtc_state->enable_fbc); > - goto out; > - } > + if (fbc->crtc != crtc || > + !intel_fbc_cfb_size_changed(dev_priv)) > + goto out; > > - if (!crtc_state->enable_fbc) > - goto out; > + __intel_fbc_disable(dev_priv); > + } > > WARN_ON(fbc->active); > > @@ -1130,6 +1137,7 @@ void intel_fbc_enable(struct intel_crtc *crtc, > if (intel_fbc_alloc_cfb(dev_priv, > intel_fbc_calculate_cfb_size(dev_priv, cache), > fb->format->cpp[0])) { > + cache->plane.visible = false; > fbc->no_fbc_reason = "not enough stolen memory"; > goto out; > } Makes sense, unfortunately kms_cursor_legacy starts failing on this series. :( For 1-11, 14 Reviewed-by: Maarten Lankhorst We should probably get rid of the FBC disable on frontbuffer disable as well. I had some patches but nothing upstream-worthy yet. :( 12 and 13 need more thought for now, kms_cursor_legacy is failing. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v2 14/14] drm/i915/fbc: Reallocate cfb if we need more of it
Op 28-11-2019 om 16:59 schreef Ville Syrjälä: > On Thu, Nov 28, 2019 at 04:48:04PM +0100, Maarten Lankhorst wrote: >> Op 27-11-2019 om 21:12 schreef Ville Syrjala: >>> From: Ville Syrjälä >>> >>> The code assumes we can omit the cfb allocation once fbc >>> has been enabled once. That's nonsense. Let's try to >>> reallocate it if we need to. >>> >>> The code is still a mess, but maybe this is enough to get >>> fbc going in some cases where it initially underallocates >>> the cfb and there's no full modeset to fix it up. >>> >>> Cc: Daniel Drake >>> Cc: Paulo Zanoni >>> Cc: Jian-Hong Pan >>> Cc: Maarten Lankhorst >>> Signed-off-by: Ville Syrjälä >>> --- >>> drivers/gpu/drm/i915/display/intel_fbc.c | 22 +++--- >>> 1 file changed, 15 insertions(+), 7 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c >>> b/drivers/gpu/drm/i915/display/intel_fbc.c >>> index c976698b0729..928059a5da80 100644 >>> --- a/drivers/gpu/drm/i915/display/intel_fbc.c >>> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c >>> @@ -672,6 +672,14 @@ static void intel_fbc_update_state_cache(struct >>> intel_crtc *crtc, >>> cache->fence_id = -1; >>> } >>> >>> +static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv) >>> +{ >>> + struct intel_fbc *fbc = &dev_priv->fbc; >>> + >>> + return intel_fbc_calculate_cfb_size(dev_priv, &fbc->state_cache) > >>> + fbc->compressed_fb.size * fbc->threshold; >>> +} >>> + >>> static bool intel_fbc_can_activate(struct intel_crtc *crtc) >>> { >>> struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); >>> @@ -757,8 +765,7 @@ static bool intel_fbc_can_activate(struct intel_crtc >>> *crtc) >>> * we didn't get any invalidate/deactivate calls, but this would require >>> * a lot of tracking just for a specific case. If we conclude it's an >>> * important case, we can implement it later. */ >>> - if (intel_fbc_calculate_cfb_size(dev_priv, &fbc->state_cache) > >>> - fbc->compressed_fb.size * fbc->threshold) { >>> + if (intel_fbc_cfb_size_changed(dev_priv)) { >>> fbc->no_fbc_reason = "CFB requirements changed"; >>> return false; >>> } >>> @@ -1112,12 +1119,12 @@ void intel_fbc_enable(struct intel_crtc *crtc, >>> mutex_lock(&fbc->lock); >>> >>> if (fbc->crtc) { >>> - WARN_ON(fbc->crtc == crtc && !crtc_state->enable_fbc); >>> - goto out; >>> - } >>> + if (fbc->crtc != crtc || >>> + !intel_fbc_cfb_size_changed(dev_priv)) >>> + goto out; >>> >>> - if (!crtc_state->enable_fbc) >>> - goto out; >>> + __intel_fbc_disable(dev_priv); >>> + } >>> >>> WARN_ON(fbc->active); >>> >>> @@ -1130,6 +1137,7 @@ void intel_fbc_enable(struct intel_crtc *crtc, >>> if (intel_fbc_alloc_cfb(dev_priv, >>> intel_fbc_calculate_cfb_size(dev_priv, cache), >>> fb->format->cpp[0])) { >>> + cache->plane.visible = false; >>> fbc->no_fbc_reason = "not enough stolen memory"; >>> goto out; >>> } >> Makes sense, unfortunately kms_cursor_legacy starts failing on this series. >> :( >> >> For 1-11, 14 >> >> Reviewed-by: Maarten Lankhorst >> >> We should probably get rid of the FBC disable on frontbuffer disable as >> well. I had some patches but nothing upstream-worthy yet. :( > How would we get rid of the disable there? By triggering nukes at some > predefined interval? Doesn't sound all that great. Not touching FBC on frontbuffer write at all, and forcing userspace to use the dirtyfb api. I think the whole implicit tracking should be removed. > >> 12 and 13 need more thought for now, kms_cursor_legacy is failing. > Already posted the v2 that fixes it. > > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v2 14/14] drm/i915/fbc: Reallocate cfb if we need more of it
Op 29-11-2019 om 12:37 schreef Ville Syrjälä: > On Fri, Nov 29, 2019 at 09:48:45AM +0100, Maarten Lankhorst wrote: >> Op 28-11-2019 om 16:59 schreef Ville Syrjälä: >>> On Thu, Nov 28, 2019 at 04:48:04PM +0100, Maarten Lankhorst wrote: >>>> Op 27-11-2019 om 21:12 schreef Ville Syrjala: >>>>> From: Ville Syrjälä >>>>> >>>>> The code assumes we can omit the cfb allocation once fbc >>>>> has been enabled once. That's nonsense. Let's try to >>>>> reallocate it if we need to. >>>>> >>>>> The code is still a mess, but maybe this is enough to get >>>>> fbc going in some cases where it initially underallocates >>>>> the cfb and there's no full modeset to fix it up. >>>>> >>>>> Cc: Daniel Drake >>>>> Cc: Paulo Zanoni >>>>> Cc: Jian-Hong Pan >>>>> Cc: Maarten Lankhorst >>>>> Signed-off-by: Ville Syrjälä >>>>> --- >>>>> drivers/gpu/drm/i915/display/intel_fbc.c | 22 +++--- >>>>> 1 file changed, 15 insertions(+), 7 deletions(-) >>>>> >>>>> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c >>>>> b/drivers/gpu/drm/i915/display/intel_fbc.c >>>>> index c976698b0729..928059a5da80 100644 >>>>> --- a/drivers/gpu/drm/i915/display/intel_fbc.c >>>>> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c >>>>> @@ -672,6 +672,14 @@ static void intel_fbc_update_state_cache(struct >>>>> intel_crtc *crtc, >>>>> cache->fence_id = -1; >>>>> } >>>>> >>>>> +static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv) >>>>> +{ >>>>> + struct intel_fbc *fbc = &dev_priv->fbc; >>>>> + >>>>> + return intel_fbc_calculate_cfb_size(dev_priv, &fbc->state_cache) > >>>>> + fbc->compressed_fb.size * fbc->threshold; >>>>> +} >>>>> + >>>>> static bool intel_fbc_can_activate(struct intel_crtc *crtc) >>>>> { >>>>> struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); >>>>> @@ -757,8 +765,7 @@ static bool intel_fbc_can_activate(struct intel_crtc >>>>> *crtc) >>>>>* we didn't get any invalidate/deactivate calls, but this would require >>>>>* a lot of tracking just for a specific case. If we conclude it's an >>>>>* important case, we can implement it later. */ >>>>> - if (intel_fbc_calculate_cfb_size(dev_priv, &fbc->state_cache) > >>>>> - fbc->compressed_fb.size * fbc->threshold) { >>>>> + if (intel_fbc_cfb_size_changed(dev_priv)) { >>>>> fbc->no_fbc_reason = "CFB requirements changed"; >>>>> return false; >>>>> } >>>>> @@ -1112,12 +1119,12 @@ void intel_fbc_enable(struct intel_crtc *crtc, >>>>> mutex_lock(&fbc->lock); >>>>> >>>>> if (fbc->crtc) { >>>>> - WARN_ON(fbc->crtc == crtc && !crtc_state->enable_fbc); >>>>> - goto out; >>>>> - } >>>>> + if (fbc->crtc != crtc || >>>>> + !intel_fbc_cfb_size_changed(dev_priv)) >>>>> + goto out; >>>>> >>>>> - if (!crtc_state->enable_fbc) >>>>> - goto out; >>>>> + __intel_fbc_disable(dev_priv); >>>>> + } >>>>> >>>>> WARN_ON(fbc->active); >>>>> >>>>> @@ -1130,6 +1137,7 @@ void intel_fbc_enable(struct intel_crtc *crtc, >>>>> if (intel_fbc_alloc_cfb(dev_priv, >>>>> intel_fbc_calculate_cfb_size(dev_priv, cache), >>>>> fb->format->cpp[0])) { >>>>> + cache->plane.visible = false; >>>>> fbc->no_fbc_reason = "not enough stolen memory"; >>>>> goto out; >>>>> } >>>> Makes sense, unfortunately kms_cursor_legacy starts failing on this >>>> series. :( >>>> >>>> For 1-11, 14 >>>> >>>> Reviewed-by: Maarten Lankhorst >>>> >>>> We should probably get rid of the FBC disable on
Re: [Intel-gfx] [PATCH 06/11] drm/i915: Enable big joiner support in enable and disable sequences.
Op 28-11-2019 om 20:43 schreef Ville Syrjälä: > On Thu, Nov 14, 2019 at 05:05:17PM +0100, Maarten Lankhorst wrote: >> Make vdsc work when no output is enabled. The big joiner needs VDSC >> on the slave, so enable it and set the appropriate bits. >> Also update timestamping constants, because slave crtc's are not >> updated in drm_atomic_helper_update_legacy_modeset_state(). >> >> This should be enough to bring up CRTC's in a big joiner configuration, >> without any plane configuration on the second pipe yet. >> >> HOWEVER, we still bring up the crtc's in the wrong order. We need to >> make sure that the master crtc is brought up after the slave crtc. >> This is done correctly later in this series. >> >> The next steps are to enable planes correctly, and make sure we enable >> and update both master and slave in the correct order. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_ddi.c | 48 ++- >> drivers/gpu/drm/i915/display/intel_display.c | 399 -- >> .../drm/i915/display/intel_display_types.h| 22 + >> drivers/gpu/drm/i915/display/intel_dp.c | 21 +- >> drivers/gpu/drm/i915/display/intel_vdsc.c | 122 -- >> drivers/gpu/drm/i915/display/intel_vdsc.h | 2 + >> 6 files changed, 408 insertions(+), 206 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c >> b/drivers/gpu/drm/i915/display/intel_ddi.c >> index 8f817de34460..1215f619da36 100644 >> --- a/drivers/gpu/drm/i915/display/intel_ddi.c >> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c >> @@ -2218,13 +2218,6 @@ static void intel_ddi_get_power_domains(struct >> intel_encoder *encoder, >> intel_phy_is_tc(dev_priv, phy)) >> intel_display_power_get(dev_priv, >> >> intel_ddi_main_link_aux_domain(dig_port)); >> - >> -/* >> - * VDSC power is needed when DSC is enabled >> - */ >> -if (crtc_state->dsc.compression_enable) >> -intel_display_power_get(dev_priv, >> -intel_dsc_power_domain(crtc_state)); >> } >> >> void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state) >> @@ -3557,7 +3550,8 @@ static void tgl_ddi_pre_enable_dp(struct intel_encoder >> *encoder, >> >> /* 7.l Configure and enable FEC if needed */ >> intel_ddi_enable_fec(encoder, crtc_state); >> -intel_dsc_enable(encoder, crtc_state); >> +if (!crtc_state->bigjoiner) >> +intel_dsc_enable(encoder, crtc_state); >> } >> >> static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder, >> @@ -3629,7 +3623,8 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder >> *encoder, >> if (!is_mst) >> intel_ddi_enable_pipe_clock(crtc_state); >> >> -intel_dsc_enable(encoder, crtc_state); >> +if (!crtc_state->bigjoiner) >> +intel_dsc_enable(encoder, crtc_state); >> } >> >> static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder, >> @@ -4252,19 +4247,18 @@ void intel_ddi_compute_min_voltage_level(struct >> drm_i915_private *dev_priv, >> crtc_state->min_voltage_level = 2; >> } >> >> -void intel_ddi_get_config(struct intel_encoder *encoder, >> - struct intel_crtc_state *pipe_config) >> +static void intel_ddi_read_func_ctl(struct intel_encoder *encoder, >> +struct intel_crtc_state *pipe_config) >> { >> struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); >> struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc); >> enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; >> u32 temp, flags = 0; >> >> -/* XXX: DSI transcoder paranoia */ >> -if (WARN_ON(transcoder_is_dsi(cpu_transcoder))) >> +temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder)); >> +if (!(temp & TRANS_DDI_FUNC_ENABLE)) >> return; >> >> -temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder)); >> if (temp & TRANS_DDI_PHSYNC) >> flags |= DRM_MODE_FLAG_PHSYNC; >> else >> @@ -4350,6 +4344,29 @@ void intel_ddi_get_config(struct intel_encoder >> *encoder, >> default: >> break; >> } >> +} >> + >> +void intel_ddi_get_config(struct intel_encoder *encoder, >> +
Re: [Intel-gfx] [PATCH 05/11] drm/i915: Try to make bigjoiner work in atomic check, v3.
Op 28-11-2019 om 20:24 schreef Ville Syrjälä: > On Thu, Nov 14, 2019 at 05:05:16PM +0100, Maarten Lankhorst wrote: >> When the clock is higher than the dotclock, try with 2 pipes enabled. >> If we can enable 2, then we will go into big joiner mode, and steal >> the adjacent crtc. >> >> This only links the crtc's in software, no hardware or plane >> programming is done yet. Blobs are also copied from the master's >> crtc_state, so it doesn't depend at commit time on the other >> crtc_state. >> >> Changes since v1: >> - Rename pipe timings to transcoder timings, as they are now different. >> Changes since v2: >> - Rework bigjoiner checks; always disable slave when recalculating >> master. No need to have a separate bigjoiner pass any more. >> - Use pipe_mode instead of transcoder_mode, to clean up the code. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_atomic.c | 9 +- >> drivers/gpu/drm/i915/display/intel_atomic.h | 3 +- >> drivers/gpu/drm/i915/display/intel_display.c | 198 -- >> .../drm/i915/display/intel_display_types.h| 9 + >> drivers/gpu/drm/i915/display/intel_dp.c | 22 +- >> 5 files changed, 207 insertions(+), 34 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c >> b/drivers/gpu/drm/i915/display/intel_atomic.c >> index fd0026fc3618..b5c17d8c0208 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c >> @@ -229,14 +229,15 @@ void intel_crtc_free_hw_state(struct intel_crtc_state >> *crtc_state) >> intel_crtc_put_color_blobs(crtc_state); >> } >> >> -void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) >> +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state, >> + const struct intel_crtc_state *from_crtc_state) >> { >> drm_property_replace_blob(&crtc_state->hw.degamma_lut, >> - crtc_state->uapi.degamma_lut); >> + from_crtc_state->uapi.degamma_lut); >> drm_property_replace_blob(&crtc_state->hw.gamma_lut, >> - crtc_state->uapi.gamma_lut); >> + from_crtc_state->uapi.gamma_lut); >> drm_property_replace_blob(&crtc_state->hw.ctm, >> - crtc_state->uapi.ctm); >> + from_crtc_state->uapi.ctm); >> } >> >> /** >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h >> b/drivers/gpu/drm/i915/display/intel_atomic.h >> index 7b49623419ba..e64473227285 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.h >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.h >> @@ -37,7 +37,8 @@ struct drm_crtc_state *intel_crtc_duplicate_state(struct >> drm_crtc *crtc); >> void intel_crtc_destroy_state(struct drm_crtc *crtc, >> struct drm_crtc_state *state); >> void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); >> -void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state); >> +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state, >> + const struct intel_crtc_state >> *from_crtc_state); >> struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); >> void intel_atomic_state_clear(struct drm_atomic_state *state); >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >> b/drivers/gpu/drm/i915/display/intel_display.c >> index 7a6da85823af..2dc63ef5caf8 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -7576,9 +7576,25 @@ static int intel_crtc_compute_config(struct >> intel_crtc *crtc, >> struct intel_crtc_state *pipe_config) >> { >> struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); >> -const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; >> +struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; >> int clock_limit = dev_priv->max_dotclk_freq; >> >> +*pipe_mode = pipe_config->hw.adjusted_mode; >> + >> +/* Adjust pipe_mode for bigjoiner, with half the horizontal mode */ >> +if (pipe_config->bigjoiner) { >> +pipe_mode->crtc_clock /= 2; >> +pipe_mode->crtc_hdisplay /= 2; &g
Re: [Intel-gfx] [PATCH 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Op 28-11-2019 om 20:04 schreef Ville Syrjälä: > On Thu, Nov 14, 2019 at 05:05:15PM +0100, Maarten Lankhorst wrote: >> Small changes to intel_dp_mode_valid(), allow listing modes that >> can only be supported in the bigjoiner configuration, which is >> not supported yet. >> >> eDP does not support bigjoiner, so do not expose bigjoiner only >> modes on the eDP port. >> >> Changes since v1: >> - Disallow bigjoiner on eDP. >> Changes since v2: >> - Rename intel_dp_downstream_max_dotclock to intel_dp_max_dotclock, >> and split off the downstream and source checking to its own function. >> (Ville) >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_dp.c | 117 ++-- >> 1 file changed, 89 insertions(+), 28 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c >> b/drivers/gpu/drm/i915/display/intel_dp.c >> index 3123958e2081..9b7df8e85ea2 100644 >> --- a/drivers/gpu/drm/i915/display/intel_dp.c >> +++ b/drivers/gpu/drm/i915/display/intel_dp.c >> @@ -243,25 +243,37 @@ intel_dp_max_data_rate(int max_link_clock, int >> max_lanes) >> return max_link_clock * max_lanes; >> } >> >> -static int >> -intel_dp_downstream_max_dotclock(struct intel_dp *intel_dp) >> +static int source_max_dotclock(struct intel_dp *intel_dp, bool >> allow_bigjoiner) >> { >> struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); >> struct intel_encoder *encoder = &intel_dig_port->base; >> -struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); >> -int max_dotclk = dev_priv->max_dotclk_freq; >> -int ds_max_dotclk; >> +struct drm_i915_private *i915 = to_i915(encoder->base.dev); >> + >> +if (allow_bigjoiner && INTEL_GEN(i915) >= 11 && >> !intel_dp_is_edp(intel_dp)) > Should the edp check actually be check for the edp transcoder > (ie. port A) on icl? Isn't that equivalent to this check? > >> +return 2 * i915->max_dotclk_freq; >> + >> +return i915->max_dotclk_freq; >> +} >> >> +static int downstream_max_dotclock(struct intel_dp *intel_dp) >> +{ >> int type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK; >> >> if (type != DP_DS_PORT_TYPE_VGA) >> -return max_dotclk; >> +return 0; >> >> -ds_max_dotclk = drm_dp_downstream_max_clock(intel_dp->dpcd, >> -intel_dp->downstream_ports); >> +return drm_dp_downstream_max_clock(intel_dp->dpcd, >> + intel_dp->downstream_ports); >> +} >> + >> +static int >> +intel_dp_max_dotclock(struct intel_dp *intel_dp, bool allow_bigjoiner) >> +{ >> +int max_dotclk = source_max_dotclock(intel_dp, allow_bigjoiner); >> +int ds_max_dotclk = downstream_max_dotclock(intel_dp); >> >> if (ds_max_dotclk != 0) >> -max_dotclk = min(max_dotclk, ds_max_dotclk); >> +return min(max_dotclk, ds_max_dotclk); >> >> return max_dotclk; >> } >> @@ -506,7 +518,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915) >> >> static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, >> u32 link_clock, u32 lane_count, >> - u32 mode_clock, u32 mode_hdisplay) >> + u32 mode_clock, u32 mode_hdisplay, >> + bool bigjoiner) >> { >> u32 bits_per_pixel, max_bpp_small_joiner_ram; >> int i; >> @@ -524,6 +537,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct >> drm_i915_private *i915, >> /* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ >> max_bpp_small_joiner_ram = small_joiner_ram_size_bits(i915) / >> mode_hdisplay; >> + >> +if (bigjoiner) >> +max_bpp_small_joiner_ram *= 2; >> + >> DRM_DEBUG_KMS("Max small joiner bpp: %u\n", max_bpp_small_joiner_ram); >> >> /* >> @@ -532,6 +549,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct >> drm_i915_private *i915, >> */ >> bits_per_pixel = min(bits_per_pixel, max_bpp_small_joiner_ram); >> >> +if (bigjoiner) { >> +u32 max_bpp_bigjoiner = >> +i915->max_cdclk_freq * 48 / >> +
Re: [Intel-gfx] [PATCH 02/11] drm/i915: Remove hw.mode
Op 18-11-2019 om 18:39 schreef Ville Syrjälä: > On Thu, Nov 14, 2019 at 05:05:13PM +0100, Maarten Lankhorst wrote: >> The members in hw.mode can be used from adjusted_mode as well, >> use that when available. >> >> Some places that use hw.mode can be converted to use adjusted_mode >> as well. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_display.c | 49 ++- >> .../drm/i915/display/intel_display_types.h| 2 +- >> drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- >> drivers/gpu/drm/i915/display/intel_sdvo.c | 16 +++--- >> 4 files changed, 34 insertions(+), 35 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >> b/drivers/gpu/drm/i915/display/intel_display.c >> index adf50c4b38ad..18acecc3642d 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -8440,9 +8440,6 @@ static void intel_get_pipe_src_size(struct intel_crtc >> *crtc, >> tmp = I915_READ(PIPESRC(crtc->pipe)); >> pipe_config->pipe_src_h = (tmp & 0x) + 1; >> pipe_config->pipe_src_w = ((tmp >> 16) & 0x) + 1; >> - >> -pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; >> -pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; >> } >> >> void intel_mode_from_pipe_config(struct drm_display_mode *mode, >> @@ -12098,8 +12095,8 @@ static int icl_add_sync_mode_crtcs(struct >> intel_crtc_state *crtc_state) >> continue; >> if (!connector->has_tile) >> continue; >> -if (crtc_state->hw.mode.hdisplay != connector->tile_h_size || >> -crtc_state->hw.mode.vdisplay != connector->tile_v_size) >> +if (crtc_state->hw.adjusted_mode.crtc_hdisplay != >> connector->tile_h_size || >> +crtc_state->hw.adjusted_mode.crtc_vdisplay != >> connector->tile_v_size) >> return 0; >> if (connector->tile_h_loc == connector->num_h_tile - 1 && >> connector->tile_v_loc == connector->num_v_tile - 1) >> @@ -12506,7 +12503,7 @@ static void intel_dump_pipe_config(const struct >> intel_crtc_state *pipe_config, >> intel_dump_infoframe(dev_priv, &pipe_config->infoframes.hdmi); >> >> DRM_DEBUG_KMS("requested mode:\n"); >> -drm_mode_debug_printmodeline(&pipe_config->hw.mode); >> +drm_mode_debug_printmodeline(&pipe_config->uapi.mode); >> DRM_DEBUG_KMS("adjusted mode:\n"); >> drm_mode_debug_printmodeline(&pipe_config->hw.adjusted_mode); >> intel_dump_crtc_timings(&pipe_config->hw.adjusted_mode); >> @@ -12640,16 +12637,16 @@ intel_crtc_copy_uapi_to_hw_state(struct >> intel_crtc_state *crtc_state) >> { >> crtc_state->hw.enable = crtc_state->uapi.enable; >> crtc_state->hw.active = crtc_state->uapi.active; >> -crtc_state->hw.mode = crtc_state->uapi.mode; >> crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode; >> intel_crtc_copy_uapi_to_hw_state_nomodeset(crtc_state); >> } >> >> -static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state >> *crtc_state) >> +static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state >> *crtc_state, >> + struct drm_display_mode *user_mode) >> { >> crtc_state->uapi.enable = crtc_state->hw.enable; >> crtc_state->uapi.active = crtc_state->hw.active; >> -WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, >> &crtc_state->hw.mode) < 0); >> +WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, user_mode) < 0); >> >> crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode; >> >> @@ -12702,6 +12699,10 @@ intel_crtc_prepare_cleared_state(struct >> intel_crtc_state *crtc_state) >> memcpy(crtc_state, saved_state, sizeof(*crtc_state)); >> kfree(saved_state); >> >> +/* Clear I915_MODE_FLAG_INHERITED */ >> +crtc_state->uapi.mode.private_flags = 0; >> +crtc_state->uapi.adjusted_mode.private_flags = 0; >> + >> intel_crtc_copy_uapi_to_hw_state(crtc_state); >> >> return 0; >> @@ -12750,7 +12751,7 @@ intel_modeset_pipe_config(struct intel_crtc_state >
[Intel-gfx] [PATCH 08/14] drm/i915: Complete crtc hw/uapi split, v2.
Now that we separated everything into uapi and hw, it's time to make the split definitive. Remove the union and make a copy of the hw state on modeset and fastset. Color blobs are copied in crtc atomic_check(), right before color management is checked. Changes since v1: - Copy all blobs immediately after drm_atomic_helper_check_modeset(). - Clear crtc_state->hw on disable, instead of using clear_intel_crtc_state(). Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 44 ++ drivers/gpu/drm/i915/display/intel_atomic.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 45 --- .../drm/i915/display/intel_display_types.h| 9 ++-- 4 files changed, 89 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 7cf13b9c7d38..266d0ce9d03d 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); + /* copy color blobs */ + if (crtc_state->hw.degamma_lut) + drm_property_blob_get(crtc_state->hw.degamma_lut); + if (crtc_state->hw.ctm) + drm_property_blob_get(crtc_state->hw.ctm); + if (crtc_state->hw.gamma_lut) + drm_property_blob_get(crtc_state->hw.gamma_lut); + crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; @@ -208,6 +216,41 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) return &crtc_state->uapi; } +static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state) +{ + drm_property_blob_put(crtc_state->hw.degamma_lut); + drm_property_blob_put(crtc_state->hw.gamma_lut); + drm_property_blob_put(crtc_state->hw.ctm); +} + +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); +} + +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); + + if (crtc_state->uapi.degamma_lut) + crtc_state->hw.degamma_lut = + drm_property_blob_get(crtc_state->uapi.degamma_lut); + else + crtc_state->hw.degamma_lut = NULL; + + if (crtc_state->uapi.gamma_lut) + crtc_state->hw.gamma_lut = + drm_property_blob_get(crtc_state->uapi.gamma_lut); + else + crtc_state->hw.gamma_lut = NULL; + + if (crtc_state->uapi.ctm) + crtc_state->hw.ctm = + drm_property_blob_get(crtc_state->uapi.ctm); + else + crtc_state->hw.ctm = NULL; +} + /** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc @@ -223,6 +266,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); + intel_crtc_free_hw_state(crtc_state); kfree(crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h b/drivers/gpu/drm/i915/display/intel_atomic.h index 58065d3161a3..42be91e0772a 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.h +++ b/drivers/gpu/drm/i915/display/intel_atomic.h @@ -35,6 +35,8 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector); struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc); void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state); +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state); struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); void intel_atomic_state_clear(struct drm_atomic_state *state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 06c593d56d92..c009489641bd 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -114,6 +114,7 @@ static const u64 cursor_format_modifiers[] = { DRM_FORMAT_MOD_INVALID }; +static void copy_uapi_to_hw_state(struct intel_crtc_state *crtc_state); static void i9xx_crtc_clock_get(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config); static void ironlake_pch_clock_get(struct intel_crtc *crtc, @@ -7041,6 +7042,7 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc, crtc->enabled = false; crtc->state->connector_mask = 0; crtc->state->encoder_mask = 0; +
Re: [Intel-gfx] [PATCH 01/14] drm/i915: Rework watermark readout to use plane api
Op 17-10-2019 om 15:37 schreef Ville Syrjälä: > On Thu, Oct 17, 2019 at 03:20:52PM +0200, Maarten Lankhorst wrote: >> Instead of unconditionally verifying the cursor plane, handle it in the >> same way as any other plane, and use our existing api to verify. >> >> While at it, ensure that on gen9+ we verify active_planes mask as well. >> This should give the correct results for planar YUV planes too, as we >> update active_planes for them. > Why is that hidden in the watermark verification code? We already have > intel_verify_planes() which seems like a better fit. Wasn't aware of it, mostly. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 05/14] drm/i915: Perform manual conversions for crtc uapi/hw split
Op 17-10-2019 om 15:20 schreef Maarten Lankhorst: > intel_get_load_detect_pipe() needs to set uapi active, > uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), > so we can remove it. > > intel_pipe_config_compare() needs to look at hw state, but I didn't > change spatch to look at it. It's easy enough to do manually. > > intel_atomic_check() definitely needs to check for uapi enable, > otherwise intel_modeset_pipe_config cannot copy uapi state to hw. > > Signed-off-by: Maarten Lankhorst > --- > drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- > 1 file changed, 21 insertions(+), 21 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index fa0abfdff2ae..adb70d76a61c 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -11214,7 +11214,7 @@ int intel_get_load_detect_pipe(struct drm_connector > *connector, > goto fail; > } > > - crtc_state->base.active = crtc_state->base.enable = true; > + crtc_state->hw.active = true; Ugh, should of course be uapi.active, because I split it out. :( Will fix. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
intel_get_load_detect_pipe() needs to set uapi active, uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), so we can remove it. intel_pipe_config_compare() needs to look at hw state, but I didn't change spatch to look at it. It's easy enough to do manually. intel_atomic_check() definitely needs to check for uapi enable, otherwise intel_modeset_pipe_config cannot copy uapi state to hw. Changes since v1: - Actually set uapi.active in get_load_detect_pipe(). Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index fa0abfdff2ae..bbac6b764d92 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11214,7 +11214,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, goto fail; } - crtc_state->base.active = crtc_state->base.enable = true; + crtc_state->uapi.active = true; if (!mode) mode = &load_detect_mode; @@ -12754,19 +12754,19 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_X(output_types); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_htotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_htotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vtotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vtotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_end); PIPE_CONF_CHECK_I(pixel_multiplier); PIPE_CONF_CHECK_I(output_format); @@ -12783,17 +12783,17 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_INTERLACE); if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS)) { - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PVSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NVSYNC); } @@ -12832,7 +12832,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, bp_gamma = intel_color_get_gamma_bit_precision(pipe_config); if (bp_gamma) - PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, base.gamma_lut, bp_gamma); + PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, hw.gamma_lut, bp_gamma); } @@ -12877,7 +12877,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5) PIPE_CONF_CHECK_I(pipe_bpp); - PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock); + PIPE_CONF_CHECK_CLOCK_FUZZY(hw.adjusted_mode.crtc_clock); PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock); PIPE_CONF_CHECK_I(min_voltage_level); @@ -13572,7 +13572,7 @@ static int intel_atomic_check(struct drm_device *dev,
Re: [Intel-gfx] [PATCH 04/14] drm/i915: Add aliases for uapi and hw to crtc_state
Op 18-10-2019 om 12:36 schreef Ville Syrjälä: > On Thu, Oct 17, 2019 at 03:20:55PM +0200, Maarten Lankhorst wrote: >> Prepare to split up hw and uapi machinally, by adding a uapi and >> hw alias. We will remove the base in a bit. This is a split from the >> original uapi/hw patch, which did it all in one go. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_atomic.c | 8 -- >> drivers/gpu/drm/i915/display/intel_display.c | 2 ++ >> drivers/gpu/drm/i915/display/intel_display.h | 6 ++--- >> .../drm/i915/display/intel_display_types.h| 27 ++- >> 4 files changed, 37 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c >> b/drivers/gpu/drm/i915/display/intel_atomic.c >> index e6cb85d41c8d..2cdc92897abd 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c >> @@ -186,9 +186,10 @@ intel_digital_connector_duplicate_state(struct >> drm_connector *connector) >> struct drm_crtc_state * >> intel_crtc_duplicate_state(struct drm_crtc *crtc) >> { >> +const struct intel_crtc_state *old_crtc_state = >> to_intel_crtc_state(crtc->state); >> struct intel_crtc_state *crtc_state; >> >> -crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL); >> +crtc_state = kmemdup(old_crtc_state, sizeof(*crtc_state), GFP_KERNEL); >> if (!crtc_state) >> return NULL; >> >> @@ -219,7 +220,10 @@ void >> intel_crtc_destroy_state(struct drm_crtc *crtc, >> struct drm_crtc_state *state) >> { >> -drm_atomic_helper_crtc_destroy_state(crtc, state); >> +struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); >> + >> +__drm_atomic_helper_crtc_destroy_state(&crtc_state->base); >> +kfree(crtc_state); >> } >> >> static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state >> *scaler_state, >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >> b/drivers/gpu/drm/i915/display/intel_display.c >> index 5632e13d458d..fa0abfdff2ae 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -12282,6 +12282,8 @@ clear_intel_crtc_state(struct intel_crtc_state >> *crtc_state) >> >> /* Keep base drm_crtc_state intact, only clear our extended struct */ >> BUILD_BUG_ON(offsetof(struct intel_crtc_state, base)); >> +BUILD_BUG_ON(offsetof(struct intel_crtc_state, uapi)); >> +BUILD_BUG_ON(offsetof(struct intel_crtc_state, hw)); >> memcpy(&crtc_state->base + 1, &saved_state->base + 1, >> sizeof(*crtc_state) - sizeof(crtc_state->base)); >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.h >> b/drivers/gpu/drm/i915/display/intel_display.h >> index 90807603987c..9b53f65386b5 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.h >> +++ b/drivers/gpu/drm/i915/display/intel_display.h >> @@ -444,10 +444,10 @@ enum phy_fia { >> #define intel_atomic_crtc_state_for_each_plane_state( \ >>plane, plane_state, \ >>crtc_state) \ >> -for_each_intel_plane_mask(((crtc_state)->base.state->dev), (plane), \ >> -((crtc_state)->base.plane_mask)) \ >> +for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (plane), \ >> +((crtc_state)->uapi.plane_mask)) \ >> for_each_if ((plane_state = \ >> - >> to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->base.state, >> &plane->base >> + >> to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, >> &plane->base >> >> void intel_link_compute_m_n(u16 bpp, int nlanes, >> int pixel_clock, int link_clock, >> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h >> b/drivers/gpu/drm/i915/display/intel_display_types.h >> index 244e881474fb..4d85ea5832d7 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display_types.h >> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h >> @@ -749,7 +749,32 @@ enum intel_output_format { >> }; >> >> struct intel_crtc_state { >> +union { >> struct drm_crtc_state base; >> +/* >> + * uapi (drm) state
Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [01/14] drm/i915: Rework watermark readout to use plane api (rev2)
Op 18-10-2019 om 12:57 schreef Patchwork: > == Series Details == > > Series: series starting with [01/14] drm/i915: Rework watermark readout to > use plane api (rev2) > URL : https://patchwork.freedesktop.org/series/68154/ > State : failure > > == Summary == > > CI Bug Log - changes from CI_DRM_7125_full -> Patchwork_14874_full > > > Summary > --- > > **FAILURE** > > Serious unknown changes coming with Patchwork_14874_full absolutely need to > be > verified manually. > > If you think the reported changes have nothing to do with the changes > introduced in Patchwork_14874_full, please notify your bug team to allow > them > to document this new failure mode, which will reduce false positives in CI. > > > > Possible new issues > --- > > Here are the unknown changes that may have been introduced in > Patchwork_14874_full: > > ### IGT changes ### > > Possible regressions > > * igt@gem_ctx_switch@queue-light: > - shard-glk: [PASS][1] -> [DMESG-WARN][2] >[1]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7125/shard-glk6/igt@gem_ctx_swi...@queue-light.html >[2]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14874/shard-glk7/igt@gem_ctx_swi...@queue-light.html > > * igt@kms_plane@pixel-format-pipe-b-planes: > - shard-kbl: [PASS][3] -> [FAIL][4] +3 similar issues >[3]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7125/shard-kbl3/igt@kms_pl...@pixel-format-pipe-b-planes.html >[4]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14874/shard-kbl3/igt@kms_pl...@pixel-format-pipe-b-planes.html > > * igt@kms_plane@pixel-format-pipe-c-planes: > - shard-glk: [PASS][5] -> [FAIL][6] +5 similar issues >[5]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7125/shard-glk4/igt@kms_pl...@pixel-format-pipe-c-planes.html >[6]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14874/shard-glk8/igt@kms_pl...@pixel-format-pipe-c-planes.html > Guessing this comes from the last patch. Will look at it. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 14/14] drm/i915: Remove special case slave handling during hw programming, v2.
Op 17-10-2019 om 15:21 schreef Maarten Lankhorst: > Now that we split plane_state which I didn't want to do yet, we can > program the slave plane without requiring the master plane. > > This is useful for programming bigjoiner slave planes as well. We > will no longer need the master's plane_state. > > Changes since v1: > - set src/dst rectangles after copy_uapi_to_hw_state. > > Signed-off-by: Maarten Lankhorst > --- > .../gpu/drm/i915/display/intel_atomic_plane.c | 30 +- > .../gpu/drm/i915/display/intel_atomic_plane.h | 3 - > drivers/gpu/drm/i915/display/intel_display.c | 18 ++ > .../drm/i915/display/intel_display_types.h| 6 +- > drivers/gpu/drm/i915/display/intel_sprite.c | 55 ++- > 5 files changed, 39 insertions(+), 73 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > index d9b65e9c45fc..54d112408716 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > @@ -309,16 +309,6 @@ void intel_update_plane(struct intel_plane *plane, > plane->update_plane(plane, crtc_state, plane_state); > } > > -void intel_update_slave(struct intel_plane *plane, > - const struct intel_crtc_state *crtc_state, > - const struct intel_plane_state *plane_state) > -{ > - struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); > - > - trace_intel_update_plane(&plane->base, crtc); > - plane->update_slave(plane, crtc_state, plane_state); > -} > - > void intel_disable_plane(struct intel_plane *plane, >const struct intel_crtc_state *crtc_state) > { > @@ -351,25 +341,9 @@ void skl_update_planes_on_crtc(struct intel_atomic_state > *state, > struct intel_plane_state *new_plane_state = > intel_atomic_get_new_plane_state(state, plane); > > - if (new_plane_state->uapi.visible) { > + if (new_plane_state->uapi.visible || > + new_plane_state->planar_slave) { > intel_update_plane(plane, new_crtc_state, > new_plane_state); > - } else if (new_plane_state->planar_slave) { > - struct intel_plane *master = > - new_plane_state->planar_linked_plane; > - > - /* > - * We update the slave plane from this function because > - * programming it from the master plane's update_plane > - * callback runs into issues when the Y plane is > - * reassigned, disabled or used by a different plane. > - * > - * The slave plane is updated with the master plane's > - * plane_state. > - */ > - new_plane_state = > - intel_atomic_get_new_plane_state(state, master); > - > - intel_update_slave(plane, new_crtc_state, > new_plane_state); > } else { > intel_disable_plane(plane, new_crtc_state); > } > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h > b/drivers/gpu/drm/i915/display/intel_atomic_plane.h > index 123404a9cf23..726ececd6abd 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h > @@ -25,9 +25,6 @@ void intel_plane_copy_uapi_to_hw_state(struct > intel_plane_state *plane_state, > void intel_update_plane(struct intel_plane *plane, > const struct intel_crtc_state *crtc_state, > const struct intel_plane_state *plane_state); > -void intel_update_slave(struct intel_plane *plane, > - const struct intel_crtc_state *crtc_state, > - const struct intel_plane_state *plane_state); > void intel_disable_plane(struct intel_plane *plane, >const struct intel_crtc_state *crtc_state); > struct intel_plane *intel_plane_alloc(void); > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index de520d5f1374..88f149cac198 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -11768,6 +11768,24 @@ static int icl_check_nv12_planes(struct > intel_crtc_state *crtc_state) > crtc_state->active_planes |= BIT(linked->id); > crtc_state->update_planes |= BIT(linked->id);
[Intel-gfx] [PATCH] drm/i915: Remove special case slave handling during hw programming, v3.
From: Maarten Lankhorst Now that we split plane_state which I didn't want to do yet, we can program the slave plane without requiring the master plane. This is useful for programming bigjoiner slave planes as well. We will no longer need the master's plane_state. Changes since v1: - set src/dst rectangles after copy_uapi_to_hw_state. Changes since v2: - Use the correct color_plane for pre-gen11 by using planar_linked_plane != NULL. - Use drm_format_info_is_yuv_semiplanar in skl_plane_check() to fix gen11+. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 30 +- .../gpu/drm/i915/display/intel_atomic_plane.h | 3 - drivers/gpu/drm/i915/display/intel_display.c | 18 ++ .../drm/i915/display/intel_display_types.h| 6 +- drivers/gpu/drm/i915/display/intel_sprite.c | 57 ++- 5 files changed, 40 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index d9b65e9c45fc..54d112408716 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -309,16 +309,6 @@ void intel_update_plane(struct intel_plane *plane, plane->update_plane(plane, crtc_state, plane_state); } -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state) -{ - struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - - trace_intel_update_plane(&plane->base, crtc); - plane->update_slave(plane, crtc_state, plane_state); -} - void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { @@ -351,25 +341,9 @@ void skl_update_planes_on_crtc(struct intel_atomic_state *state, struct intel_plane_state *new_plane_state = intel_atomic_get_new_plane_state(state, plane); - if (new_plane_state->uapi.visible) { + if (new_plane_state->uapi.visible || + new_plane_state->planar_slave) { intel_update_plane(plane, new_crtc_state, new_plane_state); - } else if (new_plane_state->planar_slave) { - struct intel_plane *master = - new_plane_state->planar_linked_plane; - - /* -* We update the slave plane from this function because -* programming it from the master plane's update_plane -* callback runs into issues when the Y plane is -* reassigned, disabled or used by a different plane. -* -* The slave plane is updated with the master plane's -* plane_state. -*/ - new_plane_state = - intel_atomic_get_new_plane_state(state, master); - - intel_update_slave(plane, new_crtc_state, new_plane_state); } else { intel_disable_plane(plane, new_crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index 123404a9cf23..726ececd6abd 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -25,9 +25,6 @@ void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state); void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state); struct intel_plane *intel_plane_alloc(void); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 490f09264c7f..e51cbf6b4159 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11911,6 +11911,24 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state) crtc_state->active_planes |= BIT(linked->id); crtc_state->update_planes |= BIT(linked->id); DRM_DEBUG_KMS("Using %s as Y plane for %s\n", linked->base.name, plane->base.name); + + /* Copy parameters to slave plane */ + linked_state->ctl = plane_state->ctl | PLANE
Re: [Intel-gfx] [PATCH] drm/i915: Remove special case slave handling during hw programming, v3.
Op 22-10-2019 om 20:14 schreef Ville Syrjälä: > On Tue, Oct 22, 2019 at 12:31:49PM +0200, Maarten Lankhorst wrote: >> From: Maarten Lankhorst >> >> Now that we split plane_state which I didn't want to do yet, we can >> program the slave plane without requiring the master plane. >> >> This is useful for programming bigjoiner slave planes as well. We >> will no longer need the master's plane_state. >> >> Changes since v1: >> - set src/dst rectangles after copy_uapi_to_hw_state. >> Changes since v2: >> - Use the correct color_plane for pre-gen11 by using planar_linked_plane != >> NULL. >> - Use drm_format_info_is_yuv_semiplanar in skl_plane_check() to fix gen11+. >> >> Signed-off-by: Maarten Lankhorst >> --- >> .../gpu/drm/i915/display/intel_atomic_plane.c | 30 +- >> .../gpu/drm/i915/display/intel_atomic_plane.h | 3 - >> drivers/gpu/drm/i915/display/intel_display.c | 18 ++ >> .../drm/i915/display/intel_display_types.h| 6 +- >> drivers/gpu/drm/i915/display/intel_sprite.c | 57 ++- >> 5 files changed, 40 insertions(+), 74 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> index d9b65e9c45fc..54d112408716 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> @@ -309,16 +309,6 @@ void intel_update_plane(struct intel_plane *plane, >> plane->update_plane(plane, crtc_state, plane_state); >> } >> >> -void intel_update_slave(struct intel_plane *plane, >> -const struct intel_crtc_state *crtc_state, >> -const struct intel_plane_state *plane_state) >> -{ >> -struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); >> - >> -trace_intel_update_plane(&plane->base, crtc); >> -plane->update_slave(plane, crtc_state, plane_state); >> -} >> - >> void intel_disable_plane(struct intel_plane *plane, >> const struct intel_crtc_state *crtc_state) >> { >> @@ -351,25 +341,9 @@ void skl_update_planes_on_crtc(struct >> intel_atomic_state *state, >> struct intel_plane_state *new_plane_state = >> intel_atomic_get_new_plane_state(state, plane); >> >> -if (new_plane_state->uapi.visible) { >> +if (new_plane_state->uapi.visible || >> +new_plane_state->planar_slave) { >> intel_update_plane(plane, new_crtc_state, >> new_plane_state); >> -} else if (new_plane_state->planar_slave) { >> -struct intel_plane *master = >> -new_plane_state->planar_linked_plane; >> - >> -/* >> - * We update the slave plane from this function because >> - * programming it from the master plane's update_plane >> - * callback runs into issues when the Y plane is >> - * reassigned, disabled or used by a different plane. >> - * >> - * The slave plane is updated with the master plane's >> - * plane_state. >> - */ >> -new_plane_state = >> -intel_atomic_get_new_plane_state(state, master); >> - >> -intel_update_slave(plane, new_crtc_state, >> new_plane_state); >> } else { >> intel_disable_plane(plane, new_crtc_state); >> } >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> b/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> index 123404a9cf23..726ececd6abd 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> @@ -25,9 +25,6 @@ void intel_plane_copy_uapi_to_hw_state(struct >> intel_plane_state *plane_state, >> void intel_update_plane(struct intel_plane *plane, >> const struct intel_crtc_state *crtc_state, >> const struct intel_plane_state *plane_state); >> -void intel_update_slave(struct intel_plane *plane, >> -const struct intel_crtc_state *crtc_state, >> -const struct intel_plane_state *plane_state); >> void intel_disable_plane(struct intel_plane *plane, >
Re: [Intel-gfx] [PATCH 08/14] drm/i915: Complete crtc hw/uapi split, v2.
Op 22-10-2019 om 20:32 schreef Ville Syrjälä: > On Thu, Oct 17, 2019 at 03:20:59PM +0200, Maarten Lankhorst wrote: >> Now that we separated everything into uapi and hw, it's >> time to make the split definitive. Remove the union and >> make a copy of the hw state on modeset and fastset. >> >> Color blobs are copied in crtc atomic_check(), right >> before color management is checked. >> >> Changes since v1: >> - Copy all blobs immediately after drm_atomic_helper_check_modeset(). >> - Clear crtc_state->hw on disable, instead of using clear_intel_crtc_state(). >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_atomic.c | 44 ++ >> drivers/gpu/drm/i915/display/intel_atomic.h | 2 + >> drivers/gpu/drm/i915/display/intel_display.c | 45 --- >> .../drm/i915/display/intel_display_types.h| 9 ++-- >> 4 files changed, 89 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c >> b/drivers/gpu/drm/i915/display/intel_atomic.c >> index 7cf13b9c7d38..266d0ce9d03d 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c >> @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) >> >> __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); >> >> +/* copy color blobs */ >> +if (crtc_state->hw.degamma_lut) >> +drm_property_blob_get(crtc_state->hw.degamma_lut); >> +if (crtc_state->hw.ctm) >> +drm_property_blob_get(crtc_state->hw.ctm); >> +if (crtc_state->hw.gamma_lut) >> +drm_property_blob_get(crtc_state->hw.gamma_lut); >> + >> crtc_state->update_pipe = false; >> crtc_state->disable_lp_wm = false; >> crtc_state->disable_cxsr = false; >> @@ -208,6 +216,41 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) >> return &crtc_state->uapi; >> } >> >> +static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state) >> +{ >> +drm_property_blob_put(crtc_state->hw.degamma_lut); >> +drm_property_blob_put(crtc_state->hw.gamma_lut); >> +drm_property_blob_put(crtc_state->hw.ctm); >> +} >> + >> +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) >> +{ >> +intel_crtc_put_color_blobs(crtc_state); >> +} >> + >> +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) >> +{ >> +intel_crtc_put_color_blobs(crtc_state); >> + >> +if (crtc_state->uapi.degamma_lut) >> +crtc_state->hw.degamma_lut = >> +drm_property_blob_get(crtc_state->uapi.degamma_lut); >> +else >> +crtc_state->hw.degamma_lut = NULL; > Side note: If drm_property_blob_get() would pass NULL through this kind > of stuff would look a lot less annoying. > >> + >> +if (crtc_state->uapi.gamma_lut) >> +crtc_state->hw.gamma_lut = >> +drm_property_blob_get(crtc_state->uapi.gamma_lut); >> +else >> +crtc_state->hw.gamma_lut = NULL; >> + >> +if (crtc_state->uapi.ctm) >> +crtc_state->hw.ctm = >> +drm_property_blob_get(crtc_state->uapi.ctm); >> +else >> +crtc_state->hw.ctm = NULL; >> +} >> + >> /** >> * intel_crtc_destroy_state - destroy crtc state >> * @crtc: drm crtc >> @@ -223,6 +266,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, >> struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); >> >> __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); >> +intel_crtc_free_hw_state(crtc_state); >> kfree(crtc_state); >> } >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h >> b/drivers/gpu/drm/i915/display/intel_atomic.h >> index 58065d3161a3..42be91e0772a 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.h >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.h >> @@ -35,6 +35,8 @@ intel_digital_connector_duplicate_state(struct >> drm_connector *connector); >> struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc); >> void intel_crtc_destroy_state(struct drm_crtc *crtc, >> struct drm_crtc_state *state); >> +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); >> +void int
Re: [Intel-gfx] [PATCH] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
Op 22-10-2019 om 20:16 schreef Ville Syrjälä: > On Fri, Oct 18, 2019 at 10:13:23AM +0200, Maarten Lankhorst wrote: >> intel_get_load_detect_pipe() needs to set uapi active, >> uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), >> so we can remove it. >> >> intel_pipe_config_compare() needs to look at hw state, but I didn't >> change spatch to look at it. It's easy enough to do manually. >> >> intel_atomic_check() definitely needs to check for uapi enable, >> otherwise intel_modeset_pipe_config cannot copy uapi state to hw. > We seem to have three totally separate things in this one patch. The patch is about the manual conversions that need to be done because the automated checks get them wrong. So it touches 3 spots but does 1 thing, if you want I can split it into 3 patches. Will do so if required. ~Maarten ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
Op 24-10-2019 om 14:23 schreef Ville Syrjälä: > On Thu, Oct 24, 2019 at 02:12:46PM +0200, Maarten Lankhorst wrote: >> Op 22-10-2019 om 20:16 schreef Ville Syrjälä: >>> On Fri, Oct 18, 2019 at 10:13:23AM +0200, Maarten Lankhorst wrote: >>>> intel_get_load_detect_pipe() needs to set uapi active, >>>> uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), >>>> so we can remove it. >>>> >>>> intel_pipe_config_compare() needs to look at hw state, but I didn't >>>> change spatch to look at it. It's easy enough to do manually. >>>> >>>> intel_atomic_check() definitely needs to check for uapi enable, >>>> otherwise intel_modeset_pipe_config cannot copy uapi state to hw. >>> We seem to have three totally separate things in this one patch. >> The patch is about the manual conversions that need to be done because the >> automated >> >> checks get them wrong. > Does that mean the series is not actually bisectable? I've checked all places manually and it should be correct. For any regression we will likely end up at patch 8/14 as it formalizes the split. You can investigate further by changing all hw references in a file to uapi. Realistically you won't hit any issues until bigjoiner is introduced, and hw and uapi can contain wildly different values. This is mostly noticeable for plane_state, because plane_state->uapi.fb/crtc will be null for a slave plane. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 04/14] drm/i915: Add aliases for uapi and hw to crtc_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 8 -- drivers/gpu/drm/i915/display/intel_display.c | 2 ++ drivers/gpu/drm/i915/display/intel_display.h | 6 ++--- .../drm/i915/display/intel_display_types.h| 27 ++- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index e6cb85d41c8d..2cdc92897abd 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -186,9 +186,10 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector) struct drm_crtc_state * intel_crtc_duplicate_state(struct drm_crtc *crtc) { + const struct intel_crtc_state *old_crtc_state = to_intel_crtc_state(crtc->state); struct intel_crtc_state *crtc_state; - crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL); + crtc_state = kmemdup(old_crtc_state, sizeof(*crtc_state), GFP_KERNEL); if (!crtc_state) return NULL; @@ -219,7 +220,10 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { - drm_atomic_helper_crtc_destroy_state(crtc, state); + struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); + + __drm_atomic_helper_crtc_destroy_state(&crtc_state->base); + kfree(crtc_state); } static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state, diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 0c0dae8097b0..03d958b13789 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -12517,6 +12517,8 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) /* Keep base drm_crtc_state intact, only clear our extended struct */ BUILD_BUG_ON(offsetof(struct intel_crtc_state, base)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, uapi)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, hw)); memcpy(&crtc_state->base + 1, &saved_state->base + 1, sizeof(*crtc_state) - sizeof(crtc_state->base)); diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 7dcb176d91b0..601d17afc98d 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -447,10 +447,10 @@ enum phy_fia { #define intel_atomic_crtc_state_for_each_plane_state( \ plane, plane_state, \ crtc_state) \ - for_each_intel_plane_mask(((crtc_state)->base.state->dev), (plane), \ - ((crtc_state)->base.plane_mask)) \ + for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (plane), \ + ((crtc_state)->uapi.plane_mask)) \ for_each_if ((plane_state = \ - to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->base.state, &plane->base + to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &plane->base void intel_link_compute_m_n(u16 bpp, int nlanes, int pixel_clock, int link_clock, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 627bd2ea3751..4697f719b3a8 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -749,7 +749,32 @@ enum intel_output_format { }; struct intel_crtc_state { + union { struct drm_crtc_state base; + /* +* uapi (drm) state. This is the software state shown to userspace. +* In particular, the following members are used for bookkeeping: +* - crtc +* - state +* - *_changed +* - event +* - commit +* - mode_blob +*/ + struct drm_crtc_state uapi; + + /* +* actual hardware state, the state we program to the hardware. +* The following members are used to verify the hardware state: +* - enable +* - active +* - mode / adjusted_mode +* - color property blobs. +* +* During initial hw readout, they need to be copied to uapi. +*/ + struct drm_crtc_state hw; + }; /** * quirks - bitfield with hw state readout quirks @@ -1100,7 +1125,7 @@ struct cxsr_latency { #define to_intel_atomic_state(x) container_of(x, struct intel_a
[Intel-gfx] [PATCH 02/14] drm/i915: Introduce intel_atomic_get_plane_state_after_check(), v2.
Use this in all the places where we try to acquire planes after the planes atomic_check(). In case of intel_modeset_all_pipes() this is not yet done after atomic_check, but seems like it will be in the future. To add some paranoia, add all planes rather than active planes, because of bigjoiner and planar YUV support having extra planes outside of the core's view that wouldn't be added otherwise. Changes since v1: - Always add all planes, to handle force plane updates to work correctly with a disabled cursor plane. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 41 +-- .../gpu/drm/i915/display/intel_atomic_plane.c | 15 +++ drivers/gpu/drm/i915/display/intel_cdclk.c| 15 --- drivers/gpu/drm/i915/display/intel_color.c| 7 ++-- .../drm/i915/display/intel_display_types.h| 6 +++ drivers/gpu/drm/i915/intel_pm.c | 14 --- 6 files changed, 62 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index c5a552a69752..e6cb85d41c8d 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -313,13 +313,10 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state) { - struct drm_plane *plane = NULL; - struct intel_plane *intel_plane; - struct intel_plane_state *plane_state = NULL; struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; struct drm_atomic_state *drm_state = crtc_state->base.state; - struct intel_atomic_state *intel_state = to_intel_atomic_state(drm_state); + struct intel_atomic_state *state = to_intel_atomic_state(drm_state); int num_scalers_need; int i; @@ -346,6 +343,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, /* walkthrough scaler_users bits and start assigning scalers */ for (i = 0; i < sizeof(scaler_state->scaler_users) * 8; i++) { + struct intel_plane_state *plane_state = NULL; int *scaler_id; const char *name; int idx; @@ -361,19 +359,16 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, /* panel fitter case: assign as a crtc scaler */ scaler_id = &scaler_state->scaler_id; } else { - name = "PLANE"; + struct intel_plane *plane; /* plane scaler case: assign as a plane scaler */ /* find the plane that set the bit as scaler_user */ - plane = drm_state->planes[i].ptr; /* * to enable/disable hq mode, add planes that are using scaler * into this transaction */ - if (!plane) { - struct drm_plane_state *state; - + if (!drm_state->planes[i].ptr) { /* * GLK+ scalers don't have a HQ mode so it * isn't necessary to change between HQ and dyn mode @@ -382,24 +377,28 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) continue; - plane = drm_plane_from_index(&dev_priv->drm, i); - state = drm_atomic_get_plane_state(drm_state, plane); - if (IS_ERR(state)) { - DRM_DEBUG_KMS("Failed to add [PLANE:%d] to drm_state\n", - plane->base.id); - return PTR_ERR(state); + plane = to_intel_plane(drm_plane_from_index(&dev_priv->drm, i)); + plane_state = + intel_atomic_get_plane_state_after_check(state, + crtc_state, + plane); + if (IS_ERR(plane_state)) { + DRM_DEBUG_KMS("Failed to add [PLANE:%d] to drm_state: %li\n", + plane->base.base.id, PTR_ERR(plane_state)); + return PTR_ERR(plane_state);
[Intel-gfx] [PATCH 08/14] drm/i915: Complete crtc hw/uapi split, v3.
Now that we separated everything into uapi and hw, it's time to make the split definitive. Remove the union and make a copy of the hw state on modeset and fastset. Color blobs are copied in crtc atomic_check(), right before color management is checked. Changes since v1: - Copy all blobs immediately after drm_atomic_helper_check_modeset(). - Clear crtc_state->hw on disable, instead of using clear_intel_crtc_state(). Changes since v2: - Use intel_crtc_free_hw_state + clear in intel_crtc_disable_noatomic(). - Make a intel_crtc_prepare_state() function that clears the crtc_state and copies hw members. - Remove setting uapi.adjusted_mode, we now have a direct call to drm_calc_timestamping_constants(). Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 44 +++ drivers/gpu/drm/i915/display/intel_atomic.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 56 +++ .../drm/i915/display/intel_display_types.h| 9 +-- 4 files changed, 95 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 7cf13b9c7d38..266d0ce9d03d 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); + /* copy color blobs */ + if (crtc_state->hw.degamma_lut) + drm_property_blob_get(crtc_state->hw.degamma_lut); + if (crtc_state->hw.ctm) + drm_property_blob_get(crtc_state->hw.ctm); + if (crtc_state->hw.gamma_lut) + drm_property_blob_get(crtc_state->hw.gamma_lut); + crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; @@ -208,6 +216,41 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) return &crtc_state->uapi; } +static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state) +{ + drm_property_blob_put(crtc_state->hw.degamma_lut); + drm_property_blob_put(crtc_state->hw.gamma_lut); + drm_property_blob_put(crtc_state->hw.ctm); +} + +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); +} + +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); + + if (crtc_state->uapi.degamma_lut) + crtc_state->hw.degamma_lut = + drm_property_blob_get(crtc_state->uapi.degamma_lut); + else + crtc_state->hw.degamma_lut = NULL; + + if (crtc_state->uapi.gamma_lut) + crtc_state->hw.gamma_lut = + drm_property_blob_get(crtc_state->uapi.gamma_lut); + else + crtc_state->hw.gamma_lut = NULL; + + if (crtc_state->uapi.ctm) + crtc_state->hw.ctm = + drm_property_blob_get(crtc_state->uapi.ctm); + else + crtc_state->hw.ctm = NULL; +} + /** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc @@ -223,6 +266,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); + intel_crtc_free_hw_state(crtc_state); kfree(crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h b/drivers/gpu/drm/i915/display/intel_atomic.h index 58065d3161a3..42be91e0772a 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.h +++ b/drivers/gpu/drm/i915/display/intel_atomic.h @@ -35,6 +35,8 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector); struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc); void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state); +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state); struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); void intel_atomic_state_clear(struct drm_atomic_state *state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 11dd7a182543..2dbc1df9505a 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7110,6 +7110,8 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc, crtc->enabled = false; crtc->state->connector_mask = 0; crtc->state->encoder_mask = 0; + intel_crtc_free_hw_state(crtc_state); + memset(&crtc_state->hw,
[Intel-gfx] [PATCH 10/14] drm/i915: Perform manual conversions for plane uapi/hw split
get_crtc_from_states() is called before plane_state is copied to uapi, so use the uapi state there. intel_legacy_cursor_update() could probably get away with looking at the hw state, but for clarity look at the uapi state always Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 8 drivers/gpu/drm/i915/display/intel_display.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 4b12eeb6850d..0db20da7781c 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -186,11 +186,11 @@ static struct intel_crtc * get_crtc_from_states(const struct intel_plane_state *old_plane_state, const struct intel_plane_state *new_plane_state) { - if (new_plane_state->base.crtc) - return to_intel_crtc(new_plane_state->base.crtc); + if (new_plane_state->uapi.crtc) + return to_intel_crtc(new_plane_state->uapi.crtc); - if (old_plane_state->base.crtc) - return to_intel_crtc(old_plane_state->base.crtc); + if (old_plane_state->uapi.crtc) + return to_intel_crtc(old_plane_state->uapi.crtc); return NULL; } diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 2dbc1df9505a..26f86989f652 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -15173,12 +15173,12 @@ intel_legacy_cursor_update(struct drm_plane *_plane, * take the slowpath. Only changing fb or position should be * in the fastpath. */ - if (old_plane_state->base.crtc != &crtc->base || + if (old_plane_state->uapi.crtc != &crtc->base || old_plane_state->base.src_w != src_w || old_plane_state->base.src_h != src_h || old_plane_state->base.crtc_w != crtc_w || old_plane_state->base.crtc_h != crtc_h || - !old_plane_state->base.fb != !fb) + !old_plane_state->uapi.fb != !fb) goto slow; new_plane_state = to_intel_plane_state(intel_plane_duplicate_state(&plane->base)); -- 2.23.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 11/14] drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw.
Split up plane_state->base to hw. This is done using the following patch: @@ struct intel_plane_state *T; identifier x =~ "^(crtc|fb|alpha|pixel_blend_mode|rotation|color_encoding|color_range)$"; @@ -T->base.x +T->hw.x Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 6 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 6 +- drivers/gpu/drm/i915/display/intel_display.c | 127 +- drivers/gpu/drm/i915/display/intel_fbc.c | 8 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 76 +-- drivers/gpu/drm/i915/intel_pm.c | 36 ++--- 7 files changed, 131 insertions(+), 130 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 266d0ce9d03d..9ba50fd1116c 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -296,9 +296,9 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta return; /* set scaler mode */ - if (plane_state && plane_state->base.fb && - plane_state->base.fb->format->is_yuv && - plane_state->base.fb->format->num_planes > 1) { + if (plane_state && plane_state->hw.fb && + plane_state->hw.fb->format->is_yuv && + plane_state->hw.fb->format->num_planes > 1) { struct intel_plane *plane = to_intel_plane(plane_state->base.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 0db20da7781c..fd5a8012859c 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -118,7 +118,7 @@ intel_plane_destroy_state(struct drm_plane *plane, unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - const struct drm_framebuffer *fb = plane_state->base.fb; + const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; if (!plane_state->base.visible) @@ -144,7 +144,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); - const struct drm_framebuffer *fb = new_plane_state->base.fb; + const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; new_crtc_state->active_planes &= ~BIT(plane->id); @@ -153,7 +153,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->data_rate[plane->id] = 0; new_plane_state->base.visible = false; - if (!new_plane_state->base.crtc && !old_plane_state->base.crtc) + if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) return 0; ret = plane->check_plane(new_crtc_state, new_plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 26f86989f652..b689baebb4c2 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2202,7 +2202,7 @@ u32 intel_fb_xy_to_linear(int x, int y, const struct intel_plane_state *state, int color_plane) { - const struct drm_framebuffer *fb = state->base.fb; + const struct drm_framebuffer *fb = state->hw.fb; unsigned int cpp = fb->format->cpp[color_plane]; unsigned int pitch = state->color_plane[color_plane].stride; @@ -2303,8 +2303,8 @@ static u32 intel_plane_adjust_aligned_offset(int *x, int *y, int color_plane, u32 old_offset, u32 new_offset) { - return intel_adjust_aligned_offset(x, y, state->base.fb, color_plane, - state->base.rotation, + return intel_adjust_aligned_offset(x, y, state->hw.fb, color_plane, + state->hw.rotation, state->color_plane[color_plane].stride, old_offset, new_offset); } @@ -2380,8 +2380,8 @@ static u32 intel_plane_compute_aligned_offset(int *x, int *y, { struct intel_plane *intel_plane = to_intel_plane(state->base.plane); struct dr
[Intel-gfx] [PATCH 01/14] drm/i915: Rework watermark readout to use plane api
Instead of unconditionally verifying the cursor plane, handle it in the same way as any other plane, and use our existing api to verify. While at it, ensure that on gen9+ we verify active_planes mask as well. This should give the correct results for planar YUV planes too, as we update active_planes for them. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 83 ++-- 1 file changed, 23 insertions(+), 60 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 579655675b08..4e4273c4ae57 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -13183,7 +13183,8 @@ static void verify_wm_state(struct intel_crtc *crtc, struct skl_pipe_wm *sw_wm; struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry; const enum pipe pipe = crtc->pipe; - int plane, level, max_level = ilk_wm_max_level(dev_priv); + int level, max_level = ilk_wm_max_level(dev_priv); + struct intel_plane *plane; if (INTEL_GEN(dev_priv) < 9 || !new_crtc_state->base.active) return; @@ -13207,63 +13208,25 @@ static void verify_wm_state(struct intel_crtc *crtc, hw->ddb.enabled_slices); /* planes */ - for_each_universal_plane(dev_priv, pipe, plane) { + for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) { struct skl_plane_wm *hw_plane_wm, *sw_plane_wm; + enum pipe plane_pipe = pipe; - hw_plane_wm = &hw->wm.planes[plane]; - sw_plane_wm = &sw_wm->planes[plane]; - - /* Watermarks */ - for (level = 0; level <= max_level; level++) { - if (skl_wm_level_equals(&hw_plane_wm->wm[level], - &sw_plane_wm->wm[level])) - continue; - - DRM_ERROR("mismatch in WM pipe %c plane %d level %d (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n", - pipe_name(pipe), plane + 1, level, - sw_plane_wm->wm[level].plane_en, - sw_plane_wm->wm[level].plane_res_b, - sw_plane_wm->wm[level].plane_res_l, - hw_plane_wm->wm[level].plane_en, - hw_plane_wm->wm[level].plane_res_b, - hw_plane_wm->wm[level].plane_res_l); - } + hw_plane_wm = &hw->wm.planes[plane->id]; + sw_plane_wm = &sw_wm->planes[plane->id]; - if (!skl_wm_level_equals(&hw_plane_wm->trans_wm, -&sw_plane_wm->trans_wm)) { - DRM_ERROR("mismatch in trans WM pipe %c plane %d (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n", - pipe_name(pipe), plane + 1, - sw_plane_wm->trans_wm.plane_en, - sw_plane_wm->trans_wm.plane_res_b, - sw_plane_wm->trans_wm.plane_res_l, - hw_plane_wm->trans_wm.plane_en, - hw_plane_wm->trans_wm.plane_res_b, - hw_plane_wm->trans_wm.plane_res_l); - } - - /* DDB */ - hw_ddb_entry = &hw->ddb_y[plane]; - sw_ddb_entry = &new_crtc_state->wm.skl.plane_ddb_y[plane]; - - if (!skl_ddb_entry_equal(hw_ddb_entry, sw_ddb_entry)) { - DRM_ERROR("mismatch in DDB state pipe %c plane %d (expected (%u,%u), found (%u,%u))\n", - pipe_name(pipe), plane + 1, - sw_ddb_entry->start, sw_ddb_entry->end, - hw_ddb_entry->start, hw_ddb_entry->end); + if (!plane->get_hw_state(plane, &plane_pipe)) { + WARN(new_crtc_state->active_planes & BIT(plane->id), +"pipe %c %s should be visible, but isn't\n", +pipe_name(pipe), plane->base.name); + continue; } - } - /* -* cursor -* If the cursor plane isn't active, we may not have updated it's ddb -* allocation. In that case since the ddb allocation will be updated -* once the plane becomes visible, we can skip this check -*/ - if (1) { - struct skl_plane_wm *hw_plane_wm, *sw_plane_wm; + WARN_ON(plane_pipe != pipe); - hw_plan
[Intel-gfx] [PATCH 13/14] drm/i915: Complete plane hw and uapi split, v2.
Splitting plane state is easier than splitting crtc_state, before plane check we copy the drm properties to hw so we can do the same in bigjoiner later on. We copy the state after we did all the modeset handling, but fortunately i915 seems to be split correctly and nothing during modeset looks at plane_state. Changes since v1: - Do not clear hw state on duplication. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 37 ++- .../gpu/drm/i915/display/intel_atomic_plane.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 1 + .../drm/i915/display/intel_display_types.h| 23 +--- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index e4044abc2d21..d9b65e9c45fc 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -93,6 +93,10 @@ intel_plane_duplicate_state(struct drm_plane *plane) intel_state->vma = NULL; intel_state->flags = 0; + /* add reference to fb */ + if (intel_state->hw.fb) + drm_framebuffer_get(intel_state->hw.fb); + return &intel_state->uapi; } @@ -112,6 +116,8 @@ intel_plane_destroy_state(struct drm_plane *plane, WARN_ON(plane_state->vma); __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); kfree(plane_state); } @@ -138,15 +144,44 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, return cpp * crtc_state->pixel_rate; } +static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state) +{ + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); + + memset(&plane_state->hw, 0, sizeof(plane_state->hw)); +} + +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state) +{ + intel_plane_clear_hw_state(plane_state); + + plane_state->hw.crtc = from_plane_state->uapi.crtc; + plane_state->hw.fb = from_plane_state->uapi.fb; + if (plane_state->hw.fb) + drm_framebuffer_get(plane_state->hw.fb); + + plane_state->hw.alpha = from_plane_state->uapi.alpha; + plane_state->hw.pixel_blend_mode = + from_plane_state->uapi.pixel_blend_mode; + plane_state->hw.rotation = from_plane_state->uapi.rotation; + plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; + plane_state->hw.color_range = from_plane_state->uapi.color_range; +} + int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state, const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); - const struct drm_framebuffer *fb = new_plane_state->hw.fb; + const struct drm_framebuffer *fb; int ret; + intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state); + fb = new_plane_state->hw.fb; + new_crtc_state->active_planes &= ~BIT(plane->id); new_crtc_state->nv12_planes &= ~BIT(plane->id); new_crtc_state->c8_planes &= ~BIT(plane->id); diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index dc85af02e9b7..123404a9cf23 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -20,6 +20,8 @@ extern const struct drm_plane_helper_funcs intel_plane_helper_funcs; unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state); void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 12f230a41f2f..2330ac24fd4d 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -3267,6 +3267,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
[Intel-gfx] [PATCH 05/14] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
intel_get_load_detect_pipe() needs to set uapi active, uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), so we can remove it. intel_pipe_config_compare() needs to look at hw state, but I didn't change spatch to look at it. It's easy enough to do manually. intel_atomic_check() definitely needs to check for uapi enable, otherwise intel_modeset_pipe_config cannot copy uapi state to hw. Changes since v1: - Actually set uapi.active in get_load_detect_pipe(). Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 03d958b13789..71d38457df36 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11357,7 +11357,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, goto fail; } - crtc_state->base.active = crtc_state->base.enable = true; + crtc_state->uapi.active = true; if (!mode) mode = &load_detect_mode; @@ -13002,19 +13002,19 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_X(output_types); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_htotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_htotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vtotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vtotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_end); PIPE_CONF_CHECK_I(pixel_multiplier); PIPE_CONF_CHECK_I(output_format); @@ -13031,17 +13031,17 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_INTERLACE); if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS)) { - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PVSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NVSYNC); } @@ -13080,7 +13080,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, bp_gamma = intel_color_get_gamma_bit_precision(pipe_config); if (bp_gamma) - PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, base.gamma_lut, bp_gamma); + PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, hw.gamma_lut, bp_gamma); } @@ -13125,7 +13125,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5) PIPE_CONF_CHECK_I(pipe_bpp); - PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock); + PIPE_CONF_CHECK_CLOCK_FUZZY(hw.adjusted_mode.crtc_clock); PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock); PIPE_CONF_CHECK_I(min_voltage_level); @@ -13823,7 +13823,7 @@ static int intel_atomic_check(struct drm_device *dev,
[Intel-gfx] [PATCH 14/14] drm/i915: Remove special case slave handling during hw programming, v3.
Now that we split plane_state which I didn't want to do yet, we can program the slave plane without requiring the master plane. This is useful for programming bigjoiner slave planes as well. We will no longer need the master's plane_state. Changes since v1: - set src/dst rectangles after copy_uapi_to_hw_state. Changes since v2: - Use the correct color_plane for pre-gen11 by using planar_linked_plane != NULL. - Use drm_format_info_is_yuv_semiplanar in skl_plane_check() to fix gen11+. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 30 +- .../gpu/drm/i915/display/intel_atomic_plane.h | 3 - drivers/gpu/drm/i915/display/intel_display.c | 18 ++ .../drm/i915/display/intel_display_types.h| 6 +- drivers/gpu/drm/i915/display/intel_sprite.c | 57 ++- 5 files changed, 40 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index d9b65e9c45fc..54d112408716 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -309,16 +309,6 @@ void intel_update_plane(struct intel_plane *plane, plane->update_plane(plane, crtc_state, plane_state); } -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state) -{ - struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - - trace_intel_update_plane(&plane->base, crtc); - plane->update_slave(plane, crtc_state, plane_state); -} - void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { @@ -351,25 +341,9 @@ void skl_update_planes_on_crtc(struct intel_atomic_state *state, struct intel_plane_state *new_plane_state = intel_atomic_get_new_plane_state(state, plane); - if (new_plane_state->uapi.visible) { + if (new_plane_state->uapi.visible || + new_plane_state->planar_slave) { intel_update_plane(plane, new_crtc_state, new_plane_state); - } else if (new_plane_state->planar_slave) { - struct intel_plane *master = - new_plane_state->planar_linked_plane; - - /* -* We update the slave plane from this function because -* programming it from the master plane's update_plane -* callback runs into issues when the Y plane is -* reassigned, disabled or used by a different plane. -* -* The slave plane is updated with the master plane's -* plane_state. -*/ - new_plane_state = - intel_atomic_get_new_plane_state(state, master); - - intel_update_slave(plane, new_crtc_state, new_plane_state); } else { intel_disable_plane(plane, new_crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index 123404a9cf23..726ececd6abd 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -25,9 +25,6 @@ void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state); void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state); struct intel_plane *intel_plane_alloc(void); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 2330ac24fd4d..6374258b959e 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11911,6 +11911,24 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state) crtc_state->active_planes |= BIT(linked->id); crtc_state->update_planes |= BIT(linked->id); DRM_DEBUG_KMS("Using %s as Y plane for %s\n", linked->base.name, plane->base.name); + + /* Copy parameters to slave plane */ + linked_state->ctl = plane_state->ctl | PLANE_CTL_YUV420_Y_PLANE; +
[Intel-gfx] [PATCH 09/14] drm/i915: Add aliases for uapi and hw to plane_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c| 16 .../gpu/drm/i915/display/intel_display_types.h | 8 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index d92c185d4b4a..4b12eeb6850d 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -80,22 +80,20 @@ void intel_plane_free(struct intel_plane *plane) struct drm_plane_state * intel_plane_duplicate_state(struct drm_plane *plane) { - struct drm_plane_state *state; struct intel_plane_state *intel_state; - intel_state = kmemdup(plane->state, sizeof(*intel_state), GFP_KERNEL); + intel_state = to_intel_plane_state(plane->state); + intel_state = kmemdup(intel_state, sizeof(*intel_state), GFP_KERNEL); if (!intel_state) return NULL; - state = &intel_state->base; - - __drm_atomic_helper_plane_duplicate_state(plane, state); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); intel_state->vma = NULL; intel_state->flags = 0; - return state; + return &intel_state->base; } /** @@ -110,9 +108,11 @@ void intel_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *state) { - WARN_ON(to_intel_plane_state(state)->vma); + struct intel_plane_state *plane_state = to_intel_plane_state(state); + WARN_ON(plane_state->vma); - drm_atomic_helper_plane_destroy_state(plane, state); + __drm_atomic_helper_plane_destroy_state(&plane_state->base); + kfree(plane_state); } unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 17c9ec300f18..d2a984f84464 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -515,7 +515,11 @@ struct intel_atomic_state { }; struct intel_plane_state { - struct drm_plane_state base; + union { + struct drm_plane_state base; + struct drm_plane_state uapi; + struct drm_plane_state hw; + }; struct i915_ggtt_view view; struct i915_vma *vma; unsigned long flags; @@ -1131,7 +1135,7 @@ struct cxsr_latency { #define to_intel_encoder(x) container_of(x, struct intel_encoder, base) #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) #define to_intel_plane(x) container_of(x, struct intel_plane, base) -#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, base) +#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, uapi) #define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL) struct intel_hdmi { -- 2.23.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 12/14] drm/i915: Perform automated conversions for plane uapi/hw split, base -> uapi.
Split up plane_state->base to uapi. This is done using the following patch, ran after the previous commit that splits out any hw references: @@ struct intel_plane_state *T; identifier x; @@ -T->base.x +T->uapi.x @@ struct intel_plane_state *T; @@ -T->base +T->uapi Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 28 +- drivers/gpu/drm/i915/display/intel_display.c | 296 +- drivers/gpu/drm/i915/display/intel_fbc.c | 12 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 114 +++ drivers/gpu/drm/i915/intel_pm.c | 57 ++-- 7 files changed, 257 insertions(+), 254 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 9ba50fd1116c..4783d7ff4fcf 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -299,7 +299,7 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta if (plane_state && plane_state->hw.fb && plane_state->hw.fb->format->is_yuv && plane_state->hw.fb->format->num_planes > 1) { - struct intel_plane *plane = to_intel_plane(plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { mode = SKL_PS_SCALER_MODE_NV12; diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index fd5a8012859c..e4044abc2d21 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -56,7 +56,7 @@ struct intel_plane *intel_plane_alloc(void) return ERR_PTR(-ENOMEM); } - __drm_atomic_helper_plane_reset(&plane->base, &plane_state->base); + __drm_atomic_helper_plane_reset(&plane->base, &plane_state->uapi); plane_state->scaler_id = -1; return plane; @@ -88,12 +88,12 @@ intel_plane_duplicate_state(struct drm_plane *plane) if (!intel_state) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->uapi); intel_state->vma = NULL; intel_state->flags = 0; - return &intel_state->base; + return &intel_state->uapi; } /** @@ -111,7 +111,7 @@ intel_plane_destroy_state(struct drm_plane *plane, struct intel_plane_state *plane_state = to_intel_plane_state(state); WARN_ON(plane_state->vma); - __drm_atomic_helper_plane_destroy_state(&plane_state->base); + __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); kfree(plane_state); } @@ -121,7 +121,7 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; - if (!plane_state->base.visible) + if (!plane_state->uapi.visible) return 0; cpp = fb->format->cpp[0]; @@ -143,7 +143,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { - struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; @@ -151,7 +151,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->nv12_planes &= ~BIT(plane->id); new_crtc_state->c8_planes &= ~BIT(plane->id); new_crtc_state->data_rate[plane->id] = 0; - new_plane_state->base.visible = false; + new_plane_state->uapi.visible = false; if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) return 0; @@ -161,18 +161,18 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ return ret; /* FIXME pre-g4x don't work like this */ - if (new_plane_state->base.visible) + if (new_plane_state->uapi.visible) new_crtc_state->active_planes |= BIT(plane->id); - if (new_plane_state->base.visible && + if (new_plane_state->uapi.visible &
[Intel-gfx] [PATCH 06/14] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> hw.
Split up crtc_state->base to hw where appropriate. This is done using the following patch: @@ struct intel_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -T->base.x +T->hw.x @@ struct drm_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -to_intel_crtc_state(T)->base.x +to_intel_crtc_state(T)->hw.x Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/icl_dsi.c| 12 +- drivers/gpu/drm/i915/display/intel_audio.c| 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c| 8 +- drivers/gpu/drm/i915/display/intel_color.c| 108 drivers/gpu/drm/i915/display/intel_crt.c | 18 +- drivers/gpu/drm/i915/display/intel_ddi.c | 18 +- drivers/gpu/drm/i915/display/intel_display.c | 262 +- drivers/gpu/drm/i915/display/intel_dp.c | 22 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 6 +- drivers/gpu/drm/i915/display/intel_dvo.c | 12 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 20 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 8 +- drivers/gpu/drm/i915/display/intel_panel.c| 8 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 12 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 +- drivers/gpu/drm/i915/display/intel_sprite.c | 8 +- drivers/gpu/drm/i915/display/intel_tv.c | 4 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 4 +- drivers/gpu/drm/i915/display/vlv_dsi.c| 10 +- drivers/gpu/drm/i915/i915_debugfs.c | 8 +- drivers/gpu/drm/i915/intel_pm.c | 62 ++--- 24 files changed, 321 insertions(+), 317 deletions(-) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 6e398c33a524..4ec493e4755b 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -276,7 +276,7 @@ static void configure_dual_link_mode(struct intel_encoder *encoder, if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) { const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; u32 dss_ctl2; u16 hactive = adjusted_mode->crtc_hdisplay; u16 dl_buffer_depth; @@ -768,7 +768,7 @@ gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; enum port port; enum transcoder dsi_trans; /* horizontal timings */ @@ -1216,7 +1216,7 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder, { struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; if (intel_dsi->dual_link) { adjusted_mode->crtc_hdisplay *= 2; @@ -1249,9 +1249,9 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, pipe_config->port_clock = cnl_calc_wrpll_link(dev_priv, &pipe_config->dpll_hw_state); - pipe_config->base.adjusted_mode.crtc_clock = intel_dsi->pclk; + pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk; if (intel_dsi->dual_link) - pipe_config->base.adjusted_mode.crtc_clock *= 2; + pipe_config->hw.adjusted_mode.crtc_clock *= 2; gen11_dsi_get_timings(encoder, pipe_config); pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI); @@ -1269,7 +1269,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; intel_fixed_panel_mode(fixed_mode, adjusted_mode); diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_au
[Intel-gfx] [PATCH 03/14] drm/i915: Handle a few more cases for crtc hw/uapi split, v3.
We are still looking at drm_crtc_state in a few places, convert those to use intel_crtc_state instead. Changes since v1: - Move to before uapi/hw split. - Add hunks for intel_pm.c as well. Changes since v2: - Incorporate Ville's feedback. Signed-off-by: Maarten Lankhorst Reviewed-by: Matt Roper Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 15 --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 12 drivers/gpu/drm/i915/display/intel_psr.c | 16 +++- drivers/gpu/drm/i915/intel_pm.c | 6 ++ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 4e4273c4ae57..0c0dae8097b0 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -16528,8 +16528,7 @@ static int intel_initial_commit(struct drm_device *dev) { struct drm_atomic_state *state = NULL; struct drm_modeset_acquire_ctx ctx; - struct drm_crtc *crtc; - struct drm_crtc_state *crtc_state; + struct intel_crtc *crtc; int ret = 0; state = drm_atomic_state_alloc(dev); @@ -16541,15 +16540,17 @@ static int intel_initial_commit(struct drm_device *dev) retry: state->acquire_ctx = &ctx; - drm_for_each_crtc(crtc, dev) { - crtc_state = drm_atomic_get_crtc_state(state, crtc); + for_each_intel_crtc(dev, crtc) { + struct intel_crtc_state *crtc_state = + intel_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) { ret = PTR_ERR(crtc_state); goto out; } - if (crtc_state->active) { - ret = drm_atomic_add_affected_planes(state, crtc); + if (crtc_state->base.active) { + ret = drm_atomic_add_affected_planes(state, &crtc->base); if (ret) goto out; @@ -16559,7 +16560,7 @@ static int intel_initial_commit(struct drm_device *dev) * having a proper LUT loaded. Remove once we * have readout for pipe gamma enable. */ - crtc_state->color_mgmt_changed = true; + crtc_state->base.color_mgmt_changed = true; } } diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index bbcab27644dc..bb1b3180ccfd 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -168,7 +168,6 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, struct intel_connector *intel_connector = to_intel_connector(connector); struct drm_crtc *new_crtc = new_conn_state->crtc; - struct drm_crtc_state *crtc_state; struct drm_dp_mst_topology_mgr *mgr; int ret; @@ -183,11 +182,16 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, * connector */ if (new_crtc) { - crtc_state = drm_atomic_get_new_crtc_state(state, new_crtc); + struct intel_atomic_state *intel_state = + to_intel_atomic_state(state); + struct intel_crtc *intel_crtc = to_intel_crtc(new_crtc); + struct intel_crtc_state *crtc_state = + intel_atomic_get_new_crtc_state(intel_state, + intel_crtc); if (!crtc_state || - !drm_atomic_crtc_needs_modeset(crtc_state) || - crtc_state->enable) + !drm_atomic_crtc_needs_modeset(&crtc_state->base) || + crtc_state->base.enable) return 0; } diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index dfbedff98ea8..a8f3edc9c482 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -26,6 +26,7 @@ #include "display/intel_dp.h" #include "i915_drv.h" +#include "intel_atomic.h" #include "intel_display_types.h" #include "intel_psr.h" #include "intel_sprite.h" @@ -1116,7 +1117,7 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct drm_modeset_acquire_ctx ctx; struct drm_atomic_state *state; - struct drm_crtc *crtc; + struct intel_crtc *crtc; int err; state = drm_atomic_state_alloc(dev); @@ -1127,21 +1128,18 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) state->a
Re: [Intel-gfx] [PATCH 01/14] drm/i915: Rework watermark readout to use plane api
Op 24-10-2019 om 16:33 schreef Ville Syrjälä: > On Thu, Oct 24, 2019 at 02:47:52PM +0200, Maarten Lankhorst wrote: >> Instead of unconditionally verifying the cursor plane, handle it in the >> same way as any other plane, and use our existing api to verify. >> >> While at it, ensure that on gen9+ we verify active_planes mask as well. >> This should give the correct results for planar YUV planes too, as we >> update active_planes for them. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_display.c | 83 ++-- >> 1 file changed, 23 insertions(+), 60 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >> b/drivers/gpu/drm/i915/display/intel_display.c >> index 579655675b08..4e4273c4ae57 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -13183,7 +13183,8 @@ static void verify_wm_state(struct intel_crtc *crtc, >> struct skl_pipe_wm *sw_wm; >> struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry; >> const enum pipe pipe = crtc->pipe; >> -int plane, level, max_level = ilk_wm_max_level(dev_priv); >> +int level, max_level = ilk_wm_max_level(dev_priv); >> +struct intel_plane *plane; >> >> if (INTEL_GEN(dev_priv) < 9 || !new_crtc_state->base.active) >> return; >> @@ -13207,63 +13208,25 @@ static void verify_wm_state(struct intel_crtc >> *crtc, >>hw->ddb.enabled_slices); >> >> /* planes */ >> -for_each_universal_plane(dev_priv, pipe, plane) { >> +for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) { >> struct skl_plane_wm *hw_plane_wm, *sw_plane_wm; >> +enum pipe plane_pipe = pipe; >> >> -hw_plane_wm = &hw->wm.planes[plane]; >> -sw_plane_wm = &sw_wm->planes[plane]; >> - >> -/* Watermarks */ >> -for (level = 0; level <= max_level; level++) { >> -if (skl_wm_level_equals(&hw_plane_wm->wm[level], >> -&sw_plane_wm->wm[level])) >> -continue; >> - >> -DRM_ERROR("mismatch in WM pipe %c plane %d level %d >> (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n", >> - pipe_name(pipe), plane + 1, level, >> - sw_plane_wm->wm[level].plane_en, >> - sw_plane_wm->wm[level].plane_res_b, >> - sw_plane_wm->wm[level].plane_res_l, >> - hw_plane_wm->wm[level].plane_en, >> - hw_plane_wm->wm[level].plane_res_b, >> - hw_plane_wm->wm[level].plane_res_l); >> -} >> +hw_plane_wm = &hw->wm.planes[plane->id]; >> +sw_plane_wm = &sw_wm->planes[plane->id]; >> >> -if (!skl_wm_level_equals(&hw_plane_wm->trans_wm, >> - &sw_plane_wm->trans_wm)) { >> -DRM_ERROR("mismatch in trans WM pipe %c plane %d >> (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n", >> - pipe_name(pipe), plane + 1, >> - sw_plane_wm->trans_wm.plane_en, >> - sw_plane_wm->trans_wm.plane_res_b, >> - sw_plane_wm->trans_wm.plane_res_l, >> - hw_plane_wm->trans_wm.plane_en, >> - hw_plane_wm->trans_wm.plane_res_b, >> - hw_plane_wm->trans_wm.plane_res_l); >> -} >> - >> -/* DDB */ >> -hw_ddb_entry = &hw->ddb_y[plane]; >> -sw_ddb_entry = &new_crtc_state->wm.skl.plane_ddb_y[plane]; >> - >> -if (!skl_ddb_entry_equal(hw_ddb_entry, sw_ddb_entry)) { >> -DRM_ERROR("mismatch in DDB state pipe %c plane %d >> (expected (%u,%u), found (%u,%u))\n", >> - pipe_name(pipe), plane + 1, >> - sw_ddb_entry->start, sw_ddb_entry->end, >> - hw_ddb_entry->start, hw_ddb_entry->end); >> +if (!plane->get_hw_state(plane, &plane_pipe)) { >> +
Re: [Intel-gfx] [PATCH 08/14] drm/i915: Complete crtc hw/uapi split, v3.
Op 24-10-2019 om 17:21 schreef Ville Syrjälä: > On Thu, Oct 24, 2019 at 02:47:59PM +0200, Maarten Lankhorst wrote: >> Now that we separated everything into uapi and hw, it's >> time to make the split definitive. Remove the union and >> make a copy of the hw state on modeset and fastset. >> >> Color blobs are copied in crtc atomic_check(), right >> before color management is checked. >> >> Changes since v1: >> - Copy all blobs immediately after drm_atomic_helper_check_modeset(). >> - Clear crtc_state->hw on disable, instead of using clear_intel_crtc_state(). >> Changes since v2: >> - Use intel_crtc_free_hw_state + clear in intel_crtc_disable_noatomic(). >> - Make a intel_crtc_prepare_state() function that clears the crtc_state >> and copies hw members. >> - Remove setting uapi.adjusted_mode, we now have a direct call to >> drm_calc_timestamping_constants(). >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_atomic.c | 44 +++ >> drivers/gpu/drm/i915/display/intel_atomic.h | 2 + >> drivers/gpu/drm/i915/display/intel_display.c | 56 +++ >> .../drm/i915/display/intel_display_types.h| 9 +-- >> 4 files changed, 95 insertions(+), 16 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c >> b/drivers/gpu/drm/i915/display/intel_atomic.c >> index 7cf13b9c7d38..266d0ce9d03d 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c >> @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) >> >> __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); >> >> +/* copy color blobs */ >> +if (crtc_state->hw.degamma_lut) >> +drm_property_blob_get(crtc_state->hw.degamma_lut); >> +if (crtc_state->hw.ctm) >> +drm_property_blob_get(crtc_state->hw.ctm); >> +if (crtc_state->hw.gamma_lut) >> +drm_property_blob_get(crtc_state->hw.gamma_lut); >> + >> crtc_state->update_pipe = false; >> crtc_state->disable_lp_wm = false; >> crtc_state->disable_cxsr = false; >> @@ -208,6 +216,41 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) >> return &crtc_state->uapi; >> } >> >> +static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state) >> +{ >> +drm_property_blob_put(crtc_state->hw.degamma_lut); >> +drm_property_blob_put(crtc_state->hw.gamma_lut); >> +drm_property_blob_put(crtc_state->hw.ctm); >> +} >> + >> +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) >> +{ >> +intel_crtc_put_color_blobs(crtc_state); >> +} >> + >> +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) > This is only used in intel_display.c so should perhaps live there? > >> +{ >> +intel_crtc_put_color_blobs(crtc_state); >> + >> +if (crtc_state->uapi.degamma_lut) >> +crtc_state->hw.degamma_lut = >> +drm_property_blob_get(crtc_state->uapi.degamma_lut); >> +else >> +crtc_state->hw.degamma_lut = NULL; >> + >> +if (crtc_state->uapi.gamma_lut) >> +crtc_state->hw.gamma_lut = >> +drm_property_blob_get(crtc_state->uapi.gamma_lut); >> +else >> +crtc_state->hw.gamma_lut = NULL; >> + >> +if (crtc_state->uapi.ctm) >> +crtc_state->hw.ctm = >> +drm_property_blob_get(crtc_state->uapi.ctm); >> +else >> +crtc_state->hw.ctm = NULL; >> +} >> + >> /** >> * intel_crtc_destroy_state - destroy crtc state >> * @crtc: drm crtc >> @@ -223,6 +266,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, >> struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); >> >> __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); >> +intel_crtc_free_hw_state(crtc_state); >> kfree(crtc_state); >> } >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h >> b/drivers/gpu/drm/i915/display/intel_atomic.h >> index 58065d3161a3..42be91e0772a 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.h >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.h >> @@ -35,6 +35,8 @@ intel_digital_connector_duplicate_state(struct >> drm_connector *connector); >> struct dr
Re: [Intel-gfx] [PATCH 08/14] drm/i915: Complete crtc hw/uapi split, v3.
Op 25-10-2019 om 12:13 schreef Ville Syrjälä: > On Fri, Oct 25, 2019 at 11:00:06AM +0200, Maarten Lankhorst wrote: >> Op 24-10-2019 om 17:21 schreef Ville Syrjälä: >>> On Thu, Oct 24, 2019 at 02:47:59PM +0200, Maarten Lankhorst wrote: >>>> Now that we separated everything into uapi and hw, it's >>>> time to make the split definitive. Remove the union and >>>> make a copy of the hw state on modeset and fastset. >>>> >>>> Color blobs are copied in crtc atomic_check(), right >>>> before color management is checked. >>>> >>>> Changes since v1: >>>> - Copy all blobs immediately after drm_atomic_helper_check_modeset(). >>>> - Clear crtc_state->hw on disable, instead of using >>>> clear_intel_crtc_state(). >>>> Changes since v2: >>>> - Use intel_crtc_free_hw_state + clear in intel_crtc_disable_noatomic(). >>>> - Make a intel_crtc_prepare_state() function that clears the crtc_state >>>> and copies hw members. >>>> - Remove setting uapi.adjusted_mode, we now have a direct call to >>>> drm_calc_timestamping_constants(). >>>> >>>> Signed-off-by: Maarten Lankhorst >>>> --- >>>> drivers/gpu/drm/i915/display/intel_atomic.c | 44 +++ >>>> drivers/gpu/drm/i915/display/intel_atomic.h | 2 + >>>> drivers/gpu/drm/i915/display/intel_display.c | 56 +++ >>>> .../drm/i915/display/intel_display_types.h| 9 +-- >>>> 4 files changed, 95 insertions(+), 16 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c >>>> b/drivers/gpu/drm/i915/display/intel_atomic.c >>>> index 7cf13b9c7d38..266d0ce9d03d 100644 >>>> --- a/drivers/gpu/drm/i915/display/intel_atomic.c >>>> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c >>>> @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) >>>> >>>>__drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); >>>> >>>> + /* copy color blobs */ >>>> + if (crtc_state->hw.degamma_lut) >>>> + drm_property_blob_get(crtc_state->hw.degamma_lut); >>>> + if (crtc_state->hw.ctm) >>>> + drm_property_blob_get(crtc_state->hw.ctm); >>>> + if (crtc_state->hw.gamma_lut) >>>> + drm_property_blob_get(crtc_state->hw.gamma_lut); >>>> + >>>>crtc_state->update_pipe = false; >>>>crtc_state->disable_lp_wm = false; >>>>crtc_state->disable_cxsr = false; >>>> @@ -208,6 +216,41 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) >>>>return &crtc_state->uapi; >>>> } >>>> >>>> +static void intel_crtc_put_color_blobs(struct intel_crtc_state >>>> *crtc_state) >>>> +{ >>>> + drm_property_blob_put(crtc_state->hw.degamma_lut); >>>> + drm_property_blob_put(crtc_state->hw.gamma_lut); >>>> + drm_property_blob_put(crtc_state->hw.ctm); >>>> +} >>>> + >>>> +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) >>>> +{ >>>> + intel_crtc_put_color_blobs(crtc_state); >>>> +} >>>> + >>>> +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) >>> This is only used in intel_display.c so should perhaps live there? >>> >>>> +{ >>>> + intel_crtc_put_color_blobs(crtc_state); >>>> + >>>> + if (crtc_state->uapi.degamma_lut) >>>> + crtc_state->hw.degamma_lut = >>>> + drm_property_blob_get(crtc_state->uapi.degamma_lut); >>>> + else >>>> + crtc_state->hw.degamma_lut = NULL; >>>> + >>>> + if (crtc_state->uapi.gamma_lut) >>>> + crtc_state->hw.gamma_lut = >>>> + drm_property_blob_get(crtc_state->uapi.gamma_lut); >>>> + else >>>> + crtc_state->hw.gamma_lut = NULL; >>>> + >>>> + if (crtc_state->uapi.ctm) >>>> + crtc_state->hw.ctm = >>>> + drm_property_blob_get(crtc_state->uapi.ctm); >>>> + else >>>> + crtc_state->hw.ctm = NULL; >>>> +} >>>> + >>>> /** >>>> * intel_crtc_destroy_state - destroy crtc s
Re: [Intel-gfx] [PATCH 1/6] drm/i915: Fix i845/i865 cursor width
Op 28-10-2019 om 12:30 schreef Ville Syrjala: > From: Ville Syrjälä > > The change from the uapi coordinates to the internal coordinates > broke the cursor on i845/i865 due to src and dst getting swapped. > Fix it. > > Cc: Maarten Lankhorst > Fixes: 3a612765f423 ("drm/i915: Remove cursor use of properties for > coordinates") > Signed-off-by: Ville Syrjälä > --- > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 0f0c582a56d5..47a3aef0fb61 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -10947,7 +10947,7 @@ static void i845_update_cursor(struct intel_plane > *plane, > unsigned long irqflags; > > if (plane_state && plane_state->base.visible) { > - unsigned int width = drm_rect_width(&plane_state->base.src); > + unsigned int width = drm_rect_width(&plane_state->base.dst); > unsigned int height = drm_rect_height(&plane_state->base.dst); > > cntl = plane_state->ctl | Yeah, I guess theoretically fixes, should be ok regardless because no scaling is supported on the cursor so rectangles are identical. :) Reviewed-by: Maarten Lankhorst ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 1/6] drm/i915: Fix i845/i865 cursor width
Op 28-10-2019 om 16:05 schreef Ville Syrjälä: > On Mon, Oct 28, 2019 at 03:20:34PM +0100, Maarten Lankhorst wrote: >> Op 28-10-2019 om 12:30 schreef Ville Syrjala: >>> From: Ville Syrjälä >>> >>> The change from the uapi coordinates to the internal coordinates >>> broke the cursor on i845/i865 due to src and dst getting swapped. >>> Fix it. >>> >>> Cc: Maarten Lankhorst >>> Fixes: 3a612765f423 ("drm/i915: Remove cursor use of properties for >>> coordinates") >>> Signed-off-by: Ville Syrjälä >>> --- >>> drivers/gpu/drm/i915/display/intel_display.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >>> b/drivers/gpu/drm/i915/display/intel_display.c >>> index 0f0c582a56d5..47a3aef0fb61 100644 >>> --- a/drivers/gpu/drm/i915/display/intel_display.c >>> +++ b/drivers/gpu/drm/i915/display/intel_display.c >>> @@ -10947,7 +10947,7 @@ static void i845_update_cursor(struct intel_plane >>> *plane, >>> unsigned long irqflags; >>> >>> if (plane_state && plane_state->base.visible) { >>> - unsigned int width = drm_rect_width(&plane_state->base.src); >>> + unsigned int width = drm_rect_width(&plane_state->base.dst); >>> unsigned int height = drm_rect_height(&plane_state->base.dst); >>> >>> cntl = plane_state->ctl | >> Yeah, I guess theoretically fixes, should be ok regardless because no >> scaling is supported on the cursor so rectangles are identical. :) > No. One is .16 fixed point other is integer. Ie. totally broken atm, > as proven by the cursor being smeared over the whole screen on my i865. > Ah right, missed that. :) ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [CI 01/12] drm/i915: Introduce intel_atomic_get_plane_state_after_check(), v2.
Use this in all the places where we try to acquire planes after the planes atomic_check(). In case of intel_modeset_all_pipes() this is not yet done after atomic_check, but seems like it will be in the future. To add some paranoia, add all planes rather than active planes, because of bigjoiner and planar YUV support having extra planes outside of the core's view that wouldn't be added otherwise. Changes since v1: - Always add all planes, to handle force plane updates to work correctly with a disabled cursor plane. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 41 +-- .../gpu/drm/i915/display/intel_atomic_plane.c | 15 +++ drivers/gpu/drm/i915/display/intel_cdclk.c| 15 --- drivers/gpu/drm/i915/display/intel_color.c| 7 ++-- .../drm/i915/display/intel_display_types.h| 6 +++ drivers/gpu/drm/i915/intel_pm.c | 14 --- 6 files changed, 62 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 9cd6d2348a1e..80df6c233581 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -313,13 +313,10 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state) { - struct drm_plane *plane = NULL; - struct intel_plane *intel_plane; - struct intel_plane_state *plane_state = NULL; struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; struct drm_atomic_state *drm_state = crtc_state->base.state; - struct intel_atomic_state *intel_state = to_intel_atomic_state(drm_state); + struct intel_atomic_state *state = to_intel_atomic_state(drm_state); int num_scalers_need; int i; @@ -346,6 +343,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, /* walkthrough scaler_users bits and start assigning scalers */ for (i = 0; i < sizeof(scaler_state->scaler_users) * 8; i++) { + struct intel_plane_state *plane_state = NULL; int *scaler_id; const char *name; int idx; @@ -361,19 +359,16 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, /* panel fitter case: assign as a crtc scaler */ scaler_id = &scaler_state->scaler_id; } else { - name = "PLANE"; + struct intel_plane *plane; /* plane scaler case: assign as a plane scaler */ /* find the plane that set the bit as scaler_user */ - plane = drm_state->planes[i].ptr; /* * to enable/disable hq mode, add planes that are using scaler * into this transaction */ - if (!plane) { - struct drm_plane_state *state; - + if (!drm_state->planes[i].ptr) { /* * GLK+ scalers don't have a HQ mode so it * isn't necessary to change between HQ and dyn mode @@ -382,24 +377,28 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) continue; - plane = drm_plane_from_index(&dev_priv->drm, i); - state = drm_atomic_get_plane_state(drm_state, plane); - if (IS_ERR(state)) { - DRM_DEBUG_KMS("Failed to add [PLANE:%d] to drm_state\n", - plane->base.id); - return PTR_ERR(state); + plane = to_intel_plane(drm_plane_from_index(&dev_priv->drm, i)); + plane_state = + intel_atomic_get_plane_state_after_check(state, + crtc_state, + plane); + if (IS_ERR(plane_state)) { + DRM_DEBUG_KMS("Failed to add [PLANE:%d] to drm_state: %li\n", + plane->base.base.id, PTR_ERR(plane_state)); + return PTR_ERR(plane_state);
[Intel-gfx] [CI 02/12] drm/i915: Handle a few more cases for crtc hw/uapi split, v3.
We are still looking at drm_crtc_state in a few places, convert those to use intel_crtc_state instead. Changes since v1: - Move to before uapi/hw split. - Add hunks for intel_pm.c as well. Changes since v2: - Incorporate Ville's feedback. Signed-off-by: Maarten Lankhorst Reviewed-by: Matt Roper Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 15 --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 12 drivers/gpu/drm/i915/display/intel_psr.c | 16 +++- drivers/gpu/drm/i915/intel_pm.c | 6 ++ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 9dce2e9e5376..9a7c15fad367 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -16720,8 +16720,7 @@ static int intel_initial_commit(struct drm_device *dev) { struct drm_atomic_state *state = NULL; struct drm_modeset_acquire_ctx ctx; - struct drm_crtc *crtc; - struct drm_crtc_state *crtc_state; + struct intel_crtc *crtc; int ret = 0; state = drm_atomic_state_alloc(dev); @@ -16733,15 +16732,17 @@ static int intel_initial_commit(struct drm_device *dev) retry: state->acquire_ctx = &ctx; - drm_for_each_crtc(crtc, dev) { - crtc_state = drm_atomic_get_crtc_state(state, crtc); + for_each_intel_crtc(dev, crtc) { + struct intel_crtc_state *crtc_state = + intel_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) { ret = PTR_ERR(crtc_state); goto out; } - if (crtc_state->active) { - ret = drm_atomic_add_affected_planes(state, crtc); + if (crtc_state->base.active) { + ret = drm_atomic_add_affected_planes(state, &crtc->base); if (ret) goto out; @@ -16751,7 +16752,7 @@ static int intel_initial_commit(struct drm_device *dev) * having a proper LUT loaded. Remove once we * have readout for pipe gamma enable. */ - crtc_state->color_mgmt_changed = true; + crtc_state->base.color_mgmt_changed = true; } } diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index a9962846a503..42d26214fb23 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -168,7 +168,6 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, struct intel_connector *intel_connector = to_intel_connector(connector); struct drm_crtc *new_crtc = new_conn_state->crtc; - struct drm_crtc_state *crtc_state; struct drm_dp_mst_topology_mgr *mgr; int ret; @@ -183,11 +182,16 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, * connector */ if (new_crtc) { - crtc_state = drm_atomic_get_new_crtc_state(state, new_crtc); + struct intel_atomic_state *intel_state = + to_intel_atomic_state(state); + struct intel_crtc *intel_crtc = to_intel_crtc(new_crtc); + struct intel_crtc_state *crtc_state = + intel_atomic_get_new_crtc_state(intel_state, + intel_crtc); if (!crtc_state || - !drm_atomic_crtc_needs_modeset(crtc_state) || - crtc_state->enable) + !drm_atomic_crtc_needs_modeset(&crtc_state->base) || + crtc_state->base.enable) return 0; } diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 6a9f322d3fca..359a60762b49 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -26,6 +26,7 @@ #include "display/intel_dp.h" #include "i915_drv.h" +#include "intel_atomic.h" #include "intel_display_types.h" #include "intel_psr.h" #include "intel_sprite.h" @@ -1096,7 +1097,7 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct drm_modeset_acquire_ctx ctx; struct drm_atomic_state *state; - struct drm_crtc *crtc; + struct intel_crtc *crtc; int err; state = drm_atomic_state_alloc(dev); @@ -1107,21 +1108,18 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) state->a
[Intel-gfx] [CI 03/12] drm/i915: Add aliases for uapi and hw to crtc_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 8 -- drivers/gpu/drm/i915/display/intel_display.c | 2 ++ drivers/gpu/drm/i915/display/intel_display.h | 6 ++--- .../drm/i915/display/intel_display_types.h| 27 ++- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 80df6c233581..619e7da4e4a5 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -186,9 +186,10 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector) struct drm_crtc_state * intel_crtc_duplicate_state(struct drm_crtc *crtc) { + const struct intel_crtc_state *old_crtc_state = to_intel_crtc_state(crtc->state); struct intel_crtc_state *crtc_state; - crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL); + crtc_state = kmemdup(old_crtc_state, sizeof(*crtc_state), GFP_KERNEL); if (!crtc_state) return NULL; @@ -219,7 +220,10 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { - drm_atomic_helper_crtc_destroy_state(crtc, state); + struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); + + __drm_atomic_helper_crtc_destroy_state(&crtc_state->base); + kfree(crtc_state); } static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state, diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 9a7c15fad367..d0df9b24a969 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -12595,6 +12595,8 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) /* Keep base drm_crtc_state intact, only clear our extended struct */ BUILD_BUG_ON(offsetof(struct intel_crtc_state, base)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, uapi)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, hw)); memcpy(&crtc_state->base + 1, &saved_state->base + 1, sizeof(*crtc_state) - sizeof(crtc_state->base)); diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index ca7ca2804d8b..ca3eb6a1c125 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -447,10 +447,10 @@ enum phy_fia { #define intel_atomic_crtc_state_for_each_plane_state( \ plane, plane_state, \ crtc_state) \ - for_each_intel_plane_mask(((crtc_state)->base.state->dev), (plane), \ - ((crtc_state)->base.plane_mask)) \ + for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (plane), \ + ((crtc_state)->uapi.plane_mask)) \ for_each_if ((plane_state = \ - to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->base.state, &plane->base + to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &plane->base void intel_link_compute_m_n(u16 bpp, int nlanes, int pixel_clock, int link_clock, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 61e9db041613..573ced9dc909 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -757,7 +757,32 @@ enum intel_output_format { }; struct intel_crtc_state { + union { struct drm_crtc_state base; + /* +* uapi (drm) state. This is the software state shown to userspace. +* In particular, the following members are used for bookkeeping: +* - crtc +* - state +* - *_changed +* - event +* - commit +* - mode_blob +*/ + struct drm_crtc_state uapi; + + /* +* actual hardware state, the state we program to the hardware. +* The following members are used to verify the hardware state: +* - enable +* - active +* - mode / adjusted_mode +* - color property blobs. +* +* During initial hw readout, they need to be copied to uapi. +*/ + struct drm_crtc_state hw; + }; /** * quirks - bitfield with hw state readout quirks @@ -1112,7 +1137,7 @@ struct cxsr_latency { #define to_intel_atomic_state(x) container_of(x, struct intel_a
[Intel-gfx] [CI 05/12] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> hw.
Split up crtc_state->base to hw where appropriate. This is done using the following patch: @@ struct intel_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -T->base.x +T->hw.x @@ struct drm_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -to_intel_crtc_state(T)->base.x +to_intel_crtc_state(T)->hw.x Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + drivers/gpu/drm/i915/display/icl_dsi.c| 12 +- drivers/gpu/drm/i915/display/intel_audio.c| 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c| 8 +- drivers/gpu/drm/i915/display/intel_color.c| 108 drivers/gpu/drm/i915/display/intel_crt.c | 18 +- drivers/gpu/drm/i915/display/intel_ddi.c | 18 +- drivers/gpu/drm/i915/display/intel_display.c | 260 +- drivers/gpu/drm/i915/display/intel_dp.c | 22 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 6 +- drivers/gpu/drm/i915/display/intel_dvo.c | 12 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 20 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 8 +- drivers/gpu/drm/i915/display/intel_panel.c| 8 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 12 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 +- drivers/gpu/drm/i915/display/intel_sprite.c | 8 +- drivers/gpu/drm/i915/display/intel_tv.c | 4 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 4 +- drivers/gpu/drm/i915/display/vlv_dsi.c| 10 +- drivers/gpu/drm/i915/i915_debugfs.c | 8 +- drivers/gpu/drm/i915/intel_pm.c | 56 ++-- 25 files changed, 318 insertions(+), 313 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 85bef73a6763..fddea7acf7d8 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -33,6 +33,7 @@ #include #include #include +#include #endif #include diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 6e398c33a524..4ec493e4755b 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -276,7 +276,7 @@ static void configure_dual_link_mode(struct intel_encoder *encoder, if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) { const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; u32 dss_ctl2; u16 hactive = adjusted_mode->crtc_hdisplay; u16 dl_buffer_depth; @@ -768,7 +768,7 @@ gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; enum port port; enum transcoder dsi_trans; /* horizontal timings */ @@ -1216,7 +1216,7 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder, { struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; if (intel_dsi->dual_link) { adjusted_mode->crtc_hdisplay *= 2; @@ -1249,9 +1249,9 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, pipe_config->port_clock = cnl_calc_wrpll_link(dev_priv, &pipe_config->dpll_hw_state); - pipe_config->base.adjusted_mode.crtc_clock = intel_dsi->pclk; + pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk; if (intel_dsi->dual_link) - pipe_config->base.adjusted_mode.crtc_clock *= 2; + pipe_config->hw.adjusted_mode.crtc_clock *= 2; gen11_dsi_get_timings(encoder, pipe_config); pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI); @@ -1269,7 +1269,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; struct drm_display_mode *adjusted_mode = -
[Intel-gfx] [CI 07/12] drm/i915: Complete crtc hw/uapi split, v4.
Now that we separated everything into uapi and hw, it's time to make the split definitive. Remove the union and make a copy of the hw state on modeset and fastset. Color blobs are copied in crtc atomic_check(), right before color management is checked. Changes since v1: - Copy all blobs immediately after drm_atomic_helper_check_modeset(). - Clear crtc_state->hw on disable, instead of using clear_intel_crtc_state(). Changes since v2: - Use intel_crtc_free_hw_state + clear in intel_crtc_disable_noatomic(). - Make a intel_crtc_prepare_state() function that clears the crtc_state and copies hw members. - Remove setting uapi.adjusted_mode, we now have a direct call to drm_calc_timestamping_constants(). Changes since v3: - Rename prefix copy_hw_to_uapi_state() with intel_crtc. - Copy color blobs to uapi as well. - Add a intel_crtc_copy_uapi_to_hw_state_nomodeset() function for clarity. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 44 ++ drivers/gpu/drm/i915/display/intel_atomic.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 80 --- .../drm/i915/display/intel_display_types.h| 9 ++- 4 files changed, 118 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 366275dc113d..557178906ccf 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); + /* copy color blobs */ + if (crtc_state->hw.degamma_lut) + drm_property_blob_get(crtc_state->hw.degamma_lut); + if (crtc_state->hw.ctm) + drm_property_blob_get(crtc_state->hw.ctm); + if (crtc_state->hw.gamma_lut) + drm_property_blob_get(crtc_state->hw.gamma_lut); + crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; @@ -208,6 +216,41 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) return &crtc_state->uapi; } +static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state) +{ + drm_property_blob_put(crtc_state->hw.degamma_lut); + drm_property_blob_put(crtc_state->hw.gamma_lut); + drm_property_blob_put(crtc_state->hw.ctm); +} + +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); +} + +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); + + if (crtc_state->uapi.degamma_lut) + crtc_state->hw.degamma_lut = + drm_property_blob_get(crtc_state->uapi.degamma_lut); + else + crtc_state->hw.degamma_lut = NULL; + + if (crtc_state->uapi.gamma_lut) + crtc_state->hw.gamma_lut = + drm_property_blob_get(crtc_state->uapi.gamma_lut); + else + crtc_state->hw.gamma_lut = NULL; + + if (crtc_state->uapi.ctm) + crtc_state->hw.ctm = + drm_property_blob_get(crtc_state->uapi.ctm); + else + crtc_state->hw.ctm = NULL; +} + /** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc @@ -223,6 +266,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); + intel_crtc_free_hw_state(crtc_state); kfree(crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h b/drivers/gpu/drm/i915/display/intel_atomic.h index 49d5cb1b9e0a..7b49623419ba 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.h +++ b/drivers/gpu/drm/i915/display/intel_atomic.h @@ -36,6 +36,8 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector); struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc); void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state); +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state); struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); void intel_atomic_state_clear(struct drm_atomic_state *state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 1bc008c094e4..a765794597ed 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7185,6 +7185,8 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc,
[Intel-gfx] [CI 10/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw.
Split up plane_state->base to hw. This is done using the following patch: @@ struct intel_plane_state *T; identifier x =~ "^(crtc|fb|alpha|pixel_blend_mode|rotation|color_encoding|color_range)$"; @@ -T->base.x +T->hw.x Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 6 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 6 +- drivers/gpu/drm/i915/display/intel_display.c | 133 +- drivers/gpu/drm/i915/display/intel_fbc.c | 8 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 90 ++-- drivers/gpu/drm/i915/intel_pm.c | 32 ++--- 7 files changed, 139 insertions(+), 138 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 557178906ccf..fb4126de994d 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -296,9 +296,9 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta return; /* set scaler mode */ - if (plane_state && plane_state->base.fb && - plane_state->base.fb->format->is_yuv && - plane_state->base.fb->format->num_planes > 1) { + if (plane_state && plane_state->hw.fb && + plane_state->hw.fb->format->is_yuv && + plane_state->hw.fb->format->num_planes > 1) { struct intel_plane *plane = to_intel_plane(plane_state->base.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 987f7545d45f..cac1d6ae67f6 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -118,7 +118,7 @@ intel_plane_destroy_state(struct drm_plane *plane, unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - const struct drm_framebuffer *fb = plane_state->base.fb; + const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; if (!plane_state->base.visible) @@ -182,7 +182,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); - const struct drm_framebuffer *fb = new_plane_state->base.fb; + const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; new_crtc_state->active_planes &= ~BIT(plane->id); @@ -192,7 +192,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->min_cdclk[plane->id] = 0; new_plane_state->base.visible = false; - if (!new_plane_state->base.crtc && !old_plane_state->base.crtc) + if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) return 0; ret = plane->check_plane(new_crtc_state, new_plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index cd9d68245f53..fbbe6f752716 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2215,7 +2215,7 @@ u32 intel_fb_xy_to_linear(int x, int y, const struct intel_plane_state *state, int color_plane) { - const struct drm_framebuffer *fb = state->base.fb; + const struct drm_framebuffer *fb = state->hw.fb; unsigned int cpp = fb->format->cpp[color_plane]; unsigned int pitch = state->color_plane[color_plane].stride; @@ -2316,8 +2316,8 @@ static u32 intel_plane_adjust_aligned_offset(int *x, int *y, int color_plane, u32 old_offset, u32 new_offset) { - return intel_adjust_aligned_offset(x, y, state->base.fb, color_plane, - state->base.rotation, + return intel_adjust_aligned_offset(x, y, state->hw.fb, color_plane, + state->hw.rotation, state->color_plane[color_plane].stride, old_offset, new_offset); } @@ -2393,8 +2393,8 @@ static u32 intel_plane_compute_aligned_offset(int *x, int *y, { struct intel_plane *intel_plane = to_intel_plane(state->base.plane); struct dr
[Intel-gfx] [CI 11/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> uapi.
Split up plane_state->base to uapi. This is done using the following patch, ran after the previous commit that splits out any hw references: @@ struct intel_plane_state *T; identifier x; @@ -T->base.x +T->uapi.x @@ struct intel_plane_state *T; @@ -T->base +T->uapi Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 32 +- drivers/gpu/drm/i915/display/intel_display.c | 298 +- drivers/gpu/drm/i915/display/intel_fbc.c | 12 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 136 drivers/gpu/drm/i915/intel_pm.c | 57 ++-- 7 files changed, 271 insertions(+), 268 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index fb4126de994d..cb5c914f627f 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -299,7 +299,7 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta if (plane_state && plane_state->hw.fb && plane_state->hw.fb->format->is_yuv && plane_state->hw.fb->format->num_planes > 1) { - struct intel_plane *plane = to_intel_plane(plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { mode = SKL_PS_SCALER_MODE_NV12; diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index cac1d6ae67f6..ba7d5421f791 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -56,7 +56,7 @@ struct intel_plane *intel_plane_alloc(void) return ERR_PTR(-ENOMEM); } - __drm_atomic_helper_plane_reset(&plane->base, &plane_state->base); + __drm_atomic_helper_plane_reset(&plane->base, &plane_state->uapi); plane_state->scaler_id = -1; return plane; @@ -88,12 +88,12 @@ intel_plane_duplicate_state(struct drm_plane *plane) if (!intel_state) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->uapi); intel_state->vma = NULL; intel_state->flags = 0; - return &intel_state->base; + return &intel_state->uapi; } /** @@ -111,7 +111,7 @@ intel_plane_destroy_state(struct drm_plane *plane, struct intel_plane_state *plane_state = to_intel_plane_state(state); WARN_ON(plane_state->vma); - __drm_atomic_helper_plane_destroy_state(&plane_state->base); + __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); kfree(plane_state); } @@ -121,7 +121,7 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; - if (!plane_state->base.visible) + if (!plane_state->uapi.visible) return 0; cpp = fb->format->cpp[0]; @@ -144,10 +144,10 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, struct drm_i915_private *dev_priv = to_i915(plane->base.dev); const struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); - struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(plane_state->uapi.crtc); struct intel_crtc_state *crtc_state; - if (!plane_state->base.visible || !plane->min_cdclk) + if (!plane_state->uapi.visible || !plane->min_cdclk) return false; crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -181,7 +181,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { - struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; @@ -190,7 +190,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->c8_planes &= ~BIT(plane->id); new_crtc_state->data_rate[plane->id] = 0; new_crtc_state->min_cdclk[p
[Intel-gfx] [CI 08/12] drm/i915: Add aliases for uapi and hw to plane_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c| 16 .../gpu/drm/i915/display/intel_display_types.h | 8 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 78e145e7c04d..0bfaeb9b7eb9 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -80,22 +80,20 @@ void intel_plane_free(struct intel_plane *plane) struct drm_plane_state * intel_plane_duplicate_state(struct drm_plane *plane) { - struct drm_plane_state *state; struct intel_plane_state *intel_state; - intel_state = kmemdup(plane->state, sizeof(*intel_state), GFP_KERNEL); + intel_state = to_intel_plane_state(plane->state); + intel_state = kmemdup(intel_state, sizeof(*intel_state), GFP_KERNEL); if (!intel_state) return NULL; - state = &intel_state->base; - - __drm_atomic_helper_plane_duplicate_state(plane, state); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); intel_state->vma = NULL; intel_state->flags = 0; - return state; + return &intel_state->base; } /** @@ -110,9 +108,11 @@ void intel_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *state) { - WARN_ON(to_intel_plane_state(state)->vma); + struct intel_plane_state *plane_state = to_intel_plane_state(state); + WARN_ON(plane_state->vma); - drm_atomic_helper_plane_destroy_state(plane, state); + __drm_atomic_helper_plane_destroy_state(&plane_state->base); + kfree(plane_state); } unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index bcf5f7640307..e43d5a09550d 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -523,7 +523,11 @@ struct intel_atomic_state { }; struct intel_plane_state { - struct drm_plane_state base; + union { + struct drm_plane_state base; + struct drm_plane_state uapi; + struct drm_plane_state hw; + }; struct i915_ggtt_view view; struct i915_vma *vma; unsigned long flags; @@ -1143,7 +1147,7 @@ struct cxsr_latency { #define to_intel_encoder(x) container_of(x, struct intel_encoder, base) #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) #define to_intel_plane(x) container_of(x, struct intel_plane, base) -#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, base) +#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, uapi) #define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL) struct intel_hdmi { -- 2.23.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [CI 04/12] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
intel_get_load_detect_pipe() needs to set uapi active, uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), so we can remove it. intel_pipe_config_compare() needs to look at hw state, but I didn't change spatch to look at it. It's easy enough to do manually. intel_atomic_check() definitely needs to check for uapi enable, otherwise intel_modeset_pipe_config cannot copy uapi state to hw. Changes since v1: - Actually set uapi.active in get_load_detect_pipe(). Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index d0df9b24a969..4baa0226abff 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11433,7 +11433,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, goto fail; } - crtc_state->base.active = crtc_state->base.enable = true; + crtc_state->uapi.active = true; if (!mode) mode = &load_detect_mode; @@ -13080,19 +13080,19 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_X(output_types); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_htotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_htotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vtotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vtotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_end); PIPE_CONF_CHECK_I(pixel_multiplier); PIPE_CONF_CHECK_I(output_format); @@ -13109,17 +13109,17 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_INTERLACE); if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS)) { - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PVSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NVSYNC); } @@ -13158,7 +13158,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, bp_gamma = intel_color_get_gamma_bit_precision(pipe_config); if (bp_gamma) - PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, base.gamma_lut, bp_gamma); + PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, hw.gamma_lut, bp_gamma); } @@ -13203,7 +13203,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5) PIPE_CONF_CHECK_I(pipe_bpp); - PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock); + PIPE_CONF_CHECK_CLOCK_FUZZY(hw.adjusted_mode.crtc_clock); PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock); PIPE_CONF_CHECK_I(min_voltage_level); @@ -14010,7 +14010,7 @@ static int intel_atomic_check(struct drm_device *dev,
[Intel-gfx] [CI 09/12] drm/i915: Perform manual conversions for plane uapi/hw split
get_crtc_from_states() is called before plane_state is copied to uapi, so use the uapi state there. intel_legacy_cursor_update() could probably get away with looking at the hw state, but for clarity look at the uapi state always Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 8 drivers/gpu/drm/i915/display/intel_display.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 0bfaeb9b7eb9..987f7545d45f 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -225,11 +225,11 @@ static struct intel_crtc * get_crtc_from_states(const struct intel_plane_state *old_plane_state, const struct intel_plane_state *new_plane_state) { - if (new_plane_state->base.crtc) - return to_intel_crtc(new_plane_state->base.crtc); + if (new_plane_state->uapi.crtc) + return to_intel_crtc(new_plane_state->uapi.crtc); - if (old_plane_state->base.crtc) - return to_intel_crtc(old_plane_state->base.crtc); + if (old_plane_state->uapi.crtc) + return to_intel_crtc(old_plane_state->uapi.crtc); return NULL; } diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index a765794597ed..cd9d68245f53 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -15359,12 +15359,12 @@ intel_legacy_cursor_update(struct drm_plane *_plane, * take the slowpath. Only changing fb or position should be * in the fastpath. */ - if (old_plane_state->base.crtc != &crtc->base || + if (old_plane_state->uapi.crtc != &crtc->base || old_plane_state->base.src_w != src_w || old_plane_state->base.src_h != src_h || old_plane_state->base.crtc_w != crtc_w || old_plane_state->base.crtc_h != crtc_h || - !old_plane_state->base.fb != !fb) + !old_plane_state->uapi.fb != !fb) goto slow; new_plane_state = to_intel_plane_state(intel_plane_duplicate_state(&plane->base)); -- 2.23.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [CI 12/12] drm/i915: Complete plane hw and uapi split, v2.
Splitting plane state is easier than splitting crtc_state, before plane check we copy the drm properties to hw so we can do the same in bigjoiner later on. We copy the state after we did all the modeset handling, but fortunately i915 seems to be split correctly and nothing during modeset looks at plane_state. Changes since v1: - Do not clear hw state on duplication. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 37 ++- .../gpu/drm/i915/display/intel_atomic_plane.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 1 + .../drm/i915/display/intel_display_types.h| 23 +--- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index ba7d5421f791..75a5004b234e 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -93,6 +93,10 @@ intel_plane_duplicate_state(struct drm_plane *plane) intel_state->vma = NULL; intel_state->flags = 0; + /* add reference to fb */ + if (intel_state->hw.fb) + drm_framebuffer_get(intel_state->hw.fb); + return &intel_state->uapi; } @@ -112,6 +116,8 @@ intel_plane_destroy_state(struct drm_plane *plane, WARN_ON(plane_state->vma); __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); kfree(plane_state); } @@ -176,15 +182,44 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, return false; } +static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state) +{ + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); + + memset(&plane_state->hw, 0, sizeof(plane_state->hw)); +} + +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state) +{ + intel_plane_clear_hw_state(plane_state); + + plane_state->hw.crtc = from_plane_state->uapi.crtc; + plane_state->hw.fb = from_plane_state->uapi.fb; + if (plane_state->hw.fb) + drm_framebuffer_get(plane_state->hw.fb); + + plane_state->hw.alpha = from_plane_state->uapi.alpha; + plane_state->hw.pixel_blend_mode = + from_plane_state->uapi.pixel_blend_mode; + plane_state->hw.rotation = from_plane_state->uapi.rotation; + plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; + plane_state->hw.color_range = from_plane_state->uapi.color_range; +} + int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state, const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); - const struct drm_framebuffer *fb = new_plane_state->hw.fb; + const struct drm_framebuffer *fb; int ret; + intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state); + fb = new_plane_state->hw.fb; + new_crtc_state->active_planes &= ~BIT(plane->id); new_crtc_state->nv12_planes &= ~BIT(plane->id); new_crtc_state->c8_planes &= ~BIT(plane->id); diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index e61e9a82aadf..cdb0f97d09f9 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -20,6 +20,8 @@ extern const struct drm_plane_helper_funcs intel_plane_helper_funcs; unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state); void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 91a059e5fdcb..ed9504d0336e 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -3283,6 +3283,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, plane_state->fb = fb; plane_sta
Re: [Intel-gfx] [CI 01/12] drm/i915: Introduce intel_atomic_get_plane_state_after_check(), v2.
Op 29-10-2019 om 19:35 schreef Ville Syrjälä: > On Tue, Oct 29, 2019 at 08:22:18AM +0100, Maarten Lankhorst wrote: >> Use this in all the places where we try to acquire planes after the planes >> atomic_check(). >> >> In case of intel_modeset_all_pipes() this is not yet done after atomic_check, >> but seems like it will be in the future. To add some paranoia, add all planes >> rather than active planes, because of bigjoiner and planar YUV support having >> extra planes outside of the core's view that wouldn't be added otherwise. >> >> Changes since v1: >> - Always add all planes, to handle force plane updates to work correctly >> with a disabled cursor plane. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_atomic.c | 41 +-- >> .../gpu/drm/i915/display/intel_atomic_plane.c | 15 +++ >> drivers/gpu/drm/i915/display/intel_cdclk.c| 15 --- >> drivers/gpu/drm/i915/display/intel_color.c| 7 ++-- >> .../drm/i915/display/intel_display_types.h| 6 +++ >> drivers/gpu/drm/i915/intel_pm.c | 14 --- >> 6 files changed, 62 insertions(+), 36 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c >> b/drivers/gpu/drm/i915/display/intel_atomic.c >> index 9cd6d2348a1e..80df6c233581 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c >> @@ -313,13 +313,10 @@ int intel_atomic_setup_scalers(struct drm_i915_private >> *dev_priv, >> struct intel_crtc *intel_crtc, >> struct intel_crtc_state *crtc_state) >> { >> -struct drm_plane *plane = NULL; >> -struct intel_plane *intel_plane; >> -struct intel_plane_state *plane_state = NULL; >> struct intel_crtc_scaler_state *scaler_state = >> &crtc_state->scaler_state; >> struct drm_atomic_state *drm_state = crtc_state->base.state; >> -struct intel_atomic_state *intel_state = >> to_intel_atomic_state(drm_state); >> +struct intel_atomic_state *state = to_intel_atomic_state(drm_state); >> int num_scalers_need; >> int i; >> >> @@ -346,6 +343,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private >> *dev_priv, >> >> /* walkthrough scaler_users bits and start assigning scalers */ >> for (i = 0; i < sizeof(scaler_state->scaler_users) * 8; i++) { >> +struct intel_plane_state *plane_state = NULL; >> int *scaler_id; >> const char *name; >> int idx; >> @@ -361,19 +359,16 @@ int intel_atomic_setup_scalers(struct drm_i915_private >> *dev_priv, >> /* panel fitter case: assign as a crtc scaler */ >> scaler_id = &scaler_state->scaler_id; >> } else { >> -name = "PLANE"; >> +struct intel_plane *plane; >> >> /* plane scaler case: assign as a plane scaler */ >> /* find the plane that set the bit as scaler_user */ >> -plane = drm_state->planes[i].ptr; >> >> /* >> * to enable/disable hq mode, add planes that are using >> scaler >> * into this transaction >> */ >> -if (!plane) { >> -struct drm_plane_state *state; >> - >> +if (!drm_state->planes[i].ptr) { >> /* >> * GLK+ scalers don't have a HQ mode so it >> * isn't necessary to change between HQ and dyn >> mode >> @@ -382,24 +377,28 @@ int intel_atomic_setup_scalers(struct drm_i915_private >> *dev_priv, >> if (INTEL_GEN(dev_priv) >= 10 || >> IS_GEMINILAKE(dev_priv)) >> continue; >> >> -plane = drm_plane_from_index(&dev_priv->drm, i); >> -state = drm_atomic_get_plane_state(drm_state, >> plane); >> -if (IS_ERR(state)) { >> -DRM_DEBUG_KMS("Failed to add [PLANE:%d] >> to drm_state\n", >> -plane->base.id); >> -
Re: [Intel-gfx] [CI 12/12] drm/i915: Complete plane hw and uapi split, v2.
Op 29-10-2019 om 19:34 schreef Ville Syrjälä: > On Tue, Oct 29, 2019 at 08:22:29AM +0100, Maarten Lankhorst wrote: >> Splitting plane state is easier than splitting crtc_state, >> before plane check we copy the drm properties to hw so we can >> do the same in bigjoiner later on. >> >> We copy the state after we did all the modeset handling, but fortunately >> i915 seems to be split correctly and nothing during modeset looks >> at plane_state. >> >> Changes since v1: >> - Do not clear hw state on duplication. >> >> Signed-off-by: Maarten Lankhorst >> --- >> .../gpu/drm/i915/display/intel_atomic_plane.c | 37 ++- >> .../gpu/drm/i915/display/intel_atomic_plane.h | 2 + >> drivers/gpu/drm/i915/display/intel_display.c | 1 + >> .../drm/i915/display/intel_display_types.h| 23 +--- >> 4 files changed, 57 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> index ba7d5421f791..75a5004b234e 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> @@ -93,6 +93,10 @@ intel_plane_duplicate_state(struct drm_plane *plane) >> intel_state->vma = NULL; >> intel_state->flags = 0; >> >> +/* add reference to fb */ >> +if (intel_state->hw.fb) >> +drm_framebuffer_get(intel_state->hw.fb); >> + >> return &intel_state->uapi; >> } >> >> @@ -112,6 +116,8 @@ intel_plane_destroy_state(struct drm_plane *plane, >> WARN_ON(plane_state->vma); >> >> __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); >> +if (plane_state->hw.fb) >> +drm_framebuffer_put(plane_state->hw.fb); >> kfree(plane_state); >> } >> >> @@ -176,15 +182,44 @@ bool intel_plane_calc_min_cdclk(struct >> intel_atomic_state *state, >> return false; >> } >> >> +static void intel_plane_clear_hw_state(struct intel_plane_state >> *plane_state) >> +{ >> +if (plane_state->hw.fb) >> +drm_framebuffer_put(plane_state->hw.fb); >> + >> +memset(&plane_state->hw, 0, sizeof(plane_state->hw)); >> +} >> + >> +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state >> *plane_state, >> + const struct intel_plane_state >> *from_plane_state) >> +{ >> +intel_plane_clear_hw_state(plane_state); >> + >> +plane_state->hw.crtc = from_plane_state->uapi.crtc; >> +plane_state->hw.fb = from_plane_state->uapi.fb; >> +if (plane_state->hw.fb) >> +drm_framebuffer_get(plane_state->hw.fb); >> + >> +plane_state->hw.alpha = from_plane_state->uapi.alpha; >> +plane_state->hw.pixel_blend_mode = >> +from_plane_state->uapi.pixel_blend_mode; >> +plane_state->hw.rotation = from_plane_state->uapi.rotation; >> +plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; >> +plane_state->hw.color_range = from_plane_state->uapi.color_range; >> +} >> + >> int intel_plane_atomic_check_with_state(const struct intel_crtc_state >> *old_crtc_state, >> struct intel_crtc_state *new_crtc_state, >> const struct intel_plane_state >> *old_plane_state, >> struct intel_plane_state >> *new_plane_state) >> { >> struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); >> -const struct drm_framebuffer *fb = new_plane_state->hw.fb; >> +const struct drm_framebuffer *fb; >> int ret; >> >> +intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state); >> +fb = new_plane_state->hw.fb; >> + >> new_crtc_state->active_planes &= ~BIT(plane->id); >> new_crtc_state->nv12_planes &= ~BIT(plane->id); >> new_crtc_state->c8_planes &= ~BIT(plane->id); >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> b/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> index e61e9a82aadf..cdb0f97d09f9 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h >> @@ -20,6 +20,8 @@ extern const struct drm_plane_helper_funcs >&g
Re: [Intel-gfx] [CI 04/12] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
Op 29-10-2019 om 14:23 schreef Ville Syrjälä: > On Tue, Oct 29, 2019 at 08:22:21AM +0100, Maarten Lankhorst wrote: >> intel_get_load_detect_pipe() needs to set uapi active, >> uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), >> so we can remove it. >> >> intel_pipe_config_compare() needs to look at hw state, but I didn't >> change spatch to look at it. It's easy enough to do manually. >> >> intel_atomic_check() definitely needs to check for uapi enable, >> otherwise intel_modeset_pipe_config cannot copy uapi state to hw. >> >> Changes since v1: >> - Actually set uapi.active in get_load_detect_pipe(). >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- >> 1 file changed, 21 insertions(+), 21 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >> b/drivers/gpu/drm/i915/display/intel_display.c >> index d0df9b24a969..4baa0226abff 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -11433,7 +11433,7 @@ int intel_get_load_detect_pipe(struct drm_connector >> *connector, >> goto fail; >> } >> >> -crtc_state->base.active = crtc_state->base.enable = true; >> +crtc_state->uapi.active = true; > The fact that load detection broke in ci makes this a bit suspicious. > But AFAICS it should work. > > > Hmm. Long ago I had a patch to fix something in > drm_atomic_set_mode_for_crtc()... > https://patchwork.freedesktop.org/patch/262996/?series=52778&rev=1 > > Doesn't seem like it should make a difference unless somehow uapi.mode > is left with the load detect mode but uapi.enable is set to false before > another call to drm_atomic_set_mode_for_crtc(load_detect_mode). Ah, I will just put back the base.enable for now then, can fix the core later. :) > >> >> if (!mode) >> mode = &load_detect_mode; >> @@ -13080,19 +13080,19 @@ intel_pipe_config_compare(const struct >> intel_crtc_state *current_config, >> >> PIPE_CONF_CHECK_X(output_types); >> >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hdisplay); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_htotal); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_end); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hdisplay); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_htotal); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_end); >> >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vdisplay); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vtotal); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_end); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vdisplay); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vtotal); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_end); >> >> PIPE_CONF_CHECK_I(pixel_multiplier); >> PIPE_CONF_CHECK_I(output_format); >> @@ -13109,17 +13109,17 @@ intel_pipe_config_compare(const struct >> intel_crtc_state *current_config, >> >> PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); >> >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>DRM_MODE_FLAG_INTERLACE); >> >> if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS)) { >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>DRM_MODE_FLAG_PHSYNC); >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>
Re: [Intel-gfx] [CI 11/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> uapi.
Op 29-10-2019 om 16:43 schreef Ville Syrjälä: > On Tue, Oct 29, 2019 at 08:22:28AM +0100, Maarten Lankhorst wrote: >> Split up plane_state->base to uapi. This is done using the following patch, >> ran after the previous commit that splits out any hw references: >> >> @@ >> struct intel_plane_state *T; >> identifier x; >> @@ >> -T->base.x >> +T->uapi.x >> >> @@ >> struct intel_plane_state *T; >> @@ >> -T->base >> +T->uapi >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- >> .../gpu/drm/i915/display/intel_atomic_plane.c | 32 +- >> drivers/gpu/drm/i915/display/intel_display.c | 298 +- >> drivers/gpu/drm/i915/display/intel_fbc.c | 12 +- >> drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- >> drivers/gpu/drm/i915/display/intel_sprite.c | 136 >> drivers/gpu/drm/i915/intel_pm.c | 57 ++-- >> 7 files changed, 271 insertions(+), 268 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c >> b/drivers/gpu/drm/i915/display/intel_atomic.c >> index fb4126de994d..cb5c914f627f 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c >> @@ -299,7 +299,7 @@ static void intel_atomic_setup_scaler(struct >> intel_crtc_scaler_state *scaler_sta >> if (plane_state && plane_state->hw.fb && >> plane_state->hw.fb->format->is_yuv && >> plane_state->hw.fb->format->num_planes > 1) { >> -struct intel_plane *plane = >> to_intel_plane(plane_state->base.plane); >> +struct intel_plane *plane = >> to_intel_plane(plane_state->uapi.plane); >> if (IS_GEN(dev_priv, 9) && >> !IS_GEMINILAKE(dev_priv)) { >> mode = SKL_PS_SCALER_MODE_NV12; >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> index cac1d6ae67f6..ba7d5421f791 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> @@ -56,7 +56,7 @@ struct intel_plane *intel_plane_alloc(void) >> return ERR_PTR(-ENOMEM); >> } >> >> -__drm_atomic_helper_plane_reset(&plane->base, &plane_state->base); >> +__drm_atomic_helper_plane_reset(&plane->base, &plane_state->uapi); >> plane_state->scaler_id = -1; >> >> return plane; >> @@ -88,12 +88,12 @@ intel_plane_duplicate_state(struct drm_plane *plane) >> if (!intel_state) >> return NULL; >> >> -__drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); >> +__drm_atomic_helper_plane_duplicate_state(plane, &intel_state->uapi); >> >> intel_state->vma = NULL; >> intel_state->flags = 0; >> >> -return &intel_state->base; >> +return &intel_state->uapi; >> } >> >> /** >> @@ -111,7 +111,7 @@ intel_plane_destroy_state(struct drm_plane *plane, >> struct intel_plane_state *plane_state = to_intel_plane_state(state); >> WARN_ON(plane_state->vma); >> >> -__drm_atomic_helper_plane_destroy_state(&plane_state->base); >> +__drm_atomic_helper_plane_destroy_state(&plane_state->uapi); >> kfree(plane_state); >> } >> >> @@ -121,7 +121,7 @@ unsigned int intel_plane_data_rate(const struct >> intel_crtc_state *crtc_state, >> const struct drm_framebuffer *fb = plane_state->hw.fb; >> unsigned int cpp; >> >> -if (!plane_state->base.visible) >> +if (!plane_state->uapi.visible) >> return 0; >> >> cpp = fb->format->cpp[0]; >> @@ -144,10 +144,10 @@ bool intel_plane_calc_min_cdclk(struct >> intel_atomic_state *state, >> struct drm_i915_private *dev_priv = to_i915(plane->base.dev); >> const struct intel_plane_state *plane_state = >> intel_atomic_get_new_plane_state(state, plane); >> -struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc); >> +struct intel_crtc *crtc = to_intel_crtc(plane_state->uapi.crtc); > This looks wrong. Should be hw.crtc I believe. Correct, I accidentally messed up last time I ran this, and forgot to run the base->hw patch first. So some references w
[Intel-gfx] [CI 01/12] drm/i915: Handle a few more cases for crtc hw/uapi split, v3.
We are still looking at drm_crtc_state in a few places, convert those to use intel_crtc_state instead. Changes since v1: - Move to before uapi/hw split. - Add hunks for intel_pm.c as well. Changes since v2: - Incorporate Ville's feedback. Signed-off-by: Maarten Lankhorst Reviewed-by: Matt Roper Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 15 --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 12 drivers/gpu/drm/i915/display/intel_psr.c | 16 +++- drivers/gpu/drm/i915/intel_pm.c | 6 ++ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index e56a75c07043..a7d1515de048 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -16720,8 +16720,7 @@ static int intel_initial_commit(struct drm_device *dev) { struct drm_atomic_state *state = NULL; struct drm_modeset_acquire_ctx ctx; - struct drm_crtc *crtc; - struct drm_crtc_state *crtc_state; + struct intel_crtc *crtc; int ret = 0; state = drm_atomic_state_alloc(dev); @@ -16733,15 +16732,17 @@ static int intel_initial_commit(struct drm_device *dev) retry: state->acquire_ctx = &ctx; - drm_for_each_crtc(crtc, dev) { - crtc_state = drm_atomic_get_crtc_state(state, crtc); + for_each_intel_crtc(dev, crtc) { + struct intel_crtc_state *crtc_state = + intel_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) { ret = PTR_ERR(crtc_state); goto out; } - if (crtc_state->active) { - ret = drm_atomic_add_affected_planes(state, crtc); + if (crtc_state->base.active) { + ret = drm_atomic_add_affected_planes(state, &crtc->base); if (ret) goto out; @@ -16751,7 +16752,7 @@ static int intel_initial_commit(struct drm_device *dev) * having a proper LUT loaded. Remove once we * have readout for pipe gamma enable. */ - crtc_state->color_mgmt_changed = true; + crtc_state->base.color_mgmt_changed = true; } } diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index a9962846a503..42d26214fb23 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -168,7 +168,6 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, struct intel_connector *intel_connector = to_intel_connector(connector); struct drm_crtc *new_crtc = new_conn_state->crtc; - struct drm_crtc_state *crtc_state; struct drm_dp_mst_topology_mgr *mgr; int ret; @@ -183,11 +182,16 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, * connector */ if (new_crtc) { - crtc_state = drm_atomic_get_new_crtc_state(state, new_crtc); + struct intel_atomic_state *intel_state = + to_intel_atomic_state(state); + struct intel_crtc *intel_crtc = to_intel_crtc(new_crtc); + struct intel_crtc_state *crtc_state = + intel_atomic_get_new_crtc_state(intel_state, + intel_crtc); if (!crtc_state || - !drm_atomic_crtc_needs_modeset(crtc_state) || - crtc_state->enable) + !drm_atomic_crtc_needs_modeset(&crtc_state->base) || + crtc_state->base.enable) return 0; } diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 6a9f322d3fca..359a60762b49 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -26,6 +26,7 @@ #include "display/intel_dp.h" #include "i915_drv.h" +#include "intel_atomic.h" #include "intel_display_types.h" #include "intel_psr.h" #include "intel_sprite.h" @@ -1096,7 +1097,7 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct drm_modeset_acquire_ctx ctx; struct drm_atomic_state *state; - struct drm_crtc *crtc; + struct intel_crtc *crtc; int err; state = drm_atomic_state_alloc(dev); @@ -1107,21 +1108,18 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) state->a
[Intel-gfx] [CI 02/12] drm/i915: Add aliases for uapi and hw to crtc_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 8 -- drivers/gpu/drm/i915/display/intel_display.c | 2 ++ drivers/gpu/drm/i915/display/intel_display.h | 6 ++--- .../drm/i915/display/intel_display_types.h| 27 ++- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 9cd6d2348a1e..4826aa4ee8e7 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -186,9 +186,10 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector) struct drm_crtc_state * intel_crtc_duplicate_state(struct drm_crtc *crtc) { + const struct intel_crtc_state *old_crtc_state = to_intel_crtc_state(crtc->state); struct intel_crtc_state *crtc_state; - crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL); + crtc_state = kmemdup(old_crtc_state, sizeof(*crtc_state), GFP_KERNEL); if (!crtc_state) return NULL; @@ -219,7 +220,10 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { - drm_atomic_helper_crtc_destroy_state(crtc, state); + struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); + + __drm_atomic_helper_crtc_destroy_state(&crtc_state->base); + kfree(crtc_state); } static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state, diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index a7d1515de048..5bf460caf8a3 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -12595,6 +12595,8 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) /* Keep base drm_crtc_state intact, only clear our extended struct */ BUILD_BUG_ON(offsetof(struct intel_crtc_state, base)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, uapi)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, hw)); memcpy(&crtc_state->base + 1, &saved_state->base + 1, sizeof(*crtc_state) - sizeof(crtc_state->base)); diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index ca7ca2804d8b..ca3eb6a1c125 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -447,10 +447,10 @@ enum phy_fia { #define intel_atomic_crtc_state_for_each_plane_state( \ plane, plane_state, \ crtc_state) \ - for_each_intel_plane_mask(((crtc_state)->base.state->dev), (plane), \ - ((crtc_state)->base.plane_mask)) \ + for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (plane), \ + ((crtc_state)->uapi.plane_mask)) \ for_each_if ((plane_state = \ - to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->base.state, &plane->base + to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &plane->base void intel_link_compute_m_n(u16 bpp, int nlanes, int pixel_clock, int link_clock, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 40184e823c84..e84343d3bf8d 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -757,7 +757,32 @@ enum intel_output_format { }; struct intel_crtc_state { + union { struct drm_crtc_state base; + /* +* uapi (drm) state. This is the software state shown to userspace. +* In particular, the following members are used for bookkeeping: +* - crtc +* - state +* - *_changed +* - event +* - commit +* - mode_blob +*/ + struct drm_crtc_state uapi; + + /* +* actual hardware state, the state we program to the hardware. +* The following members are used to verify the hardware state: +* - enable +* - active +* - mode / adjusted_mode +* - color property blobs. +* +* During initial hw readout, they need to be copied to uapi. +*/ + struct drm_crtc_state hw; + }; /** * quirks - bitfield with hw state readout quirks @@ -1112,7 +1137,7 @@ struct cxsr_latency { #define to_intel_atomic_state(x) container_of(x, struct intel_a
[Intel-gfx] [CI 04/12] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> hw.
Split up crtc_state->base to hw where appropriate. This is done using the following patch: @@ struct intel_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -T->base.x +T->hw.x @@ struct drm_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -to_intel_crtc_state(T)->base.x +to_intel_crtc_state(T)->hw.x Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + drivers/gpu/drm/i915/display/icl_dsi.c| 12 +- drivers/gpu/drm/i915/display/intel_audio.c| 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c| 8 +- drivers/gpu/drm/i915/display/intel_color.c| 108 drivers/gpu/drm/i915/display/intel_crt.c | 18 +- drivers/gpu/drm/i915/display/intel_ddi.c | 18 +- drivers/gpu/drm/i915/display/intel_display.c | 260 +- drivers/gpu/drm/i915/display/intel_dp.c | 22 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 6 +- drivers/gpu/drm/i915/display/intel_dvo.c | 12 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 20 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 8 +- drivers/gpu/drm/i915/display/intel_panel.c| 8 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 12 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 +- drivers/gpu/drm/i915/display/intel_sprite.c | 8 +- drivers/gpu/drm/i915/display/intel_tv.c | 4 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 4 +- drivers/gpu/drm/i915/display/vlv_dsi.c| 10 +- drivers/gpu/drm/i915/i915_debugfs.c | 8 +- drivers/gpu/drm/i915/intel_pm.c | 56 ++-- 25 files changed, 318 insertions(+), 313 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 85bef73a6763..fddea7acf7d8 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -33,6 +33,7 @@ #include #include #include +#include #endif #include diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 6e398c33a524..4ec493e4755b 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -276,7 +276,7 @@ static void configure_dual_link_mode(struct intel_encoder *encoder, if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) { const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; u32 dss_ctl2; u16 hactive = adjusted_mode->crtc_hdisplay; u16 dl_buffer_depth; @@ -768,7 +768,7 @@ gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; enum port port; enum transcoder dsi_trans; /* horizontal timings */ @@ -1216,7 +1216,7 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder, { struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; if (intel_dsi->dual_link) { adjusted_mode->crtc_hdisplay *= 2; @@ -1249,9 +1249,9 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, pipe_config->port_clock = cnl_calc_wrpll_link(dev_priv, &pipe_config->dpll_hw_state); - pipe_config->base.adjusted_mode.crtc_clock = intel_dsi->pclk; + pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk; if (intel_dsi->dual_link) - pipe_config->base.adjusted_mode.crtc_clock *= 2; + pipe_config->hw.adjusted_mode.crtc_clock *= 2; gen11_dsi_get_timings(encoder, pipe_config); pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI); @@ -1269,7 +1269,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; struct drm_display_mode *adjusted_mode = -
[Intel-gfx] [CI 11/12] drm/i915: Complete plane hw and uapi split, v2.
Splitting plane state is easier than splitting crtc_state, before plane check we copy the drm properties to hw so we can do the same in bigjoiner later on. We copy the state after we did all the modeset handling, but fortunately i915 seems to be split correctly and nothing during modeset looks at plane_state. Changes since v1: - Do not clear hw state on duplication. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 37 ++- .../gpu/drm/i915/display/intel_atomic_plane.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 1 + .../drm/i915/display/intel_display_types.h| 23 +--- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 18023422a34d..249fb41d78a5 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -93,6 +93,10 @@ intel_plane_duplicate_state(struct drm_plane *plane) intel_state->vma = NULL; intel_state->flags = 0; + /* add reference to fb */ + if (intel_state->hw.fb) + drm_framebuffer_get(intel_state->hw.fb); + return &intel_state->uapi; } @@ -112,6 +116,8 @@ intel_plane_destroy_state(struct drm_plane *plane, WARN_ON(plane_state->vma); __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); kfree(plane_state); } @@ -176,15 +182,44 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, return false; } +static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state) +{ + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); + + memset(&plane_state->hw, 0, sizeof(plane_state->hw)); +} + +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state) +{ + intel_plane_clear_hw_state(plane_state); + + plane_state->hw.crtc = from_plane_state->uapi.crtc; + plane_state->hw.fb = from_plane_state->uapi.fb; + if (plane_state->hw.fb) + drm_framebuffer_get(plane_state->hw.fb); + + plane_state->hw.alpha = from_plane_state->uapi.alpha; + plane_state->hw.pixel_blend_mode = + from_plane_state->uapi.pixel_blend_mode; + plane_state->hw.rotation = from_plane_state->uapi.rotation; + plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; + plane_state->hw.color_range = from_plane_state->uapi.color_range; +} + int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state, const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); - const struct drm_framebuffer *fb = new_plane_state->hw.fb; + const struct drm_framebuffer *fb; int ret; + intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state); + fb = new_plane_state->hw.fb; + new_crtc_state->active_planes &= ~BIT(plane->id); new_crtc_state->nv12_planes &= ~BIT(plane->id); new_crtc_state->c8_planes &= ~BIT(plane->id); diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index e61e9a82aadf..cdb0f97d09f9 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -20,6 +20,8 @@ extern const struct drm_plane_helper_funcs intel_plane_helper_funcs; unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state); void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 1584421c76b9..7ee5d1f5a180 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -3283,6 +3283,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, plane_state->fb = fb; plane_sta
[Intel-gfx] [CI 10/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> uapi.
Split up plane_state->base to uapi. This is done using the following patch, ran after the previous commit that splits out any hw references: @@ struct intel_plane_state *T; identifier x; @@ -T->base.x +T->uapi.x @@ struct intel_plane_state *T; @@ -T->base +T->uapi Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 32 +-- drivers/gpu/drm/i915/display/intel_display.c | 262 +- drivers/gpu/drm/i915/display/intel_fbc.c | 12 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 136 - drivers/gpu/drm/i915/intel_pm.c | 57 ++-- 7 files changed, 252 insertions(+), 251 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 0a5eee4c350f..ea24a45dab86 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -286,7 +286,7 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta if (plane_state && plane_state->hw.fb && plane_state->hw.fb->format->is_yuv && plane_state->hw.fb->format->num_planes > 1) { - struct intel_plane *plane = to_intel_plane(plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { mode = SKL_PS_SCALER_MODE_NV12; diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 4e928e361be1..18023422a34d 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -56,7 +56,7 @@ struct intel_plane *intel_plane_alloc(void) return ERR_PTR(-ENOMEM); } - __drm_atomic_helper_plane_reset(&plane->base, &plane_state->base); + __drm_atomic_helper_plane_reset(&plane->base, &plane_state->uapi); plane_state->scaler_id = -1; return plane; @@ -88,12 +88,12 @@ intel_plane_duplicate_state(struct drm_plane *plane) if (!intel_state) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->uapi); intel_state->vma = NULL; intel_state->flags = 0; - return &intel_state->base; + return &intel_state->uapi; } /** @@ -111,7 +111,7 @@ intel_plane_destroy_state(struct drm_plane *plane, struct intel_plane_state *plane_state = to_intel_plane_state(state); WARN_ON(plane_state->vma); - __drm_atomic_helper_plane_destroy_state(&plane_state->base); + __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); kfree(plane_state); } @@ -121,7 +121,7 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; - if (!plane_state->base.visible) + if (!plane_state->uapi.visible) return 0; cpp = fb->format->cpp[0]; @@ -144,10 +144,10 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, struct drm_i915_private *dev_priv = to_i915(plane->base.dev); const struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); - struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(plane_state->uapi.crtc); struct intel_crtc_state *crtc_state; - if (!plane_state->base.visible || !plane->min_cdclk) + if (!plane_state->uapi.visible || !plane->min_cdclk) return false; crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -181,7 +181,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { - struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; @@ -190,7 +190,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->c8_planes &= ~BIT(plane->id); new_crtc_state->data_rate[plane->id] = 0; new_crtc_state->min
[Intel-gfx] [CI 08/12] drm/i915: Perform manual conversions for plane uapi/hw split, v2.
get_crtc_from_states() is called before plane_state is copied to uapi, so use the uapi state there. intel_legacy_cursor_update() could probably get away with looking at the hw state, but for clarity always look at the uapi state. Changes since v1: - Convert entirety of intel_legacy_cursor_update (Ville). Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 8 ++-- drivers/gpu/drm/i915/display/intel_display.c | 45 ++- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 393fb97a3dca..416cfa439f33 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -225,11 +225,11 @@ static struct intel_crtc * get_crtc_from_states(const struct intel_plane_state *old_plane_state, const struct intel_plane_state *new_plane_state) { - if (new_plane_state->base.crtc) - return to_intel_crtc(new_plane_state->base.crtc); + if (new_plane_state->uapi.crtc) + return to_intel_crtc(new_plane_state->uapi.crtc); - if (old_plane_state->base.crtc) - return to_intel_crtc(old_plane_state->base.crtc); + if (old_plane_state->uapi.crtc) + return to_intel_crtc(old_plane_state->uapi.crtc); return NULL; } diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index e30f467eec67..b0b2c46e4c0a 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -15357,12 +15357,12 @@ intel_legacy_cursor_update(struct drm_plane *_plane, * take the slowpath. Only changing fb or position should be * in the fastpath. */ - if (old_plane_state->base.crtc != &crtc->base || - old_plane_state->base.src_w != src_w || - old_plane_state->base.src_h != src_h || - old_plane_state->base.crtc_w != crtc_w || - old_plane_state->base.crtc_h != crtc_h || - !old_plane_state->base.fb != !fb) + if (old_plane_state->uapi.crtc != &crtc->base || + old_plane_state->uapi.src_w != src_w || + old_plane_state->uapi.src_h != src_h || + old_plane_state->uapi.crtc_w != crtc_w || + old_plane_state->uapi.crtc_h != crtc_h || + !old_plane_state->uapi.fb != !fb) goto slow; new_plane_state = to_intel_plane_state(intel_plane_duplicate_state(&plane->base)); @@ -15375,16 +15375,16 @@ intel_legacy_cursor_update(struct drm_plane *_plane, goto out_free; } - drm_atomic_set_fb_for_plane(&new_plane_state->base, fb); + drm_atomic_set_fb_for_plane(&new_plane_state->uapi, fb); - new_plane_state->base.src_x = src_x; - new_plane_state->base.src_y = src_y; - new_plane_state->base.src_w = src_w; - new_plane_state->base.src_h = src_h; - new_plane_state->base.crtc_x = crtc_x; - new_plane_state->base.crtc_y = crtc_y; - new_plane_state->base.crtc_w = crtc_w; - new_plane_state->base.crtc_h = crtc_h; + new_plane_state->uapi.src_x = src_x; + new_plane_state->uapi.src_y = src_y; + new_plane_state->uapi.src_w = src_w; + new_plane_state->uapi.src_h = src_h; + new_plane_state->uapi.crtc_x = crtc_x; + new_plane_state->uapi.crtc_y = crtc_y; + new_plane_state->uapi.crtc_w = crtc_w; + new_plane_state->uapi.crtc_h = crtc_h; ret = intel_plane_atomic_check_with_state(crtc_state, new_crtc_state, old_plane_state, new_plane_state); @@ -15395,13 +15395,14 @@ intel_legacy_cursor_update(struct drm_plane *_plane, if (ret) goto out_free; - intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->base.fb), ORIGIN_FLIP); - intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb), - to_intel_frontbuffer(new_plane_state->base.fb), + intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb), + ORIGIN_FLIP); + intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb), + to_intel_frontbuffer(new_plane_state->hw.fb), plane->frontbuffer_bit); /* Swap plane state */ - plane->base.state = &new_plane_state->base; + plane->base.state = &new_plane_state->uapi; /* * We cannot swap crtc_state as it may be in use by an atomic commit or @@ -15415,7 +15416,7 @@ intel_legacy_cursor_update(struct
[Intel-gfx] [CI 07/12] drm/i915: Add aliases for uapi and hw to plane_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c| 16 .../gpu/drm/i915/display/intel_display_types.h | 8 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 4558c0b29fc1..393fb97a3dca 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -80,22 +80,20 @@ void intel_plane_free(struct intel_plane *plane) struct drm_plane_state * intel_plane_duplicate_state(struct drm_plane *plane) { - struct drm_plane_state *state; struct intel_plane_state *intel_state; - intel_state = kmemdup(plane->state, sizeof(*intel_state), GFP_KERNEL); + intel_state = to_intel_plane_state(plane->state); + intel_state = kmemdup(intel_state, sizeof(*intel_state), GFP_KERNEL); if (!intel_state) return NULL; - state = &intel_state->base; - - __drm_atomic_helper_plane_duplicate_state(plane, state); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); intel_state->vma = NULL; intel_state->flags = 0; - return state; + return &intel_state->base; } /** @@ -110,9 +108,11 @@ void intel_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *state) { - WARN_ON(to_intel_plane_state(state)->vma); + struct intel_plane_state *plane_state = to_intel_plane_state(state); + WARN_ON(plane_state->vma); - drm_atomic_helper_plane_destroy_state(plane, state); + __drm_atomic_helper_plane_destroy_state(&plane_state->base); + kfree(plane_state); } unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 9319ca682105..6036b2b3980b 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -523,7 +523,11 @@ struct intel_atomic_state { }; struct intel_plane_state { - struct drm_plane_state base; + union { + struct drm_plane_state base; + struct drm_plane_state uapi; + struct drm_plane_state hw; + }; struct i915_ggtt_view view; struct i915_vma *vma; unsigned long flags; @@ -1143,7 +1147,7 @@ struct cxsr_latency { #define to_intel_encoder(x) container_of(x, struct intel_encoder, base) #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) #define to_intel_plane(x) container_of(x, struct intel_plane, base) -#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, base) +#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, uapi) #define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL) struct intel_hdmi { -- 2.23.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [CI 09/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw.
Split up plane_state->base to hw. This is done using the following patch: @@ struct intel_plane_state *T; identifier x =~ "^(crtc|fb|alpha|pixel_blend_mode|rotation|color_encoding|color_range)$"; @@ -T->base.x +T->hw.x Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_atomic.c | 6 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 6 +- drivers/gpu/drm/i915/display/intel_display.c | 126 +- drivers/gpu/drm/i915/display/intel_fbc.c | 8 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 90 ++--- drivers/gpu/drm/i915/intel_pm.c | 32 ++--- 7 files changed, 135 insertions(+), 135 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 3301c178da03..0a5eee4c350f 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -283,9 +283,9 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta return; /* set scaler mode */ - if (plane_state && plane_state->base.fb && - plane_state->base.fb->format->is_yuv && - plane_state->base.fb->format->num_planes > 1) { + if (plane_state && plane_state->hw.fb && + plane_state->hw.fb->format->is_yuv && + plane_state->hw.fb->format->num_planes > 1) { struct intel_plane *plane = to_intel_plane(plane_state->base.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 416cfa439f33..4e928e361be1 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -118,7 +118,7 @@ intel_plane_destroy_state(struct drm_plane *plane, unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - const struct drm_framebuffer *fb = plane_state->base.fb; + const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; if (!plane_state->base.visible) @@ -182,7 +182,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); - const struct drm_framebuffer *fb = new_plane_state->base.fb; + const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; new_crtc_state->active_planes &= ~BIT(plane->id); @@ -192,7 +192,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->min_cdclk[plane->id] = 0; new_plane_state->base.visible = false; - if (!new_plane_state->base.crtc && !old_plane_state->base.crtc) + if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) return 0; ret = plane->check_plane(new_crtc_state, new_plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index b0b2c46e4c0a..1c0c55a78d03 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2215,7 +2215,7 @@ u32 intel_fb_xy_to_linear(int x, int y, const struct intel_plane_state *state, int color_plane) { - const struct drm_framebuffer *fb = state->base.fb; + const struct drm_framebuffer *fb = state->hw.fb; unsigned int cpp = fb->format->cpp[color_plane]; unsigned int pitch = state->color_plane[color_plane].stride; @@ -2316,8 +2316,8 @@ static u32 intel_plane_adjust_aligned_offset(int *x, int *y, int color_plane, u32 old_offset, u32 new_offset) { - return intel_adjust_aligned_offset(x, y, state->base.fb, color_plane, - state->base.rotation, + return intel_adjust_aligned_offset(x, y, state->hw.fb, color_plane, + state->hw.rotation, state->color_plane[color_plane].stride, old_offset, new_offset); } @@ -2393,8 +2393,8 @@ static u32 intel_plane_compute_aligned_offset(int *x, int *y, { struct intel_plane *intel_plane = to_intel_plane(state->base.plane)
[Intel-gfx] [CI 12/12] drm/i915: Remove special case slave handling during hw programming, v3.
Now that we split plane_state which I didn't want to do yet, we can program the slave plane without requiring the master plane. This is useful for programming bigjoiner slave planes as well. We will no longer need the master's plane_state. Changes since v1: - set src/dst rectangles after copy_uapi_to_hw_state. Changes since v2: - Use the correct color_plane for pre-gen11 by using planar_linked_plane != NULL. - Use drm_format_info_is_yuv_semiplanar in skl_plane_check() to fix gen11+. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 30 +- .../gpu/drm/i915/display/intel_atomic_plane.h | 3 - drivers/gpu/drm/i915/display/intel_display.c | 18 ++ .../drm/i915/display/intel_display_types.h| 6 +- drivers/gpu/drm/i915/display/intel_sprite.c | 57 ++- 5 files changed, 40 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 249fb41d78a5..93d391ab3f75 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -348,16 +348,6 @@ void intel_update_plane(struct intel_plane *plane, plane->update_plane(plane, crtc_state, plane_state); } -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state) -{ - struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - - trace_intel_update_plane(&plane->base, crtc); - plane->update_slave(plane, crtc_state, plane_state); -} - void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { @@ -390,25 +380,9 @@ void skl_update_planes_on_crtc(struct intel_atomic_state *state, struct intel_plane_state *new_plane_state = intel_atomic_get_new_plane_state(state, plane); - if (new_plane_state->uapi.visible) { + if (new_plane_state->uapi.visible || + new_plane_state->planar_slave) { intel_update_plane(plane, new_crtc_state, new_plane_state); - } else if (new_plane_state->planar_slave) { - struct intel_plane *master = - new_plane_state->planar_linked_plane; - - /* -* We update the slave plane from this function because -* programming it from the master plane's update_plane -* callback runs into issues when the Y plane is -* reassigned, disabled or used by a different plane. -* -* The slave plane is updated with the master plane's -* plane_state. -*/ - new_plane_state = - intel_atomic_get_new_plane_state(state, master); - - intel_update_slave(plane, new_crtc_state, new_plane_state); } else { intel_disable_plane(plane, new_crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index cdb0f97d09f9..5cedafdddb55 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -25,9 +25,6 @@ void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state); void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state); struct intel_plane *intel_plane_alloc(void); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7ee5d1f5a180..53f9c885fc56 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11988,6 +11988,24 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state) crtc_state->active_planes |= BIT(linked->id); crtc_state->update_planes |= BIT(linked->id); DRM_DEBUG_KMS("Using %s as Y plane for %s\n", linked->base.name, plane->base.name); + + /* Copy parameters to slave plane */ + linked_state->ctl = plane_state->ctl | PLANE_CTL_YUV420_Y_PLANE; +
[Intel-gfx] [CI 03/12] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
intel_get_load_detect_pipe() needs to set uapi active, uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), so we can remove it. intel_pipe_config_compare() needs to look at hw state, but I didn't change spatch to look at it. It's easy enough to do manually. intel_atomic_check() definitely needs to check for uapi enable, otherwise intel_modeset_pipe_config cannot copy uapi state to hw. Changes since v1: - Actually set uapi.active in get_load_detect_pipe(). Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 5bf460caf8a3..a66033e3bdfa 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11433,7 +11433,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, goto fail; } - crtc_state->base.active = crtc_state->base.enable = true; + crtc_state->uapi.active = true; if (!mode) mode = &load_detect_mode; @@ -13080,19 +13080,19 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_X(output_types); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_htotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_htotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vtotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vtotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_end); PIPE_CONF_CHECK_I(pixel_multiplier); PIPE_CONF_CHECK_I(output_format); @@ -13109,17 +13109,17 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_INTERLACE); if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS)) { - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PVSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NVSYNC); } @@ -13158,7 +13158,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, bp_gamma = intel_color_get_gamma_bit_precision(pipe_config); if (bp_gamma) - PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, base.gamma_lut, bp_gamma); + PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, hw.gamma_lut, bp_gamma); } @@ -13203,7 +13203,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5) PIPE_CONF_CHECK_I(pipe_bpp); - PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock); + PIPE_CONF_CHECK_CLOCK_FUZZY(hw.adjusted_mode.crtc_clock); PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock); PIPE_CONF_CHECK_I(min_voltage_level); @@ -14010,7 +14010,7 @@ static int intel_atomic_check(struct drm_device *dev,
[Intel-gfx] [CI 06/12] drm/i915: Complete crtc hw/uapi split, v5.
Now that we separated everything into uapi and hw, it's time to make the split definitive. Remove the union and make a copy of the hw state on modeset and fastset. Color blobs are copied in crtc atomic_check(), right before color management is checked. Changes since v1: - Copy all blobs immediately after drm_atomic_helper_check_modeset(). - Clear crtc_state->hw on disable, instead of using clear_intel_crtc_state(). Changes since v2: - Use intel_crtc_free_hw_state + clear in intel_crtc_disable_noatomic(). - Make a intel_crtc_prepare_state() function that clears the crtc_state and copies hw members. - Remove setting uapi.adjusted_mode, we now have a direct call to drm_calc_timestamping_constants(). Changes since v3: - Rename prefix copy_hw_to_uapi_state() with intel_crtc. - Copy color blobs to uapi as well. - Add a intel_crtc_copy_uapi_to_hw_state_nomodeset() function for clarity. Changes since v4: - Copy hw.adjusted_mode back to uapi.adjusted_mode, to shut up the call to drm_calc_timestamping_constants() in drm_atomic_helper_update_legacy_modeset_state(). - Use drm_property_replace_blob (Ville). Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 31 drivers/gpu/drm/i915/display/intel_atomic.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 78 +++ .../drm/i915/display/intel_display_types.h| 9 ++- 4 files changed, 103 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 48964f33c0c1..3301c178da03 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); + /* copy color blobs */ + if (crtc_state->hw.degamma_lut) + drm_property_blob_get(crtc_state->hw.degamma_lut); + if (crtc_state->hw.ctm) + drm_property_blob_get(crtc_state->hw.ctm); + if (crtc_state->hw.gamma_lut) + drm_property_blob_get(crtc_state->hw.gamma_lut); + crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; @@ -208,6 +216,28 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) return &crtc_state->uapi; } +static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state) +{ + drm_property_blob_put(crtc_state->hw.degamma_lut); + drm_property_blob_put(crtc_state->hw.gamma_lut); + drm_property_blob_put(crtc_state->hw.ctm); +} + +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); +} + +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) +{ + drm_property_replace_blob(&crtc_state->hw.degamma_lut, + crtc_state->uapi.degamma_lut); + drm_property_replace_blob(&crtc_state->hw.gamma_lut, + crtc_state->uapi.gamma_lut); + drm_property_replace_blob(&crtc_state->hw.ctm, + crtc_state->uapi.ctm); +} + /** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc @@ -223,6 +253,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); + intel_crtc_free_hw_state(crtc_state); kfree(crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h b/drivers/gpu/drm/i915/display/intel_atomic.h index 49d5cb1b9e0a..7b49623419ba 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.h +++ b/drivers/gpu/drm/i915/display/intel_atomic.h @@ -36,6 +36,8 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector); struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc); void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state); +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state); struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); void intel_atomic_state_clear(struct drm_atomic_state *state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 66223701ef78..e30f467eec67 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7185,6 +7185,8 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc, crtc->enabled = false; crtc->state->connector_mask = 0; crtc->state->encoder_ma
Re: [Intel-gfx] [PATCH] drm/i915: Stop frobbing crtc->base.mode
Op 29-10-2019 om 15:55 schreef Ville Syrjala: > From: Ville Syrjälä > > The core no longer uses drm_crtc_state::mode with atomic drivers, > so let's stop frobbing it in the driver. For the user mode readout > we'll just use an on stack mode. > > Signed-off-by: Ville Syrjälä > --- > drivers/gpu/drm/i915/display/intel_display.c | 18 +- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index e56a75c07043..96f76abb2d37 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -14127,9 +14127,6 @@ static void intel_pipe_fastset(const struct > intel_crtc_state *old_crtc_state, > struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->base.crtc); > struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); > > - /* drm_atomic_helper_update_legacy_modeset_state might not be called. */ > - crtc->base.mode = new_crtc_state->base.mode; > - > /* >* Update pipe size and adjust fitter if needed: the reason for this is >* that in compute_mode_changes we check the native mode (not the pfit > @@ -17394,13 +17391,16 @@ static void intel_modeset_readout_hw_state(struct > drm_device *dev) > struct intel_plane *plane; > int min_cdclk = 0; > > - memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); > if (crtc_state->base.active) { > - intel_mode_from_pipe_config(&crtc->base.mode, > crtc_state); > - crtc->base.mode.hdisplay = crtc_state->pipe_src_w; > - crtc->base.mode.vdisplay = crtc_state->pipe_src_h; > - > intel_mode_from_pipe_config(&crtc_state->base.adjusted_mode, crtc_state); > - WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->base, > &crtc->base.mode)); > + struct drm_display_mode mode; > + > + > intel_mode_from_pipe_config(&crtc_state->base.adjusted_mode, > + crtc_state); > + > + mode = crtc_state->base.adjusted_mode; > + mode.hdisplay = crtc_state->pipe_src_w; > + mode.vdisplay = crtc_state->pipe_src_h; > + WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->base, > &mode)); > > /* >* The initial mode needs to be set in order to keep Hey, We used to do this not for the core, but because i915 still used crtc->base.mode in some cases. I guess we no longer do, so this is fine. Reviewed-by: Maarten Lankhorst ~Maarten ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [CI 03/12] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
Op 30-10-2019 om 18:03 schreef Ville Syrjälä: > On Wed, Oct 30, 2019 at 03:26:48PM +0100, Maarten Lankhorst wrote: >> intel_get_load_detect_pipe() needs to set uapi active, >> uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), >> so we can remove it. >> >> intel_pipe_config_compare() needs to look at hw state, but I didn't >> change spatch to look at it. It's easy enough to do manually. >> >> intel_atomic_check() definitely needs to check for uapi enable, >> otherwise intel_modeset_pipe_config cannot copy uapi state to hw. >> >> Changes since v1: >> - Actually set uapi.active in get_load_detect_pipe(). >> >> Signed-off-by: Maarten Lankhorst > I guess the load detection fail was something else? > > Reviewed-by: Ville Syrjälä Yeah, needs your other patches in drm_misc to stop calling calc_timestamping_constants. :) >> --- >> drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- >> 1 file changed, 21 insertions(+), 21 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >> b/drivers/gpu/drm/i915/display/intel_display.c >> index 5bf460caf8a3..a66033e3bdfa 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -11433,7 +11433,7 @@ int intel_get_load_detect_pipe(struct drm_connector >> *connector, >> goto fail; >> } >> >> -crtc_state->base.active = crtc_state->base.enable = true; >> +crtc_state->uapi.active = true; >> >> if (!mode) >> mode = &load_detect_mode; >> @@ -13080,19 +13080,19 @@ intel_pipe_config_compare(const struct >> intel_crtc_state *current_config, >> >> PIPE_CONF_CHECK_X(output_types); >> >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hdisplay); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_htotal); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_end); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hdisplay); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_htotal); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_end); >> >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vdisplay); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vtotal); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_end); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_start); >> -PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vdisplay); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vtotal); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_end); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_start); >> +PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_end); >> >> PIPE_CONF_CHECK_I(pixel_multiplier); >> PIPE_CONF_CHECK_I(output_format); >> @@ -13109,17 +13109,17 @@ intel_pipe_config_compare(const struct >> intel_crtc_state *current_config, >> >> PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); >> >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>DRM_MODE_FLAG_INTERLACE); >> >> if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS)) { >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>DRM_MODE_FLAG_PHSYNC); >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>DRM_MODE_FLAG_NHSYNC); >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>DRM_MODE_FLAG_PVSYNC); >> -PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, >> +PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, >>DRM_MODE_FLAG_NVS
Re: [Intel-gfx] [CI 08/12] drm/i915: Perform manual conversions for plane uapi/hw split, v2.
Op 30-10-2019 om 17:19 schreef Ville Syrjälä: > On Wed, Oct 30, 2019 at 03:26:53PM +0100, Maarten Lankhorst wrote: >> get_crtc_from_states() is called before plane_state is copied to uapi, >> so use the uapi state there. >> >> intel_legacy_cursor_update() could probably get away with looking at >> the hw state, but for clarity always look at the uapi state. >> >> Changes since v1: >> - Convert entirety of intel_legacy_cursor_update (Ville). >> >> Signed-off-by: Maarten Lankhorst >> --- >> .../gpu/drm/i915/display/intel_atomic_plane.c | 8 ++-- >> drivers/gpu/drm/i915/display/intel_display.c | 45 ++- >> 2 files changed, 27 insertions(+), 26 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> index 393fb97a3dca..416cfa439f33 100644 >> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >> @@ -225,11 +225,11 @@ static struct intel_crtc * >> get_crtc_from_states(const struct intel_plane_state *old_plane_state, >> const struct intel_plane_state *new_plane_state) >> { >> -if (new_plane_state->base.crtc) >> -return to_intel_crtc(new_plane_state->base.crtc); >> +if (new_plane_state->uapi.crtc) >> +return to_intel_crtc(new_plane_state->uapi.crtc); >> >> -if (old_plane_state->base.crtc) >> -return to_intel_crtc(old_plane_state->base.crtc); >> +if (old_plane_state->uapi.crtc) >> +return to_intel_crtc(old_plane_state->uapi.crtc); >> >> return NULL; >> } >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >> b/drivers/gpu/drm/i915/display/intel_display.c >> index e30f467eec67..b0b2c46e4c0a 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -15357,12 +15357,12 @@ intel_legacy_cursor_update(struct drm_plane >> *_plane, >> * take the slowpath. Only changing fb or position should be >> * in the fastpath. >> */ >> -if (old_plane_state->base.crtc != &crtc->base || >> -old_plane_state->base.src_w != src_w || >> -old_plane_state->base.src_h != src_h || >> -old_plane_state->base.crtc_w != crtc_w || >> -old_plane_state->base.crtc_h != crtc_h || >> -!old_plane_state->base.fb != !fb) >> +if (old_plane_state->uapi.crtc != &crtc->base || >> +old_plane_state->uapi.src_w != src_w || >> +old_plane_state->uapi.src_h != src_h || >> +old_plane_state->uapi.crtc_w != crtc_w || >> +old_plane_state->uapi.crtc_h != crtc_h || >> +!old_plane_state->uapi.fb != !fb) >> goto slow; >> >> new_plane_state = >> to_intel_plane_state(intel_plane_duplicate_state(&plane->base)); >> @@ -15375,16 +15375,16 @@ intel_legacy_cursor_update(struct drm_plane >> *_plane, >> goto out_free; >> } >> >> -drm_atomic_set_fb_for_plane(&new_plane_state->base, fb); >> +drm_atomic_set_fb_for_plane(&new_plane_state->uapi, fb); >> >> -new_plane_state->base.src_x = src_x; >> -new_plane_state->base.src_y = src_y; >> -new_plane_state->base.src_w = src_w; >> -new_plane_state->base.src_h = src_h; >> -new_plane_state->base.crtc_x = crtc_x; >> -new_plane_state->base.crtc_y = crtc_y; >> -new_plane_state->base.crtc_w = crtc_w; >> -new_plane_state->base.crtc_h = crtc_h; >> +new_plane_state->uapi.src_x = src_x; >> +new_plane_state->uapi.src_y = src_y; >> +new_plane_state->uapi.src_w = src_w; >> +new_plane_state->uapi.src_h = src_h; >> +new_plane_state->uapi.crtc_x = crtc_x; >> +new_plane_state->uapi.crtc_y = crtc_y; >> +new_plane_state->uapi.crtc_w = crtc_w; >> +new_plane_state->uapi.crtc_h = crtc_h; >> >> ret = intel_plane_atomic_check_with_state(crtc_state, new_crtc_state, >>old_plane_state, >> new_plane_state); >> @@ -15395,13 +15395,14 @@ intel_legacy_cursor_update(struct drm_plane >> *_plane, >> if (ret) >> goto out_free; >> >> -intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->base.fb), >> ORIGIN_FLIP); &
[Intel-gfx] [PATCH 08/12] drm/i915: Perform manual conversions for plane uapi/hw split, v2.
get_crtc_from_states() is called before plane_state is copied to uapi, so use the uapi state there. intel_legacy_cursor_update() could probably get away with looking at the hw state, but for clarity always look at the uapi state. Changes since v1: - Convert entirety of intel_legacy_cursor_update (Ville). Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_atomic_plane.c | 8 ++-- drivers/gpu/drm/i915/display/intel_display.c | 45 ++- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 393fb97a3dca..416cfa439f33 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -225,11 +225,11 @@ static struct intel_crtc * get_crtc_from_states(const struct intel_plane_state *old_plane_state, const struct intel_plane_state *new_plane_state) { - if (new_plane_state->base.crtc) - return to_intel_crtc(new_plane_state->base.crtc); + if (new_plane_state->uapi.crtc) + return to_intel_crtc(new_plane_state->uapi.crtc); - if (old_plane_state->base.crtc) - return to_intel_crtc(old_plane_state->base.crtc); + if (old_plane_state->uapi.crtc) + return to_intel_crtc(old_plane_state->uapi.crtc); return NULL; } diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 373c57a4..f244c6a010bc 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -15352,12 +15352,12 @@ intel_legacy_cursor_update(struct drm_plane *_plane, * take the slowpath. Only changing fb or position should be * in the fastpath. */ - if (old_plane_state->base.crtc != &crtc->base || - old_plane_state->base.src_w != src_w || - old_plane_state->base.src_h != src_h || - old_plane_state->base.crtc_w != crtc_w || - old_plane_state->base.crtc_h != crtc_h || - !old_plane_state->base.fb != !fb) + if (old_plane_state->uapi.crtc != &crtc->base || + old_plane_state->uapi.src_w != src_w || + old_plane_state->uapi.src_h != src_h || + old_plane_state->uapi.crtc_w != crtc_w || + old_plane_state->uapi.crtc_h != crtc_h || + !old_plane_state->uapi.fb != !fb) goto slow; new_plane_state = to_intel_plane_state(intel_plane_duplicate_state(&plane->base)); @@ -15370,16 +15370,16 @@ intel_legacy_cursor_update(struct drm_plane *_plane, goto out_free; } - drm_atomic_set_fb_for_plane(&new_plane_state->base, fb); + drm_atomic_set_fb_for_plane(&new_plane_state->uapi, fb); - new_plane_state->base.src_x = src_x; - new_plane_state->base.src_y = src_y; - new_plane_state->base.src_w = src_w; - new_plane_state->base.src_h = src_h; - new_plane_state->base.crtc_x = crtc_x; - new_plane_state->base.crtc_y = crtc_y; - new_plane_state->base.crtc_w = crtc_w; - new_plane_state->base.crtc_h = crtc_h; + new_plane_state->uapi.src_x = src_x; + new_plane_state->uapi.src_y = src_y; + new_plane_state->uapi.src_w = src_w; + new_plane_state->uapi.src_h = src_h; + new_plane_state->uapi.crtc_x = crtc_x; + new_plane_state->uapi.crtc_y = crtc_y; + new_plane_state->uapi.crtc_w = crtc_w; + new_plane_state->uapi.crtc_h = crtc_h; ret = intel_plane_atomic_check_with_state(crtc_state, new_crtc_state, old_plane_state, new_plane_state); @@ -15390,13 +15390,14 @@ intel_legacy_cursor_update(struct drm_plane *_plane, if (ret) goto out_free; - intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->base.fb), ORIGIN_FLIP); - intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb), - to_intel_frontbuffer(new_plane_state->base.fb), + intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb), + ORIGIN_FLIP); + intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb), + to_intel_frontbuffer(new_plane_state->hw.fb), plane->frontbuffer_bit); /* Swap plane state */ - plane->base.state = &new_plane_state->base; + plane->base.state = &new_plane_state->uapi; /* * We cannot swap crtc_state as it may be in use by an atomic commit or @@ -15410,7 +15411,7 @@ intel_legacy_cursor_
[Intel-gfx] [PATCH 12/12] drm/i915: Remove special case slave handling during hw programming, v3.
Now that we split plane_state which I didn't want to do yet, we can program the slave plane without requiring the master plane. This is useful for programming bigjoiner slave planes as well. We will no longer need the master's plane_state. Changes since v1: - set src/dst rectangles after copy_uapi_to_hw_state. Changes since v2: - Use the correct color_plane for pre-gen11 by using planar_linked_plane != NULL. - Use drm_format_info_is_yuv_semiplanar in skl_plane_check() to fix gen11+. Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_atomic_plane.c | 30 +- .../gpu/drm/i915/display/intel_atomic_plane.h | 3 - drivers/gpu/drm/i915/display/intel_display.c | 18 ++ .../drm/i915/display/intel_display_types.h| 6 +- drivers/gpu/drm/i915/display/intel_sprite.c | 57 ++- 5 files changed, 40 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 133e6a75c8a0..42b3b3449d2e 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -348,16 +348,6 @@ void intel_update_plane(struct intel_plane *plane, plane->update_plane(plane, crtc_state, plane_state); } -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state) -{ - struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - - trace_intel_update_plane(&plane->base, crtc); - plane->update_slave(plane, crtc_state, plane_state); -} - void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state) { @@ -390,25 +380,9 @@ void skl_update_planes_on_crtc(struct intel_atomic_state *state, struct intel_plane_state *new_plane_state = intel_atomic_get_new_plane_state(state, plane); - if (new_plane_state->uapi.visible) { + if (new_plane_state->uapi.visible || + new_plane_state->planar_slave) { intel_update_plane(plane, new_crtc_state, new_plane_state); - } else if (new_plane_state->planar_slave) { - struct intel_plane *master = - new_plane_state->planar_linked_plane; - - /* -* We update the slave plane from this function because -* programming it from the master plane's update_plane -* callback runs into issues when the Y plane is -* reassigned, disabled or used by a different plane. -* -* The slave plane is updated with the master plane's -* plane_state. -*/ - new_plane_state = - intel_atomic_get_new_plane_state(state, master); - - intel_update_slave(plane, new_crtc_state, new_plane_state); } else { intel_disable_plane(plane, new_crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index cdb0f97d09f9..5cedafdddb55 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -25,9 +25,6 @@ void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); -void intel_update_slave(struct intel_plane *plane, - const struct intel_crtc_state *crtc_state, - const struct intel_plane_state *plane_state); void intel_disable_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state); struct intel_plane *intel_plane_alloc(void); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 0461b154b3f3..a3e836b6ae0a 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11985,6 +11985,24 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state) crtc_state->active_planes |= BIT(linked->id); crtc_state->update_planes |= BIT(linked->id); DRM_DEBUG_KMS("Using %s as Y plane for %s\n", linked->base.name, plane->base.name); + + /* Copy parameters to slave plane */ + linked_state->ctl = plane_state->ctl | PLANE
[Intel-gfx] [PATCH 11/12] drm/i915: Complete plane hw and uapi split, v2.
Splitting plane state is easier than splitting crtc_state, before plane check we copy the drm properties to hw so we can do the same in bigjoiner later on. We copy the state after we did all the modeset handling, but fortunately i915 seems to be split correctly and nothing during modeset looks at plane_state. Changes since v1: - Do not clear hw state on duplication. Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_atomic_plane.c | 37 ++- .../gpu/drm/i915/display/intel_atomic_plane.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 1 + .../drm/i915/display/intel_display_types.h| 23 +--- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index d456b3dc200c..133e6a75c8a0 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -93,6 +93,10 @@ intel_plane_duplicate_state(struct drm_plane *plane) intel_state->vma = NULL; intel_state->flags = 0; + /* add reference to fb */ + if (intel_state->hw.fb) + drm_framebuffer_get(intel_state->hw.fb); + return &intel_state->uapi; } @@ -112,6 +116,8 @@ intel_plane_destroy_state(struct drm_plane *plane, WARN_ON(plane_state->vma); __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); kfree(plane_state); } @@ -176,15 +182,44 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, return false; } +static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state) +{ + if (plane_state->hw.fb) + drm_framebuffer_put(plane_state->hw.fb); + + memset(&plane_state->hw, 0, sizeof(plane_state->hw)); +} + +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state) +{ + intel_plane_clear_hw_state(plane_state); + + plane_state->hw.crtc = from_plane_state->uapi.crtc; + plane_state->hw.fb = from_plane_state->uapi.fb; + if (plane_state->hw.fb) + drm_framebuffer_get(plane_state->hw.fb); + + plane_state->hw.alpha = from_plane_state->uapi.alpha; + plane_state->hw.pixel_blend_mode = + from_plane_state->uapi.pixel_blend_mode; + plane_state->hw.rotation = from_plane_state->uapi.rotation; + plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding; + plane_state->hw.color_range = from_plane_state->uapi.color_range; +} + int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state, const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); - const struct drm_framebuffer *fb = new_plane_state->hw.fb; + const struct drm_framebuffer *fb; int ret; + intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state); + fb = new_plane_state->hw.fb; + new_crtc_state->active_planes &= ~BIT(plane->id); new_crtc_state->nv12_planes &= ~BIT(plane->id); new_crtc_state->c8_planes &= ~BIT(plane->id); diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index e61e9a82aadf..cdb0f97d09f9 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -20,6 +20,8 @@ extern const struct drm_plane_helper_funcs intel_plane_helper_funcs; unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, + const struct intel_plane_state *from_plane_state); void intel_update_plane(struct intel_plane *plane, const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 826d1c995496..0461b154b3f3 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -3283,6 +3283,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, plane_state->fb
[Intel-gfx] [PATCH 07/12] drm/i915: Add aliases for uapi and hw to plane_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c| 16 .../gpu/drm/i915/display/intel_display_types.h | 8 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 4558c0b29fc1..393fb97a3dca 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -80,22 +80,20 @@ void intel_plane_free(struct intel_plane *plane) struct drm_plane_state * intel_plane_duplicate_state(struct drm_plane *plane) { - struct drm_plane_state *state; struct intel_plane_state *intel_state; - intel_state = kmemdup(plane->state, sizeof(*intel_state), GFP_KERNEL); + intel_state = to_intel_plane_state(plane->state); + intel_state = kmemdup(intel_state, sizeof(*intel_state), GFP_KERNEL); if (!intel_state) return NULL; - state = &intel_state->base; - - __drm_atomic_helper_plane_duplicate_state(plane, state); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); intel_state->vma = NULL; intel_state->flags = 0; - return state; + return &intel_state->base; } /** @@ -110,9 +108,11 @@ void intel_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *state) { - WARN_ON(to_intel_plane_state(state)->vma); + struct intel_plane_state *plane_state = to_intel_plane_state(state); + WARN_ON(plane_state->vma); - drm_atomic_helper_plane_destroy_state(plane, state); + __drm_atomic_helper_plane_destroy_state(&plane_state->base); + kfree(plane_state); } unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 9319ca682105..6036b2b3980b 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -523,7 +523,11 @@ struct intel_atomic_state { }; struct intel_plane_state { - struct drm_plane_state base; + union { + struct drm_plane_state base; + struct drm_plane_state uapi; + struct drm_plane_state hw; + }; struct i915_ggtt_view view; struct i915_vma *vma; unsigned long flags; @@ -1143,7 +1147,7 @@ struct cxsr_latency { #define to_intel_encoder(x) container_of(x, struct intel_encoder, base) #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) #define to_intel_plane(x) container_of(x, struct intel_plane, base) -#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, base) +#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, uapi) #define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL) struct intel_hdmi { -- 2.24.0.rc1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 06/12] drm/i915: Complete crtc hw/uapi split, v6.
Now that we separated everything into uapi and hw, it's time to make the split definitive. Remove the union and make a copy of the hw state on modeset and fastset. Color blobs are copied in crtc atomic_check(), right before color management is checked. Changes since v1: - Copy all blobs immediately after drm_atomic_helper_check_modeset(). - Clear crtc_state->hw on disable, instead of using clear_intel_crtc_state(). Changes since v2: - Use intel_crtc_free_hw_state + clear in intel_crtc_disable_noatomic(). - Make a intel_crtc_prepare_state() function that clears the crtc_state and copies hw members. - Remove setting uapi.adjusted_mode, we now have a direct call to drm_calc_timestamping_constants(). Changes since v3: - Rename prefix copy_hw_to_uapi_state() with intel_crtc. - Copy color blobs to uapi as well. - Add a intel_crtc_copy_uapi_to_hw_state_nomodeset() function for clarity. Changes since v4: - Copy hw.adjusted_mode back to uapi.adjusted_mode, to shut up the call to drm_calc_timestamping_constants() in drm_atomic_helper_update_legacy_modeset_state(). - Use drm_property_replace_blob (Ville). Changes since v5: - Use hw->mode in intel_modeset_readout_hw_state(). (Ville) - Copy to uapi.mode using drm_atomic_set_mode_for_crtc(). (Ville) Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 31 +++ drivers/gpu/drm/i915/display/intel_atomic.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 90 +++ .../drm/i915/display/intel_display_types.h| 9 +- 4 files changed, 109 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 48964f33c0c1..3301c178da03 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->uapi); + /* copy color blobs */ + if (crtc_state->hw.degamma_lut) + drm_property_blob_get(crtc_state->hw.degamma_lut); + if (crtc_state->hw.ctm) + drm_property_blob_get(crtc_state->hw.ctm); + if (crtc_state->hw.gamma_lut) + drm_property_blob_get(crtc_state->hw.gamma_lut); + crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; @@ -208,6 +216,28 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) return &crtc_state->uapi; } +static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state) +{ + drm_property_blob_put(crtc_state->hw.degamma_lut); + drm_property_blob_put(crtc_state->hw.gamma_lut); + drm_property_blob_put(crtc_state->hw.ctm); +} + +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) +{ + intel_crtc_put_color_blobs(crtc_state); +} + +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state) +{ + drm_property_replace_blob(&crtc_state->hw.degamma_lut, + crtc_state->uapi.degamma_lut); + drm_property_replace_blob(&crtc_state->hw.gamma_lut, + crtc_state->uapi.gamma_lut); + drm_property_replace_blob(&crtc_state->hw.ctm, + crtc_state->uapi.ctm); +} + /** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc @@ -223,6 +253,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc, struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); __drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi); + intel_crtc_free_hw_state(crtc_state); kfree(crtc_state); } diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h b/drivers/gpu/drm/i915/display/intel_atomic.h index 49d5cb1b9e0a..7b49623419ba 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.h +++ b/drivers/gpu/drm/i915/display/intel_atomic.h @@ -36,6 +36,8 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector); struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc); void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state); +void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state); +void intel_crtc_copy_color_blobs(struct intel_crtc_state *crtc_state); struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); void intel_atomic_state_clear(struct drm_atomic_state *state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 4a9dc14f2ee2..373c57a4 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7185,6 +7185,8 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc,
[Intel-gfx] [PATCH 03/12] drm/i915: Perform manual conversions for crtc uapi/hw split, v2.
intel_get_load_detect_pipe() needs to set uapi active, uapi enable is set by the call to drm_atomic_set_mode_for_crtc(), so we can remove it. intel_pipe_config_compare() needs to look at hw state, but I didn't change spatch to look at it. It's easy enough to do manually. intel_atomic_check() definitely needs to check for uapi enable, otherwise intel_modeset_pipe_config cannot copy uapi state to hw. Changes since v1: - Actually set uapi.active in get_load_detect_pipe(). Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 42 ++-- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 939dff68bba1..1827d1d728c4 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11432,7 +11432,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, goto fail; } - crtc_state->base.active = crtc_state->base.enable = true; + crtc_state->uapi.active = true; ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, &load_detect_mode); @@ -13077,19 +13077,19 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_X(output_types); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_htotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_hsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_htotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_hsync_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vdisplay); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vtotal); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vblank_end); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_start); - PIPE_CONF_CHECK_I(base.adjusted_mode.crtc_vsync_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vdisplay); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vtotal); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vblank_end); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_start); + PIPE_CONF_CHECK_I(hw.adjusted_mode.crtc_vsync_end); PIPE_CONF_CHECK_I(pixel_multiplier); PIPE_CONF_CHECK_I(output_format); @@ -13106,17 +13106,17 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_INTERLACE); if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS)) { - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NHSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_PVSYNC); - PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, + PIPE_CONF_CHECK_FLAGS(hw.adjusted_mode.flags, DRM_MODE_FLAG_NVSYNC); } @@ -13155,7 +13155,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, bp_gamma = intel_color_get_gamma_bit_precision(pipe_config); if (bp_gamma) - PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, base.gamma_lut, bp_gamma); + PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, hw.gamma_lut, bp_gamma); } @@ -13200,7 +13200,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5) PIPE_CONF_CHECK_I(pipe_bpp); - PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock); + PIPE_CONF_CHECK_CLOCK_FUZZY(hw.adjusted_mode.crtc_clock); PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock); PIPE_CONF_CHECK_I(min_vol
[Intel-gfx] [PATCH 02/12] drm/i915: Add aliases for uapi and hw to crtc_state
Prepare to split up hw and uapi machinally, by adding a uapi and hw alias. We will remove the base in a bit. This is a split from the original uapi/hw patch, which did it all in one go. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_atomic.c | 8 -- drivers/gpu/drm/i915/display/intel_display.c | 2 ++ drivers/gpu/drm/i915/display/intel_display.h | 6 ++--- .../drm/i915/display/intel_display_types.h| 27 ++- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 9cd6d2348a1e..4826aa4ee8e7 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -186,9 +186,10 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector) struct drm_crtc_state * intel_crtc_duplicate_state(struct drm_crtc *crtc) { + const struct intel_crtc_state *old_crtc_state = to_intel_crtc_state(crtc->state); struct intel_crtc_state *crtc_state; - crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL); + crtc_state = kmemdup(old_crtc_state, sizeof(*crtc_state), GFP_KERNEL); if (!crtc_state) return NULL; @@ -219,7 +220,10 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { - drm_atomic_helper_crtc_destroy_state(crtc, state); + struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); + + __drm_atomic_helper_crtc_destroy_state(&crtc_state->base); + kfree(crtc_state); } static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state, diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 397ed1205704..939dff68bba1 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -12592,6 +12592,8 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) /* Keep base drm_crtc_state intact, only clear our extended struct */ BUILD_BUG_ON(offsetof(struct intel_crtc_state, base)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, uapi)); + BUILD_BUG_ON(offsetof(struct intel_crtc_state, hw)); memcpy(&crtc_state->base + 1, &saved_state->base + 1, sizeof(*crtc_state) - sizeof(crtc_state->base)); diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 355c50088589..476bc71e6a83 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -447,10 +447,10 @@ enum phy_fia { #define intel_atomic_crtc_state_for_each_plane_state( \ plane, plane_state, \ crtc_state) \ - for_each_intel_plane_mask(((crtc_state)->base.state->dev), (plane), \ - ((crtc_state)->base.plane_mask)) \ + for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (plane), \ + ((crtc_state)->uapi.plane_mask)) \ for_each_if ((plane_state = \ - to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->base.state, &plane->base + to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &plane->base void intel_link_compute_m_n(u16 bpp, int nlanes, int pixel_clock, int link_clock, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 40184e823c84..e84343d3bf8d 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -757,7 +757,32 @@ enum intel_output_format { }; struct intel_crtc_state { + union { struct drm_crtc_state base; + /* +* uapi (drm) state. This is the software state shown to userspace. +* In particular, the following members are used for bookkeeping: +* - crtc +* - state +* - *_changed +* - event +* - commit +* - mode_blob +*/ + struct drm_crtc_state uapi; + + /* +* actual hardware state, the state we program to the hardware. +* The following members are used to verify the hardware state: +* - enable +* - active +* - mode / adjusted_mode +* - color property blobs. +* +* During initial hw readout, they need to be copied to uapi. +*/ + struct drm_crtc_state hw; + }; /** * quirks - bitfield with hw state readout quirks @@ -1112,7 +1137,7 @@ struct cxsr_latency { #define to_intel_atomic_state(x) container_of(x, struct intel_a
[Intel-gfx] [PATCH 04/12] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> hw.
Split up crtc_state->base to hw where appropriate. This is done using the following patch: @@ struct intel_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -T->base.x +T->hw.x @@ struct drm_crtc_state *T; identifier x =~ "^(active|enable|degamma_lut|gamma_lut|ctm|mode|adjusted_mode)$"; @@ -to_intel_crtc_state(T)->base.x +to_intel_crtc_state(T)->hw.x Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + drivers/gpu/drm/i915/display/icl_dsi.c| 12 +- drivers/gpu/drm/i915/display/intel_audio.c| 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c| 8 +- drivers/gpu/drm/i915/display/intel_color.c| 108 drivers/gpu/drm/i915/display/intel_crt.c | 18 +- drivers/gpu/drm/i915/display/intel_ddi.c | 18 +- drivers/gpu/drm/i915/display/intel_display.c | 259 +- drivers/gpu/drm/i915/display/intel_dp.c | 22 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 6 +- drivers/gpu/drm/i915/display/intel_dvo.c | 12 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 20 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 8 +- drivers/gpu/drm/i915/display/intel_panel.c| 8 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 12 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 +- drivers/gpu/drm/i915/display/intel_sprite.c | 8 +- drivers/gpu/drm/i915/display/intel_tv.c | 4 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 4 +- drivers/gpu/drm/i915/display/vlv_dsi.c| 10 +- drivers/gpu/drm/i915/i915_debugfs.c | 8 +- drivers/gpu/drm/i915/intel_pm.c | 56 ++-- 25 files changed, 317 insertions(+), 313 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 85bef73a6763..fddea7acf7d8 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -33,6 +33,7 @@ #include #include #include +#include #endif #include diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 6e398c33a524..4ec493e4755b 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -276,7 +276,7 @@ static void configure_dual_link_mode(struct intel_encoder *encoder, if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) { const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; u32 dss_ctl2; u16 hactive = adjusted_mode->crtc_hdisplay; u16 dl_buffer_depth; @@ -768,7 +768,7 @@ gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; enum port port; enum transcoder dsi_trans; /* horizontal timings */ @@ -1216,7 +1216,7 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder, { struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; if (intel_dsi->dual_link) { adjusted_mode->crtc_hdisplay *= 2; @@ -1249,9 +1249,9 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, pipe_config->port_clock = cnl_calc_wrpll_link(dev_priv, &pipe_config->dpll_hw_state); - pipe_config->base.adjusted_mode.crtc_clock = intel_dsi->pclk; + pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk; if (intel_dsi->dual_link) - pipe_config->base.adjusted_mode.crtc_clock *= 2; + pipe_config->hw.adjusted_mode.crtc_clock *= 2; gen11_dsi_get_timings(encoder, pipe_config); pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI); @@ -1269,7 +1269,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; struct drm_display_mode *adjusted_mode = -
[Intel-gfx] [PATCH 09/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw.
Split up plane_state->base to hw. This is done using the following patch: @@ struct intel_plane_state *T; identifier x =~ "^(crtc|fb|alpha|pixel_blend_mode|rotation|color_encoding|color_range)$"; @@ -T->base.x +T->hw.x Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_atomic.c | 6 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 8 +- drivers/gpu/drm/i915/display/intel_display.c | 126 +- drivers/gpu/drm/i915/display/intel_fbc.c | 8 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 90 ++--- drivers/gpu/drm/i915/intel_pm.c | 32 ++--- 7 files changed, 136 insertions(+), 136 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 3301c178da03..0a5eee4c350f 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -283,9 +283,9 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta return; /* set scaler mode */ - if (plane_state && plane_state->base.fb && - plane_state->base.fb->format->is_yuv && - plane_state->base.fb->format->num_planes > 1) { + if (plane_state && plane_state->hw.fb && + plane_state->hw.fb->format->is_yuv && + plane_state->hw.fb->format->num_planes > 1) { struct intel_plane *plane = to_intel_plane(plane_state->base.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 416cfa439f33..633535b3 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -118,7 +118,7 @@ intel_plane_destroy_state(struct drm_plane *plane, unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - const struct drm_framebuffer *fb = plane_state->base.fb; + const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; if (!plane_state->base.visible) @@ -144,7 +144,7 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, struct drm_i915_private *dev_priv = to_i915(plane->base.dev); const struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); - struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc); struct intel_crtc_state *crtc_state; if (!plane_state->base.visible || !plane->min_cdclk) @@ -182,7 +182,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ struct intel_plane_state *new_plane_state) { struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); - const struct drm_framebuffer *fb = new_plane_state->base.fb; + const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; new_crtc_state->active_planes &= ~BIT(plane->id); @@ -192,7 +192,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->min_cdclk[plane->id] = 0; new_plane_state->base.visible = false; - if (!new_plane_state->base.crtc && !old_plane_state->base.crtc) + if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) return 0; ret = plane->check_plane(new_crtc_state, new_plane_state); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index f244c6a010bc..9c660108d972 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2215,7 +2215,7 @@ u32 intel_fb_xy_to_linear(int x, int y, const struct intel_plane_state *state, int color_plane) { - const struct drm_framebuffer *fb = state->base.fb; + const struct drm_framebuffer *fb = state->hw.fb; unsigned int cpp = fb->format->cpp[color_plane]; unsigned int pitch = state->color_plane[color_plane].stride; @@ -2316,8 +2316,8 @@ static u32 intel_plane_adjust_aligned_offset(int *x, int *y, int color_plane, u32 old_offset, u32 new_offset) { - return intel_adjust_aligned_offset(x, y, state-&
[Intel-gfx] [PATCH 10/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> uapi.
Split up plane_state->base to uapi. This is done using the following patch, ran after the previous commit that splits out any hw references: @@ struct intel_plane_state *T; identifier x; @@ -T->base.x +T->uapi.x @@ struct intel_plane_state *T; @@ -T->base +T->uapi Signed-off-by: Maarten Lankhorst Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_atomic.c | 2 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 30 +- drivers/gpu/drm/i915/display/intel_display.c | 262 +- drivers/gpu/drm/i915/display/intel_fbc.c | 12 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- drivers/gpu/drm/i915/display/intel_sprite.c | 136 - drivers/gpu/drm/i915/intel_pm.c | 57 ++-- 7 files changed, 251 insertions(+), 250 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 0a5eee4c350f..ea24a45dab86 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -286,7 +286,7 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta if (plane_state && plane_state->hw.fb && plane_state->hw.fb->format->is_yuv && plane_state->hw.fb->format->num_planes > 1) { - struct intel_plane *plane = to_intel_plane(plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); if (IS_GEN(dev_priv, 9) && !IS_GEMINILAKE(dev_priv)) { mode = SKL_PS_SCALER_MODE_NV12; diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index 633535b3..d456b3dc200c 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -56,7 +56,7 @@ struct intel_plane *intel_plane_alloc(void) return ERR_PTR(-ENOMEM); } - __drm_atomic_helper_plane_reset(&plane->base, &plane_state->base); + __drm_atomic_helper_plane_reset(&plane->base, &plane_state->uapi); plane_state->scaler_id = -1; return plane; @@ -88,12 +88,12 @@ intel_plane_duplicate_state(struct drm_plane *plane) if (!intel_state) return NULL; - __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base); + __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->uapi); intel_state->vma = NULL; intel_state->flags = 0; - return &intel_state->base; + return &intel_state->uapi; } /** @@ -111,7 +111,7 @@ intel_plane_destroy_state(struct drm_plane *plane, struct intel_plane_state *plane_state = to_intel_plane_state(state); WARN_ON(plane_state->vma); - __drm_atomic_helper_plane_destroy_state(&plane_state->base); + __drm_atomic_helper_plane_destroy_state(&plane_state->uapi); kfree(plane_state); } @@ -121,7 +121,7 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, const struct drm_framebuffer *fb = plane_state->hw.fb; unsigned int cpp; - if (!plane_state->base.visible) + if (!plane_state->uapi.visible) return 0; cpp = fb->format->cpp[0]; @@ -147,7 +147,7 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc); struct intel_crtc_state *crtc_state; - if (!plane_state->base.visible || !plane->min_cdclk) + if (!plane_state->uapi.visible || !plane->min_cdclk) return false; crtc_state = intel_atomic_get_new_crtc_state(state, crtc); @@ -181,7 +181,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ const struct intel_plane_state *old_plane_state, struct intel_plane_state *new_plane_state) { - struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); + struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane); const struct drm_framebuffer *fb = new_plane_state->hw.fb; int ret; @@ -190,7 +190,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->c8_planes &= ~BIT(plane->id); new_crtc_state->data_rate[plane->id] = 0; new_crtc_state->min_cdclk[plane->id] = 0; - new_plane_state->base.visible = false; + new_plane_state->uapi.visible = false; if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) return 0; @@ -200,18 +2
[Intel-gfx] [PATCH 01/12] drm/i915: Handle a few more cases for crtc hw/uapi split, v3.
We are still looking at drm_crtc_state in a few places, convert those to use intel_crtc_state instead. Changes since v1: - Move to before uapi/hw split. - Add hunks for intel_pm.c as well. Changes since v2: - Incorporate Ville's feedback. Signed-off-by: Maarten Lankhorst Reviewed-by: Matt Roper Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 15 --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 12 drivers/gpu/drm/i915/display/intel_psr.c | 16 +++- drivers/gpu/drm/i915/intel_pm.c | 6 ++ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index a23375621185..397ed1205704 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -16714,8 +16714,7 @@ static int intel_initial_commit(struct drm_device *dev) { struct drm_atomic_state *state = NULL; struct drm_modeset_acquire_ctx ctx; - struct drm_crtc *crtc; - struct drm_crtc_state *crtc_state; + struct intel_crtc *crtc; int ret = 0; state = drm_atomic_state_alloc(dev); @@ -16727,15 +16726,17 @@ static int intel_initial_commit(struct drm_device *dev) retry: state->acquire_ctx = &ctx; - drm_for_each_crtc(crtc, dev) { - crtc_state = drm_atomic_get_crtc_state(state, crtc); + for_each_intel_crtc(dev, crtc) { + struct intel_crtc_state *crtc_state = + intel_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) { ret = PTR_ERR(crtc_state); goto out; } - if (crtc_state->active) { - ret = drm_atomic_add_affected_planes(state, crtc); + if (crtc_state->base.active) { + ret = drm_atomic_add_affected_planes(state, &crtc->base); if (ret) goto out; @@ -16745,7 +16746,7 @@ static int intel_initial_commit(struct drm_device *dev) * having a proper LUT loaded. Remove once we * have readout for pipe gamma enable. */ - crtc_state->color_mgmt_changed = true; + crtc_state->base.color_mgmt_changed = true; } } diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index a9962846a503..42d26214fb23 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -168,7 +168,6 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, struct intel_connector *intel_connector = to_intel_connector(connector); struct drm_crtc *new_crtc = new_conn_state->crtc; - struct drm_crtc_state *crtc_state; struct drm_dp_mst_topology_mgr *mgr; int ret; @@ -183,11 +182,16 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, * connector */ if (new_crtc) { - crtc_state = drm_atomic_get_new_crtc_state(state, new_crtc); + struct intel_atomic_state *intel_state = + to_intel_atomic_state(state); + struct intel_crtc *intel_crtc = to_intel_crtc(new_crtc); + struct intel_crtc_state *crtc_state = + intel_atomic_get_new_crtc_state(intel_state, + intel_crtc); if (!crtc_state || - !drm_atomic_crtc_needs_modeset(crtc_state) || - crtc_state->enable) + !drm_atomic_crtc_needs_modeset(&crtc_state->base) || + crtc_state->base.enable) return 0; } diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 6a9f322d3fca..359a60762b49 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -26,6 +26,7 @@ #include "display/intel_dp.h" #include "i915_drv.h" +#include "intel_atomic.h" #include "intel_display_types.h" #include "intel_psr.h" #include "intel_sprite.h" @@ -1096,7 +1097,7 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct drm_modeset_acquire_ctx ctx; struct drm_atomic_state *state; - struct drm_crtc *crtc; + struct intel_crtc *crtc; int err; state = drm_atomic_state_alloc(dev); @@ -1107,21 +1108,18 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) state->a
Re: [Intel-gfx] [CI 08/12] drm/i915: Perform manual conversions for plane uapi/hw split, v2.
Op 31-10-2019 om 11:30 schreef Ville Syrjälä: > On Thu, Oct 31, 2019 at 10:15:41AM +0100, Maarten Lankhorst wrote: >> Op 30-10-2019 om 17:19 schreef Ville Syrjälä: >>> On Wed, Oct 30, 2019 at 03:26:53PM +0100, Maarten Lankhorst wrote: >>>> get_crtc_from_states() is called before plane_state is copied to uapi, >>>> so use the uapi state there. >>>> >>>> intel_legacy_cursor_update() could probably get away with looking at >>>> the hw state, but for clarity always look at the uapi state. >>>> >>>> Changes since v1: >>>> - Convert entirety of intel_legacy_cursor_update (Ville). >>>> >>>> Signed-off-by: Maarten Lankhorst >>>> --- >>>> .../gpu/drm/i915/display/intel_atomic_plane.c | 8 ++-- >>>> drivers/gpu/drm/i915/display/intel_display.c | 45 ++- >>>> 2 files changed, 27 insertions(+), 26 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >>>> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >>>> index 393fb97a3dca..416cfa439f33 100644 >>>> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c >>>> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c >>>> @@ -225,11 +225,11 @@ static struct intel_crtc * >>>> get_crtc_from_states(const struct intel_plane_state *old_plane_state, >>>> const struct intel_plane_state *new_plane_state) >>>> { >>>> - if (new_plane_state->base.crtc) >>>> - return to_intel_crtc(new_plane_state->base.crtc); >>>> + if (new_plane_state->uapi.crtc) >>>> + return to_intel_crtc(new_plane_state->uapi.crtc); >>>> >>>> - if (old_plane_state->base.crtc) >>>> - return to_intel_crtc(old_plane_state->base.crtc); >>>> + if (old_plane_state->uapi.crtc) >>>> + return to_intel_crtc(old_plane_state->uapi.crtc); >>>> >>>>return NULL; >>>> } >>>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c >>>> b/drivers/gpu/drm/i915/display/intel_display.c >>>> index e30f467eec67..b0b2c46e4c0a 100644 >>>> --- a/drivers/gpu/drm/i915/display/intel_display.c >>>> +++ b/drivers/gpu/drm/i915/display/intel_display.c >>>> @@ -15357,12 +15357,12 @@ intel_legacy_cursor_update(struct drm_plane >>>> *_plane, >>>> * take the slowpath. Only changing fb or position should be >>>> * in the fastpath. >>>> */ >>>> - if (old_plane_state->base.crtc != &crtc->base || >>>> - old_plane_state->base.src_w != src_w || >>>> - old_plane_state->base.src_h != src_h || >>>> - old_plane_state->base.crtc_w != crtc_w || >>>> - old_plane_state->base.crtc_h != crtc_h || >>>> - !old_plane_state->base.fb != !fb) >>>> + if (old_plane_state->uapi.crtc != &crtc->base || >>>> + old_plane_state->uapi.src_w != src_w || >>>> + old_plane_state->uapi.src_h != src_h || >>>> + old_plane_state->uapi.crtc_w != crtc_w || >>>> + old_plane_state->uapi.crtc_h != crtc_h || >>>> + !old_plane_state->uapi.fb != !fb) >>>>goto slow; >>>> >>>>new_plane_state = >>>> to_intel_plane_state(intel_plane_duplicate_state(&plane->base)); >>>> @@ -15375,16 +15375,16 @@ intel_legacy_cursor_update(struct drm_plane >>>> *_plane, >>>>goto out_free; >>>>} >>>> >>>> - drm_atomic_set_fb_for_plane(&new_plane_state->base, fb); >>>> + drm_atomic_set_fb_for_plane(&new_plane_state->uapi, fb); >>>> >>>> - new_plane_state->base.src_x = src_x; >>>> - new_plane_state->base.src_y = src_y; >>>> - new_plane_state->base.src_w = src_w; >>>> - new_plane_state->base.src_h = src_h; >>>> - new_plane_state->base.crtc_x = crtc_x; >>>> - new_plane_state->base.crtc_y = crtc_y; >>>> - new_plane_state->base.crtc_w = crtc_w; >>>> - new_plane_state->base.crtc_h = crtc_h; >>>> + new_plane_state->uapi.src_x = src_x; >>>> + new_plane_state->uapi.src_y = src_y; >>>> + new_plane_state->uapi.src_w = src_w; >>>> + new_plane_state->uapi.src_h = src_h; &
Re: [Intel-gfx] [PATCH 2/3] drm/nouveau: slowpath for pushbuf ioctl
Op 05-11-2019 om 12:04 schreef Daniel Vetter: > On Mon, Nov 04, 2019 at 06:38:00PM +0100, Daniel Vetter wrote: >> We can't copy_*_user while holding reservations, that will (soon even >> for nouveau) lead to deadlocks. And it breaks the cross-driver >> contract around dma_resv. >> >> Fix this by adding a slowpath for when we need relocations, and by >> pushing the writeback of the new presumed offsets to the very end. >> >> Aside from "it compiles" entirely untested unfortunately. >> >> Signed-off-by: Daniel Vetter >> Cc: Ilia Mirkin >> Cc: Maarten Lankhorst >> Cc: Ben Skeggs >> Cc: nouv...@lists.freedesktop.org > Ping for ack/review so I can land this entire series. intel-gfx-ci is all > happy with the rebased version, so nouveau ack is the only hold-up here. I don't feel confident reviewing this as I lack the hw, so all review caveats reply. Having said that, this looks sane, and if it blows up we'll found out eventually. :) Reviewed-by: Maarten Lankhorst ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 1/2] drm/i915: Frob the correct crtc state in intel_crtc_disable_noatomic()
Op 05-11-2019 om 18:14 schreef Ville Syrjala: > From: Ville Syrjälä > > The uapi vs. hw state split introduced a bug in > intel_crtc_disable_noatomic() where it's not frobbing an already > freed temp crtc state instead of adjusting the crtc state we > are really left with. Fix that by making a cleaner separation > beteen the two. > > This causes explosions on any machine that boots up with pipes > already running but not hooked up to any encoder (typical > behaviour for gen2-4 VBIOS). > > Cc: Maarten Lankhorst > Fixes: 58d124ea2739 ("drm/i915: Complete crtc hw/uapi split, v6.") > Signed-off-by: Ville Syrjälä > --- > drivers/gpu/drm/i915/display/intel_display.c | 10 ++ > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 876fc25968bf..1f93860fb897 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -7191,11 +7191,13 @@ static void intel_crtc_disable_noatomic(struct > drm_crtc *crtc, > struct drm_i915_private *dev_priv = to_i915(crtc->dev); > struct intel_bw_state *bw_state = > to_intel_bw_state(dev_priv->bw_obj.state); > + struct intel_crtc_state *crtc_state = > + to_intel_crtc_state(crtc->state); > enum intel_display_power_domain domain; > struct intel_plane *plane; > u64 domains; > struct drm_atomic_state *state; > - struct intel_crtc_state *crtc_state; > + struct intel_crtc_state *temp_crtc_state; > int ret; > > if (!intel_crtc->active) > @@ -7219,12 +7221,12 @@ static void intel_crtc_disable_noatomic(struct > drm_crtc *crtc, > state->acquire_ctx = ctx; > > /* Everything's already locked, -EDEADLK can't happen. */ > - crtc_state = intel_atomic_get_crtc_state(state, intel_crtc); > + temp_crtc_state = intel_atomic_get_crtc_state(state, intel_crtc); > ret = drm_atomic_add_affected_connectors(state, crtc); > > - WARN_ON(IS_ERR(crtc_state) || ret); > + WARN_ON(IS_ERR(temp_crtc_state) || ret); > > - dev_priv->display.crtc_disable(crtc_state, > to_intel_atomic_state(state)); > + dev_priv->display.crtc_disable(temp_crtc_state, > to_intel_atomic_state(state)); > > drm_atomic_state_put(state); > Reviewed-by: Maarten Lankhorst ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PULL] drm-misc-next
drm-misc-next-2020-01-02: drm-misc-next for v5.6: UAPI Changes: - Commandline parser: Add support for panel orientation, and per-mode options. - Fix IOCTL naming for dma-buf heaps. Cross-subsystem Changes: - Rename DMA_HEAP_IOC_ALLOC to DMA_HEAP_IOCTL_ALLOC before it becomes abi. - Change DMA-BUF system-heap's name to system. - Fix leak in error handling in dma_heap_ioctl(), and make a symbol static. - Fix udma-buf cpu access. - Fix ti devicetree bindings. Core Changes: - Add CTA-861-G modes with VIC >= 193. - Change error handling and remove bug_on in *drm_dev_init. - Export drm_panel_of_backlight() correctly once more. - Add support for lvds decoders. - Convert drm/client and drm/(gem-,)fb-helper to drm-device based logging and update logging todo. Driver Changes: - Add support for dsi/px30 to rockchip. - Add fb damage support to virtio. - Use dma_resv locking wrappers in vc4, msm, etnaviv. - Make functions in virtio static, and perform some simplifications. - Add suspend support to sun4i. - Add A64 mipi dsi support to sun4i. - Add runtime pm suspend to komeda. - Associated driver fixes. The following changes since commit 2156873f08c7893811f34177aa923ab1ea486591: drm/tilcdc: Remove obsolete bundled tilcdc tfp410 driver (2019-12-16 10:45:43 +0200) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2020-01-02 for you to fetch changes up to 1ce0d5162b98bf6120db1b259d0f0706e69f15fd: drm/panel: declare variable as __be16 (2020-01-01 19:53:50 +0100) drm-misc-next for v5.6: UAPI Changes: - Commandline parser: Add support for panel orientation, and per-mode options. - Fix IOCTL naming for dma-buf heaps. Cross-subsystem Changes: - Rename DMA_HEAP_IOC_ALLOC to DMA_HEAP_IOCTL_ALLOC before it becomes abi. - Change DMA-BUF system-heap's name to system. - Fix leak in error handling in dma_heap_ioctl(), and make a symbol static. - Fix udma-buf cpu access. - Fix ti devicetree bindings. Core Changes: - Add CTA-861-G modes with VIC >= 193. - Change error handling and remove bug_on in *drm_dev_init. - Export drm_panel_of_backlight() correctly once more. - Add support for lvds decoders. - Convert drm/client and drm/(gem-,)fb-helper to drm-device based logging and update logging todo. Driver Changes: - Add support for dsi/px30 to rockchip. - Add fb damage support to virtio. - Use dma_resv locking wrappers in vc4, msm, etnaviv. - Make functions in virtio static, and perform some simplifications. - Add suspend support to sun4i. - Add A64 mipi dsi support to sun4i. - Add runtime pm suspend to komeda. - Associated driver fixes. Aditya Pakki (1): drm: remove duplicate check on parent and avoid BUG_ON Andrew F. Davis (2): dma-buf: heaps: Use _IOCTL_ for userspace IOCTL identifier dma-buf: heaps: Remove redundant heap identifier from system heap name Andy Shevchenko (1): drm/drm_panel: Fix EXPORT of drm_panel_of_backlight() one more time Colin Ian King (2): dma-buf: fix resource leak on -ENOTTY error return path drm/gma500: fix null dereference of pointer fb before null check Daniel Vetter (7): drm/virtio: plane_state->fb iff plane_state->crtc drm/msm: Use dma_resv locking wrappers drm/vc4: Use dma_resv locking wrappers drm/etnaviv: Use dma_resv locking wrappers drm/malidp: plane_state->fb iff plane_state->crtc drm/mediatek: plane_state->fb iff plane_state->crtc drm/todo: Updating logging todo Fabrizio Castro (10): dt-bindings: display: bridge: Convert lvds-transmitter binding to json-schema dt-bindings: display: bridge: lvds-transmitter: Document powerdown-gpios dt-bindings: display: bridge: lvds-transmitter: Absorb ti, ds90c185.txt dt-bindings: display: bridge: lvds-transmitter: Document "ti, sn75lvds83" drm/bridge: Repurpose lvds-encoder.c drm/bridge: lvds-codec: Add "lvds-decoder" support drm/bridge: lvds-codec: Simplify panel DT node localisation dt-bindings: display: bridge: Repurpose lvds-encoder dt-bindings: display: bridge: lvds-codec: Document ti, ds90cf384a dt-bindings: display: bridge: lvds-codec: Absorb thine, thc63lvdm83d.txt Gerd Hoffmann (3): drm/virtio: skip set_scanout if framebuffer didn't change drm/virtio: batch display update commands. drm/virtio: use damage info for display updates. Gurchetan Singh (7): udmabuf: fix dma-buf cpu access drm/virtio: static-ify virtio_fence_signaled drm/virtio: static-ify virtio_gpu_framebuffer_init drm/virtio: get rid of drm_encoder_to_virtio_gpu_output drm/virtio: simplify getting fake offset drm/virtio: move to_virtio_fence inside virtgpu_fence drm/virtio: move drm_connector_to_virtio_gpu_output to virtgpu_display Hans de Goede (11): drm/modes: parse_cmdline: Fix pos
[Intel-gfx] [CI] drm/i915: Remove nest annotation from intel_context_unpin
Lets see what breaks? Round 2? Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/intel_context.c | 28 +-- drivers/gpu/drm/i915/gt/intel_context_types.h | 1 + 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c index 61c39e943f69..614258e268e4 100644 --- a/drivers/gpu/drm/i915/gt/intel_context.c +++ b/drivers/gpu/drm/i915/gt/intel_context.c @@ -48,21 +48,30 @@ int __intel_context_do_pin(struct intel_context *ce) { int err; - if (mutex_lock_interruptible(&ce->pin_mutex)) - return -EINTR; - - if (likely(!atomic_read(&ce->pin_count))) { - intel_wakeref_t wakeref; + if (unlikely(!test_bit(CONTEXT_ALLOC_BIT, &ce->flags))) { + err = mutex_lock_interruptible(&ce->alloc_mutex); + if (err) + return err; - if (unlikely(!test_bit(CONTEXT_ALLOC_BIT, &ce->flags))) { + if (!test_bit(CONTEXT_ALLOC_BIT, &ce->flags)) { err = ce->ops->alloc(ce); if (unlikely(err)) goto err; + smp_mb(); /* Make sure allocation is flushed to memory */ + __set_bit(CONTEXT_ALLOC_BIT, &ce->flags); } + mutex_unlock(&ce->alloc_mutex); + } + + err = mutex_lock_interruptible(&ce->pin_mutex); + if (err) + return err; + + if (likely(!atomic_read(&ce->pin_count))) { + intel_wakeref_t wakeref; - err = 0; with_intel_runtime_pm(ce->engine->uncore->rpm, wakeref) err = ce->ops->pin(ce); if (err) @@ -95,14 +104,13 @@ void intel_context_unpin(struct intel_context *ce) /* We may be called from inside intel_context_pin() to evict another */ intel_context_get(ce); - mutex_lock_nested(&ce->pin_mutex, SINGLE_DEPTH_NESTING); + mutex_lock(&ce->pin_mutex); if (likely(atomic_dec_and_test(&ce->pin_count))) { GEM_TRACE("%s context:%llx retire\n", ce->engine->name, ce->timeline->fence_context); ce->ops->unpin(ce); - i915_gem_context_put(ce->gem_context); intel_context_active_release(ce); } @@ -246,6 +254,7 @@ intel_context_init(struct intel_context *ce, INIT_LIST_HEAD(&ce->signals); mutex_init(&ce->pin_mutex); + mutex_init(&ce->alloc_mutex); i915_active_init(&ce->active, __intel_context_active, __intel_context_retire); @@ -257,6 +266,7 @@ void intel_context_fini(struct intel_context *ce) intel_timeline_put(ce->timeline); i915_vm_put(ce->vm); + mutex_destroy(&ce->alloc_mutex); mutex_destroy(&ce->pin_mutex); i915_active_fini(&ce->active); } diff --git a/drivers/gpu/drm/i915/gt/intel_context_types.h b/drivers/gpu/drm/i915/gt/intel_context_types.h index d1204cc899a3..a987df89caaf 100644 --- a/drivers/gpu/drm/i915/gt/intel_context_types.h +++ b/drivers/gpu/drm/i915/gt/intel_context_types.h @@ -65,6 +65,7 @@ struct intel_context { atomic_t pin_count; struct mutex pin_mutex; /* guards pinning and associated on-gpuing */ + struct mutex alloc_mutex; /* guards against concurrent contex allocation */ /** * active: Active tracker for the rq activity (inc. external) on this -- 2.24.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Remove nest annotation from intel_context_unpin
Lets see what breaks, round 3? Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/intel_context.c | 27 +-- drivers/gpu/drm/i915/gt/intel_context_types.h | 1 + 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c index fbaa9df6f436..671049695e6b 100644 --- a/drivers/gpu/drm/i915/gt/intel_context.c +++ b/drivers/gpu/drm/i915/gt/intel_context.c @@ -47,21 +47,30 @@ int __intel_context_do_pin(struct intel_context *ce) { int err; - if (mutex_lock_interruptible(&ce->pin_mutex)) - return -EINTR; - - if (likely(!atomic_read(&ce->pin_count))) { - intel_wakeref_t wakeref; + if (unlikely(!test_bit(CONTEXT_ALLOC_BIT, &ce->flags))) { + err = mutex_lock_interruptible(&ce->alloc_mutex); + if (err) + return err; - if (unlikely(!test_bit(CONTEXT_ALLOC_BIT, &ce->flags))) { + if (!test_bit(CONTEXT_ALLOC_BIT, &ce->flags)) { err = ce->ops->alloc(ce); if (unlikely(err)) goto err; + smp_mb(); /* Make sure allocation is flushed to memory */ + __set_bit(CONTEXT_ALLOC_BIT, &ce->flags); } + mutex_unlock(&ce->alloc_mutex); + } + + err = mutex_lock_interruptible(&ce->pin_mutex); + if (err) + return err; + + if (likely(!atomic_read(&ce->pin_count))) { + intel_wakeref_t wakeref; - err = 0; with_intel_runtime_pm(ce->engine->uncore->rpm, wakeref) err = ce->ops->pin(ce); if (err) @@ -91,7 +100,7 @@ void intel_context_unpin(struct intel_context *ce) /* We may be called from inside intel_context_pin() to evict another */ intel_context_get(ce); - mutex_lock_nested(&ce->pin_mutex, SINGLE_DEPTH_NESTING); + mutex_lock(&ce->pin_mutex); if (likely(atomic_dec_and_test(&ce->pin_count))) { CE_TRACE(ce, "retire\n"); @@ -228,6 +237,7 @@ intel_context_init(struct intel_context *ce, INIT_LIST_HEAD(&ce->signals); mutex_init(&ce->pin_mutex); + mutex_init(&ce->alloc_mutex); i915_active_init(&ce->active, __intel_context_active, __intel_context_retire); @@ -239,6 +249,7 @@ void intel_context_fini(struct intel_context *ce) intel_timeline_put(ce->timeline); i915_vm_put(ce->vm); + mutex_destroy(&ce->alloc_mutex); mutex_destroy(&ce->pin_mutex); i915_active_fini(&ce->active); } diff --git a/drivers/gpu/drm/i915/gt/intel_context_types.h b/drivers/gpu/drm/i915/gt/intel_context_types.h index ca1420fb8b53..abae296980fa 100644 --- a/drivers/gpu/drm/i915/gt/intel_context_types.h +++ b/drivers/gpu/drm/i915/gt/intel_context_types.h @@ -72,6 +72,7 @@ struct intel_context { atomic_t pin_count; struct mutex pin_mutex; /* guards pinning and associated on-gpuing */ + struct mutex alloc_mutex; /* guards against concurrent contex allocation */ /** * active: Active tracker for the rq activity (inc. external) on this -- 2.24.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 7/8] drm/i915/gt: Drop mutex serialisation between context pin/unpin
Op 06-01-2020 om 11:22 schreef Chris Wilson: > The last remaining reason for serialising the pin/unpin of the > intel_context is to ensure that our preallocated wakerefs are not > consumed too early (i.e. the unpin of the previous phase does not emit > the idle barriers for this phase before we even submit). All of the > other operations within the context pin/unpin are supposed to be > atomic... Therefore, we can reduce the serialisation to being just on > the i915_active.preallocated_barriers itself and drop the nested > pin_mutex from intel_context_unpin(). > > Signed-off-by: Chris Wilson > Cc: Tvrtko Ursulin > Cc: Maarten Lankhorst > --- > drivers/gpu/drm/i915/gt/intel_context.c | 18 +- > drivers/gpu/drm/i915/i915_active.c | 19 +++ > 2 files changed, 20 insertions(+), 17 deletions(-) For whole series, except 5 and 6: Reviewed-by: Maarten Lankhorst For 5 and 6, I think they look sane but I'm not the right person to review. :) > diff --git a/drivers/gpu/drm/i915/gt/intel_context.c > b/drivers/gpu/drm/i915/gt/intel_context.c > index 4d0bc1478ccd..34ec958d400e 100644 > --- a/drivers/gpu/drm/i915/gt/intel_context.c > +++ b/drivers/gpu/drm/i915/gt/intel_context.c > @@ -86,22 +86,14 @@ int __intel_context_do_pin(struct intel_context *ce) > > void intel_context_unpin(struct intel_context *ce) > { > - if (likely(atomic_add_unless(&ce->pin_count, -1, 1))) > + if (!atomic_dec_and_test(&ce->pin_count)) > return; > > - /* We may be called from inside intel_context_pin() to evict another */ > - intel_context_get(ce); > - mutex_lock_nested(&ce->pin_mutex, SINGLE_DEPTH_NESTING); > - > - if (likely(atomic_dec_and_test(&ce->pin_count))) { > - CE_TRACE(ce, "retire\n"); > + CE_TRACE(ce, "unpin\n"); > + ce->ops->unpin(ce); > > - ce->ops->unpin(ce); > - > - intel_context_active_release(ce); > - } > - > - mutex_unlock(&ce->pin_mutex); > + intel_context_get(ce); > + intel_context_active_release(ce); > intel_context_put(ce); > } > Might want to put a comment here why intel_context_get is needed? > diff --git a/drivers/gpu/drm/i915/i915_active.c > b/drivers/gpu/drm/i915/i915_active.c > index cfe09964622b..f3da5c06f331 100644 > --- a/drivers/gpu/drm/i915/i915_active.c > +++ b/drivers/gpu/drm/i915/i915_active.c > @@ -605,12 +605,15 @@ int i915_active_acquire_preallocate_barrier(struct > i915_active *ref, > struct intel_engine_cs *engine) > { > intel_engine_mask_t tmp, mask = engine->mask; > + struct llist_node *pos = NULL, *next; > struct intel_gt *gt = engine->gt; > - struct llist_node *pos, *next; > int err; > > GEM_BUG_ON(i915_active_is_idle(ref)); > - GEM_BUG_ON(!llist_empty(&ref->preallocated_barriers)); > + > + /* Wait until the previous preallocation is completed */ > + while (!llist_empty(&ref->preallocated_barriers)) > + cond_resched(); > > /* >* Preallocate a node for each physical engine supporting the target > @@ -653,16 +656,24 @@ int i915_active_acquire_preallocate_barrier(struct > i915_active *ref, > GEM_BUG_ON(rcu_access_pointer(node->base.fence) != > ERR_PTR(-EAGAIN)); > > GEM_BUG_ON(barrier_to_engine(node) != engine); > - llist_add(barrier_to_ll(node), &ref->preallocated_barriers); > + next = barrier_to_ll(node); > + next->next = pos; > + if (!pos) > + pos = next; > intel_engine_pm_get(engine); > } > > + GEM_BUG_ON(!llist_empty(&ref->preallocated_barriers)); > + llist_add_batch(next, pos, &ref->preallocated_barriers); > + > return 0; > > unwind: > - llist_for_each_safe(pos, next, take_preallocated_barriers(ref)) { > + while (pos) { > struct active_node *node = barrier_from_ll(pos); > > + pos = pos->next; > + > atomic_dec(&ref->count); > intel_engine_pm_put(barrier_to_engine(node)); > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PULL] drm-misc-next
drm-misc-next-2020-01-07: drm-misc-next for v5.6: UAPI Changes: - Allow overriding number of bootup penguins in fbcon using fbcon=logo-count:n. Cross-subsystem Changes: - fbdev fixes for mmp, and make it work with CONFIG_COMPILE_TEST. - Use devm_platform_ioremap_resource in fbdev drivers. - Various small fbdev fixes. Core Changes: - Support scanline alignment for dumb buffers. - Add atomic_check() hook to bridge ops, to support bus format negotiation. - Add gem_create_object() to vram helpers. Driver Changes: - Rockchip: Add support for PX30. - Use generic fbdev code and dumb helpers in hisilicon/hibmc. - Add support for Leadtek LTK500HD1829 panel, and xinpeng XPP055C272. - Clock fixes for atmel-hlcdc. - Various smaller fixes to all drivers. The following changes since commit f5c547efa16c0ea5abff0596e829f502be11902e: Merge tag 'drm-misc-next-2020-01-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-next (2020-01-03 11:43:44 +1000) are available in the Git repository at: git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2020-01-07 for you to fetch changes up to 3cacb2086e41bbdf4a43e494d47d05db356992b9: drm/mgag200: Add module parameter to pin all buffers at offset 0 (2020-01-07 11:53:19 +0100) drm-misc-next for v5.6: UAPI Changes: - Allow overriding number of bootup penguins in fbcon using fbcon=logo-count:n. Cross-subsystem Changes: - fbdev fixes for mmp, and make it work with CONFIG_COMPILE_TEST. - Use devm_platform_ioremap_resource in fbdev drivers. - Various small fbdev fixes. Core Changes: - Support scanline alignment for dumb buffers. - Add atomic_check() hook to bridge ops, to support bus format negotiation. - Add gem_create_object() to vram helpers. Driver Changes: - Rockchip: Add support for PX30. - Use generic fbdev code and dumb helpers in hisilicon/hibmc. - Add support for Leadtek LTK500HD1829 panel, and xinpeng XPP055C272. - Clock fixes for atmel-hlcdc. - Various smaller fixes to all drivers. Andrew F. Davis (1): omapfb/dss: remove unneeded conversions to bool Bartlomiej Zolnierkiewicz (3): video: fbdev: mmp: remove duplicated MMP_DISP dependency video: fbdev: mmp: add COMPILE_TEST support video: fbdev: mmp: fix sparse warnings about using incorrect types Boris Brezillon (4): drm/bridge: Add a drm_bridge_state object drm/bridge: Patch atomic hooks to take a drm_bridge_state drm/bridge: Add an ->atomic_check() hook drm/bridge: Add the necessary bits to support bus format negotiation Christophe JAILLET (1): pxa168fb: Fix the function used to release some memory in an error handling path Claudiu Beznea (3): drm: atmel-hlcdc: use double rate for pixel clock only if supported drm: atmel-hlcdc: enable clock before configuring timing engine Revert "drm: atmel-hlcdc: enable sys_clk during initalization." Colin Ian King (1): fbdev: matrox: make array wtst_xlat static const, makes object smaller Geert Uytterhoeven (1): drm/mipi_dbi: Fix off-by-one bugs in mipi_dbi_blank() Gustavo A. R. Silva (1): video: fbdev: fsl-diu-fb: mark expected switch fall-throughs Heiko Stuebner (6): dt-bindings: Add vendor prefix for Xinpeng Technology dt-bindings: display: panel: Add binding document for Xinpeng XPP055C272 drm/panel: add panel driver for Xinpeng XPP055C272 panels dt-bindings: Add vendor prefix for Leadtek Technology dt-bindings: display: panel: Add binding document for Leadtek LTK500HD1829 drm/panel: add panel driver for Leadtek LTK500HD1829 Julia Lawall (1): drm: bridge: dw-hdmi: constify copied structure Maarten Lankhorst (1): Merge drm/drm-next into drm-misc-next Markus Elfring (2): video: ocfb: Use devm_platform_ioremap_resource() in ocfb_probe() video: pxafb: Use devm_platform_ioremap_resource() in pxafb_probe() Miquel Raynal (9): dt-bindings: display: rockchip-lvds: Declare PX30 compatible dt-bindings: display: rockchip-lvds: Document PX30 PHY drm/rockchip: lvds: Fix indentation of a #define drm/rockchip: lvds: Harmonize function names drm/rockchip: lvds: Change platform data to hold helper_funcs pointer drm/rockchip: lvds: Create an RK3288 specific probe function drm/rockchip: lvds: improve error handling in helper functions drm/rockchip: lvds: move hardware-specific functions together drm/rockchip: lvds: Add PX30 support Nickey Yang (1): drm: rockchip: rk3066_hdmi: set edid fifo address Peter Rosin (4): fbdev: fix numbering of fbcon options fbdev: fbmem: allow overriding the number of bootup logos fbdev: fbmem: avoid exporting fb_center_logo drm: atmel-hlcdc: prefer a lower pixel-clock than requested Sam Ravnborg (1): dt-bindings: fix warnings in
Re: [Intel-gfx] [PATCH 2/2] drm/i915/gt: Pull context activation into central intel_context_pin()
Op 08-01-2020 om 13:23 schreef Chris Wilson: > While this is encroaching on midlayer territory, having already made the > state allocation a previous step in pinning, we can now pull the common > intel_context_active_acquire() into intel_context_pin() itself. This is > a prelude to make the activation a separate step inside pinning, outside > of the ce->pin_mutex > > Signed-off-by: Chris Wilson > Cc: Maarten Lankhorst > Cc: Tvrtko Ursulin Yeah, hopefully with both we can finally fix the issue. With that, for both patches: Reviewed-by: Maarten Lankhorst > drivers/gpu/drm/i915/gt/intel_context.c | 64 ++- > drivers/gpu/drm/i915/gt/intel_context.h | 3 - > drivers/gpu/drm/i915/gt/intel_lrc.c | 16 + > .../gpu/drm/i915/gt/intel_ring_submission.c | 16 + > drivers/gpu/drm/i915/gt/mock_engine.c | 2 +- > 5 files changed, 39 insertions(+), 62 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_context.c > b/drivers/gpu/drm/i915/gt/intel_context.c > index eefe0996ade1..85f161fd46f8 100644 > --- a/drivers/gpu/drm/i915/gt/intel_context.c > +++ b/drivers/gpu/drm/i915/gt/intel_context.c > @@ -63,6 +63,34 @@ int intel_context_alloc_state(struct intel_context *ce) > return 0; > } > > +static int intel_context_active_acquire(struct intel_context *ce) > +{ > + int err; > + > + err = i915_active_acquire(&ce->active); > + if (err) > + return err; > + > + /* Preallocate tracking nodes */ > + if (!intel_context_is_barrier(ce)) { > + err = i915_active_acquire_preallocate_barrier(&ce->active, > + ce->engine); > + if (err) { > + i915_active_release(&ce->active); > + return err; > + } > + } > + > + return 0; > +} > + > +static void intel_context_active_release(struct intel_context *ce) > +{ > + /* Nodes preallocated in intel_context_active() */ > + i915_active_acquire_barrier(&ce->active); > + i915_active_release(&ce->active); > +} > + > int __intel_context_do_pin(struct intel_context *ce) > { > int err; > @@ -79,11 +107,15 @@ int __intel_context_do_pin(struct intel_context *ce) > if (likely(!atomic_read(&ce->pin_count))) { > intel_wakeref_t wakeref; > > + err = intel_context_active_acquire(ce); > + if (unlikely(err)) > + goto err; > + > err = 0; > with_intel_runtime_pm(ce->engine->uncore->rpm, wakeref) > err = ce->ops->pin(ce); > if (err) > - goto err; > + goto err_active; > > CE_TRACE(ce, "pin ring:{head:%04x, tail:%04x}\n", >ce->ring->head, ce->ring->tail); > @@ -97,6 +129,8 @@ int __intel_context_do_pin(struct intel_context *ce) > mutex_unlock(&ce->pin_mutex); > return 0; > > +err_active: > + intel_context_active_release(ce); > err: > mutex_unlock(&ce->pin_mutex); > return err; > @@ -198,34 +232,6 @@ static int __intel_context_active(struct i915_active > *active) > return err; > } > > -int intel_context_active_acquire(struct intel_context *ce) > -{ > - int err; > - > - err = i915_active_acquire(&ce->active); > - if (err) > - return err; > - > - /* Preallocate tracking nodes */ > - if (!intel_context_is_barrier(ce)) { > - err = i915_active_acquire_preallocate_barrier(&ce->active, > - ce->engine); > - if (err) { > - i915_active_release(&ce->active); > - return err; > - } > - } > - > - return 0; > -} > - > -void intel_context_active_release(struct intel_context *ce) > -{ > - /* Nodes preallocated in intel_context_active() */ > - i915_active_acquire_barrier(&ce->active); > - i915_active_release(&ce->active); > -} > - > void > intel_context_init(struct intel_context *ce, > struct intel_engine_cs *engine) > diff --git a/drivers/gpu/drm/i915/gt/intel_context.h > b/drivers/gpu/drm/i915/gt/intel_context.h > index 673f5fb2967a..f0f49b50b968 100644 > --- a/drivers/gpu/drm/i915/gt/intel_context.h > +++ b/drivers/gpu/drm/i915/gt/intel_context.h > @@ -118,9 +118,6 @@ static inline void intel_context_exit(struct >