Re: [Intel-gfx] [PATCH v2] drm/probe_helper: sort out poll_running vs poll_enabled
On Wed, 18 Jan 2023, Dmitry Baryshkov wrote: > There are two flags attemting to guard connector polling: > poll_enabled and poll_running. While poll_enabled semantics is clearly > defined and fully adhered (mark that drm_kms_helper_poll_init() was > called and not finalized by the _fini() call), the poll_running flag > doesn't have such clearliness. > > This flag is used only in drm_helper_probe_single_connector_modes() to > guard calling of drm_kms_helper_poll_enable, it doesn't guard the > drm_kms_helper_poll_fini(), etc. Change it to only be set if the polling > is actually running. Tie HPD enablement to this flag. > > This fixes the following warning reported after merging the HPD series: > > Hot plug detection already enabled > WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 > drm_bridge_hpd_enable+0x94/0x9c [drm] > Modules linked in: videobuf2_memops snd_soc_simple_card > snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common > snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov > CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6 > Hardware name: NXP i.MX8MQ EVK (DT) > Workqueue: events_unbound deferred_probe_work_func > pstate: 6005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) > pc : drm_bridge_hpd_enable+0x94/0x9c [drm] > lr : drm_bridge_hpd_enable+0x94/0x9c [drm] > sp : 89ef3740 > x29: 89ef3740 x28: 09331f00 x27: 1000 > x26: 0020 x25: 81148ed8 x24: 0a8fe000 > x23: fffd x22: 05086348 x21: 81133ee0 > x20: 0550d800 x19: 05086288 x18: 0006 > x17: x16: 896ef008 x15: 972891004260 > x14: 2a1403e19400 x13: 972891004260 x12: 2a1403e19400 > x11: 7100385f29400801 x10: 0aa0 x9 : 88112744 > x8 : 00250b00 x7 : 0003 x6 : 0011 > x5 : x4 : bd986a48 x3 : 0001 > x2 : x1 : x0 : 0025 > Call trace: > drm_bridge_hpd_enable+0x94/0x9c [drm] > drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper] > drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper] > drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper] > drm_client_modeset_probe+0x204/0x1190 [drm] > __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper] > drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper] > drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper] > drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper] > dcss_kms_attach+0x1c8/0x254 [imx_dcss] > dcss_drv_platform_probe+0x90/0xfc [imx_dcss] > platform_probe+0x70/0xcc > really_probe+0xc4/0x2e0 > __driver_probe_device+0x80/0xf0 > driver_probe_device+0xe0/0x164 > __device_attach_driver+0xc0/0x13c > bus_for_each_drv+0x84/0xe0 > __device_attach+0xa4/0x1a0 > device_initial_probe+0x1c/0x30 > bus_probe_device+0xa4/0xb0 > deferred_probe_work_func+0x90/0xd0 > process_one_work+0x200/0x474 > worker_thread+0x74/0x43c > kthread+0xfc/0x110 > ret_from_fork+0x10/0x20 > ---[ end trace ]--- > > Reported-by: Laurentiu Palcu > Fixes: c8268795c9a9 ("drm/probe-helper: enable and disable HPD on connectors") > Tested-by: Marek Szyprowski > Tested-by: Chen-Yu Tsai > Signed-off-by: Dmitry Baryshkov > --- > > Changes since v1: > - Fixed drm_kms_helper_enable_hpd() to call enable_hpd() instead of > disable_hpd(). > > --- > drivers/gpu/drm/drm_probe_helper.c | 110 + > 1 file changed, 63 insertions(+), 47 deletions(-) > > diff --git a/drivers/gpu/drm/drm_probe_helper.c > b/drivers/gpu/drm/drm_probe_helper.c > index 7973f2589ced..04754bb7b131 100644 > --- a/drivers/gpu/drm/drm_probe_helper.c > +++ b/drivers/gpu/drm/drm_probe_helper.c > @@ -222,6 +222,45 @@ drm_connector_mode_valid(struct drm_connector *connector, > return ret; > } > > +static void drm_kms_helper_disable_hpd(struct drm_device *dev) > +{ > + struct drm_connector *connector; > + struct drm_connector_list_iter conn_iter; > + > + drm_connector_list_iter_begin(dev, &conn_iter); > + drm_for_each_connector_iter(connector, &conn_iter) { > + const struct drm_connector_helper_funcs *funcs = > + connector->helper_private; > + > + if (funcs && funcs->disable_hpd) > + funcs->disable_hpd(connector); > + } > + drm_connector_list_iter_end(&conn_iter); > +} > + > +static bool drm_kms_helper_enable_hpd(struct drm_device *dev) > +{ > + bool poll = false; > + struct drm_connector *connector; > + struct drm_connector_list_iter conn_iter; > + > + drm_connector_list_iter_begin(dev, &conn_iter); > + drm_for_each_connector_iter(connector, &conn_iter) { > + const struct drm_connector_helper_funcs *funcs = > + connector->helper_private; > + > + if (funcs && func
Re: [Intel-gfx] [PATCH 1/2] drm/i915/mtl: Add workarounds Wa_14017066071, Wa_14017654203
On Fri, 20 Jan 2023, Rodrigo Vivi wrote: > On Thu, Jan 19, 2023 at 05:06:38PM -0800, Radhakrishna Sripada wrote: >> This patch add the workaround to disable Sampler-OOO to avoid hang >> during a benchmark. >> >> Original Author: Madhumitha Tolakanhalli Pradeep > > This is not how we handle this. We keep her original authorship email > and signed-off. Also, "This patch" is redundant, and once committed, just wrong. > >> Signed-off-by: Radhakrishna Sripada >> --- >> drivers/gpu/drm/i915/gt/intel_gt_regs.h | 1 + >> drivers/gpu/drm/i915/gt/intel_workarounds.c | 7 +++ >> 2 files changed, 8 insertions(+) >> >> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h >> b/drivers/gpu/drm/i915/gt/intel_gt_regs.h >> index 4a4bab261e66..27b06ff380a9 100644 >> --- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h >> +++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h >> @@ -1145,6 +1145,7 @@ >> #define ENABLE_SMALLPLREG_BIT(15) >> #define SC_DISABLE_POWER_OPTIMIZATION_EBB REG_BIT(9) >> #define GEN11_SAMPLER_ENABLE_HEADLESS_MSG REG_BIT(5) >> +#define MTL_DISABLE_SAMPLER_SC_OOOREG_BIT(3) >> >> #define GEN9_HALF_SLICE_CHICKEN7MCR_REG(0xe194) >> #define DG2_DISABLE_ROUND_ENABLE_ALLOW_FOR_SSLA REG_BIT(15) >> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c >> b/drivers/gpu/drm/i915/gt/intel_workarounds.c >> index 918a271447e2..c52c5f9ad9ce 100644 >> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c >> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c >> @@ -2332,6 +2332,13 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, >> struct i915_wa_list *wal) >> /* Wa_22014600077 */ >> wa_mcr_masked_en(wal, GEN10_CACHE_MODE_SS, >> ENABLE_EU_COUNT_FOR_TDL_FLUSH); >> + >> +/* >> + * Wa_14017066071: mtl-p/m[a0] >> + * Wa_14017654203: mtl-p/m[a0] >> + */ >> +wa_mcr_masked_en(wal, GEN10_SAMPLER_MODE, >> + MTL_DISABLE_SAMPLER_SC_OOO); >> } >> >> if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || >> -- >> 2.34.1 >> -- Jani Nikula, Intel Open Source Graphics Center
[Intel-gfx] [PATCH] drm/i915/fbdev: Implement wrappers for callbacks used by fbcon
After disconnecting damage worker from update logic our dirty callback is not called on fbcon events. This is causing problems to features (PSR, FBC, DRRS) relying on dirty callback getting called and breaking fb console when these features are in use. Implement wrappers for callbacks used by fbcon and call our dirty callback in those. Fixes: f231af498c29 ("drm/fb-helper: Disconnect damage worker from update logic") Cc: Ville Syrjälä Cc: Thomas Zimmermann Cc: Jani Nikula Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_fbdev.c | 53 -- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 19f3b5d92a55..b1653624552e 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -77,6 +77,18 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev) intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU); } +static void intel_fbdev_dirty(struct fb_info *info) +{ + struct drm_fb_helper *helper = info->par; + + /* +* Intel_fb dirty implementation doesn't use damage clips -> +* no need to pass them here +*/ + if (helper->fb->funcs->dirty) + helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, NULL, 0); +} + static int intel_fbdev_set_par(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; @@ -91,6 +103,39 @@ static int intel_fbdev_set_par(struct fb_info *info) return ret; } +static ssize_t intel_fbdev_write(struct fb_info *info, const char __user *buf, +size_t count, loff_t *ppos) +{ + int ret; + + ret = drm_fb_helper_cfb_write(info, buf, count, ppos); + if (ret > 0) + intel_fbdev_dirty(info); + + return ret; +} + +static void intel_fbdev_fillrect(struct fb_info *info, + const struct fb_fillrect *rect) +{ + drm_fb_helper_cfb_fillrect(info, rect); + intel_fbdev_dirty(info); +} + +static void intel_fbdev_copyarea(struct fb_info *info, + const struct fb_copyarea *area) +{ + drm_fb_helper_cfb_copyarea(info, area); + intel_fbdev_dirty(info); +} + +static void intel_fbdev_imageblit(struct fb_info *info, +const struct fb_image *image) +{ + drm_fb_helper_cfb_imageblit(info, image); + intel_fbdev_dirty(info); +} + static int intel_fbdev_blank(int blank, struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; @@ -125,10 +170,10 @@ static const struct fb_ops intelfb_ops = { DRM_FB_HELPER_DEFAULT_OPS, .fb_set_par = intel_fbdev_set_par, .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, + .fb_write = intel_fbdev_write, + .fb_fillrect = intel_fbdev_fillrect, + .fb_copyarea = intel_fbdev_copyarea, + .fb_imageblit = intel_fbdev_imageblit, .fb_pan_display = intel_fbdev_pan_display, .fb_blank = intel_fbdev_blank, }; -- 2.34.1
[Intel-gfx] [PATCH 1/3] drm/edid: reverse display info preserve/clear logic, defaulting to clear
Instead of explicitly clearing individual struct drm_display_info members manually, default to clearing everything and preserving the members that currently do need to be preserved manually. The goal is to avoid adding new members while forgetting to clear them. Use a little bit of macro magic to avoid duplicating the types. There should be no functional changes. The long term goal is to move the members that are modified by drivers and need to be preserved out of display info. Signed-off-by: Jani Nikula --- drivers/gpu/drm/drm_edid.c | 50 ++ 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3d0a4da661bc..6dc4591da0bc 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -6401,36 +6401,32 @@ static void drm_update_mso(struct drm_connector *connector, static void drm_reset_display_info(struct drm_connector *connector) { struct drm_display_info *info = &connector->display_info; - - info->width_mm = 0; - info->height_mm = 0; - - info->bpc = 0; - info->color_formats = 0; - info->cea_rev = 0; - info->max_tmds_clock = 0; - info->dvi_dual = false; - info->is_hdmi = false; - info->has_hdmi_infoframe = false; - info->rgb_quant_range_selectable = false; - memset(&info->hdmi, 0, sizeof(info->hdmi)); - - info->edid_hdmi_rgb444_dc_modes = 0; - info->edid_hdmi_ycbcr444_dc_modes = 0; - - info->non_desktop = 0; - memset(&info->monitor_range, 0, sizeof(info->monitor_range)); - memset(&info->luminance_range, 0, sizeof(info->luminance_range)); - - info->mso_stream_count = 0; - info->mso_pixel_overlap = 0; - info->max_dsc_bpp = 0; +#define COPY_MEMBER(__member) __auto_type __member = info->__member + COPY_MEMBER(subpixel_order); + COPY_MEMBER(panel_orientation); + COPY_MEMBER(bus_formats); + COPY_MEMBER(num_bus_formats); + COPY_MEMBER(bus_flags); +#undef COPY_MEMBER kfree(info->vics); - info->vics = NULL; - info->vics_len = 0; - info->quirks = 0; + memset(info, 0, sizeof(*info)); + + /* +* Preserve certain members across display info resets. These are +* modified by drivers, and do not originate from the EDID. Please try +* to avoid adding more. +* +* FIXME: Move all of these to a separate drm_connector sub-struct, and +* make struct drm_display_info purely about info originating from the +* EDID. +*/ + info->subpixel_order = subpixel_order; + info->panel_orientation = panel_orientation; + info->bus_formats = bus_formats; /* Note: pointer copy! */ + info->num_bus_formats = num_bus_formats; + info->bus_flags = bus_flags; } static void update_display_info(struct drm_connector *connector, -- 2.34.1
[Intel-gfx] [PATCH 2/3] drm/connector: move HDR sink metadata to display info
Information parsed from the display EDID should be stored in display info. The functional change here is clearing the HDR sink metadata in drm_reset_display_info(), which should be the right thing to do anyway. Signed-off-by: Jani Nikula --- drivers/gpu/drm/display/drm_hdmi_helper.c | 2 +- drivers/gpu/drm/drm_connector.c | 2 +- drivers/gpu/drm/drm_edid.c | 17 + .../drm/i915/display/intel_dp_aux_backlight.c | 2 +- include/drm/drm_connector.h | 8 +--- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index 0264abe55278..001369e023e3 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -44,7 +44,7 @@ int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame, /* Sink EOTF is Bit map while infoframe is absolute values */ if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf, - connector->hdr_sink_metadata.hdmi_type1.eotf)) { + connector->display_info.hdr_sink_metadata.hdmi_type1.eotf)) { DRM_DEBUG_KMS("EOTF Not Supported\n"); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 9d0250c28e9b..5a2ff375ba47 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1345,7 +1345,7 @@ static const struct drm_prop_enum_list dp_colorspaces[] = { * structure from userspace. This is received as blob and stored in * &drm_connector_state.hdr_output_metadata. It parses EDID and saves the * sink metadata in &struct hdr_sink_metadata, as - * &drm_connector.hdr_sink_metadata. Driver uses + * &drm_connector.display_info.hdr_sink_metadata. Driver uses * drm_hdmi_infoframe_set_hdr_metadata() helper to set the HDR metadata, * hdmi_drm_infoframe_pack() to pack the infoframe as per spec, in case of * HDMI encoder. diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 6dc4591da0bc..1ce3f153868d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5282,7 +5282,8 @@ static void fixup_detailed_cea_mode_clock(struct drm_connector *connector, static void drm_calculate_luminance_range(struct drm_connector *connector) { - struct hdr_static_metadata *hdr_metadata = &connector->hdr_sink_metadata.hdmi_type1; + const struct hdr_static_metadata *hdr_metadata = + &connector->display_info.hdr_sink_metadata.hdmi_type1; struct drm_luminance_range_info *luminance_range = &connector->display_info.luminance_range; static const u8 pre_computed_values[] = { @@ -5343,21 +5344,21 @@ static uint8_t hdr_metadata_type(const u8 *edid_ext) static void drm_parse_hdr_metadata_block(struct drm_connector *connector, const u8 *db) { + struct hdr_static_metadata *hdr_metadata = + &connector->display_info.hdr_sink_metadata.hdmi_type1; u16 len; len = cea_db_payload_len(db); - connector->hdr_sink_metadata.hdmi_type1.eotf = - eotf_supported(db); - connector->hdr_sink_metadata.hdmi_type1.metadata_type = - hdr_metadata_type(db); + hdr_metadata->eotf = eotf_supported(db); + hdr_metadata->metadata_type = hdr_metadata_type(db); if (len >= 4) - connector->hdr_sink_metadata.hdmi_type1.max_cll = db[4]; + hdr_metadata->max_cll = db[4]; if (len >= 5) - connector->hdr_sink_metadata.hdmi_type1.max_fall = db[5]; + hdr_metadata->max_fall = db[5]; if (len >= 6) { - connector->hdr_sink_metadata.hdmi_type1.min_cll = db[6]; + hdr_metadata->min_cll = db[6]; /* Calculate only when all values are available */ drm_calculate_luminance_range(connector); diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c index 83af95bce98d..0e3491c9c304 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c @@ -144,7 +144,7 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector) * ranges for such panels. */ if (i915->params.enable_dpcd_backlight != INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL && - !(connector->base.hdr_sink_metadata.hdmi_type1.metadata_type & + !(connector->base.display_info.hdr_sink_metadata.hdmi_type1.metadata_type & BIT(HDMI_STATIC_METADATA_TYPE1))) { drm_info(&i915->drm, "Panel is missing HDR static metadata. Possible support for Intel HDR backlight interface is n
[Intel-gfx] [PATCH 3/3] drm/connector: move ELD and video/audio latencies to display info
Information parsed from the display EDID should be stored in display info. We can stop clearing ELD separately. Cc: Alex Deucher Cc: Christian König Cc: Pan, Xinhui Cc: amd-...@lists.freedesktop.org Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: linux-media...@lists.infradead.org Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Sean Paul Cc: linux-arm-...@vger.kernel.org Cc: freedr...@lists.freedesktop.org Cc: Alain Volmat Cc: Emma Anholt Cc: Maxime Ripard Signed-off-by: Jani Nikula --- Sorry about the crazy Cc list, but this touches a lot of drivers, and I didn't want to blind side anyone. --- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c| 6 +-- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c| 6 +-- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 6 +-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 12 ++--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++--- drivers/gpu/drm/bridge/analogix/anx7625.c | 4 +- drivers/gpu/drm/bridge/ite-it66121.c | 4 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_edid.c| 45 +++ drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i915/display/intel_audio.c| 22 - drivers/gpu/drm/i915/display/intel_sdvo.c | 2 +- drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- drivers/gpu/drm/mediatek/mtk_hdmi.c | 3 +- drivers/gpu/drm/msm/dp/dp_audio.c | 4 +- drivers/gpu/drm/radeon/dce6_afmt.c| 12 ++--- drivers/gpu/drm/radeon/evergreen_hdmi.c | 12 ++--- drivers/gpu/drm/radeon/radeon_audio.c | 4 +- drivers/gpu/drm/sti/sti_hdmi.c| 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c| 2 +- include/drm/drm_connector.h | 39 +--- 21 files changed, 99 insertions(+), 102 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 9a24ed463abd..0c05838032c5 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -1257,11 +1257,11 @@ static void dce_v10_0_audio_write_latency_fields(struct drm_encoder *encoder, if (mode->flags & DRM_MODE_FLAG_INTERLACE) interlace = 1; - if (connector->latency_present[interlace]) { + if (connector->display_info.latency_present[interlace]) { tmp = REG_SET_FIELD(0, AZALIA_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, - VIDEO_LIPSYNC, connector->video_latency[interlace]); + VIDEO_LIPSYNC, connector->display_info.video_latency[interlace]); tmp = REG_SET_FIELD(0, AZALIA_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, - AUDIO_LIPSYNC, connector->audio_latency[interlace]); + AUDIO_LIPSYNC, connector->display_info.audio_latency[interlace]); } else { tmp = REG_SET_FIELD(0, AZALIA_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, VIDEO_LIPSYNC, 0); diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index c14b70350a51..896f0416b69f 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -1283,11 +1283,11 @@ static void dce_v11_0_audio_write_latency_fields(struct drm_encoder *encoder, if (mode->flags & DRM_MODE_FLAG_INTERLACE) interlace = 1; - if (connector->latency_present[interlace]) { + if (connector->display_info.latency_present[interlace]) { tmp = REG_SET_FIELD(0, AZALIA_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, - VIDEO_LIPSYNC, connector->video_latency[interlace]); + VIDEO_LIPSYNC, connector->display_info.video_latency[interlace]); tmp = REG_SET_FIELD(0, AZALIA_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, - AUDIO_LIPSYNC, connector->audio_latency[interlace]); + AUDIO_LIPSYNC, connector->display_info.audio_latency[interlace]); } else { tmp = REG_SET_FIELD(0, AZALIA_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, VIDEO_LIPSYNC, 0); diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 7f85ba5b726f..4aa797726bca 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -1158,11 +1158,11 @@ static void dce_v6_0_audio_write_latency_fields(struct drm_encoder *encoder, if (mode->flags & DRM_MODE_FLAG_INTERLACE) interlace = 1; - if (connector->latency_present[interlace])
[Intel-gfx] [PATCH v8 0/6] Enable HDCP2.x via GSC CS
These patches enable HDCP2.x on machines MTL and above. >From MTL onwards CSME is spilt into GSC and CSC and now we use GSC CS instead of MEI to talk to firmware to start HDCP authentication --v2 -Fixing some checkpatch changes which I forgot before sending out the series --v3 -Drop cp and fw to make naming more agnostic[Jani] -Sort header[Jani] -remove static inline function from i915_hdcp_interface[Jani] -abstract DISPLAY_VER check[Jani] --v4 -Remove stale comment P2 [Jani] -Fix part where file rename looks like its removed in P2 and added in P3 [Jani] -Add bitmask definition for host session id[Alan] -Seprating gsc load and heci cmd submission into different funcs[Alan] -Create comman function to fill gsc_mtl_header[Alan] --v5 -No need to make hdcp_message field null as we use kzalloc [Alan] -use i915->drm instead of gt->i915->drm [Alan] --v6 -Make each patch build individually [Jani] -drop cp_fw stale commit subject [Jani] -fix the date on license [Jani] -revert back to orginal design where mei and gsc fill their own header --v7 -remove RB by Ankit --v8 -change design to allocate and deallocate hdcp_message only at enablement and disabling of hdcp [Alan] -fix few formatting issue [Ankit] -fix stale comments [Ankit] Anshuman Gupta (1): drm/i915/hdcp: Keep hdcp agonstic naming convention Suraj Kandpal (5): drm/i915/gsc: Create GSC request submission mechanism i915/hdcp: HDCP2.x Refactoring to agnostic hdcp drm/i915/hdcp: Refactor HDCP API structures drm/i915/mtl: Add function to send command to GSC CS drm/i915/mtl: Add HDCP GSC interface drivers/gpu/drm/i915/Makefile | 2 + .../gpu/drm/i915/display/intel_display_core.h | 8 +- .../drm/i915/display/intel_display_types.h| 2 +- drivers/gpu/drm/i915/display/intel_hdcp.c | 128 ++- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 814 ++ drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 30 + drivers/gpu/drm/i915/gt/intel_gpu_commands.h | 2 + drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.h | 1 + .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c | 109 +++ .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h | 61 ++ drivers/misc/mei/hdcp/mei_hdcp.c | 105 ++- drivers/misc/mei/hdcp/mei_hdcp.h | 354 include/drm/i915_hdcp_interface.h | 539 include/drm/i915_mei_hdcp_interface.h | 184 14 files changed, 1700 insertions(+), 639 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc.h create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h create mode 100644 include/drm/i915_hdcp_interface.h delete mode 100644 include/drm/i915_mei_hdcp_interface.h -- 2.25.1
[Intel-gfx] [PATCH v8 1/6] drm/i915/gsc: Create GSC request submission mechanism
HDCP and PXP will require a common function to allow it to submit commands to the gsc cs. Also adding the gsc mtl header that needs to be added on to the existing payloads of HDCP and PXP. --v4 -Seprate gsc load and heci cmd submission into different functions in different files for better scalability [Alan] -Rename gsc address field [Alan] Cc: Daniele Ceraolo Spurio Cc: Alan Previn Signed-off-by: Suraj Kandpal Reviewed-by: Alan Previn --- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/gt/intel_gpu_commands.h | 2 + drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.h | 1 + .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c | 94 +++ .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h | 45 + 5 files changed, 143 insertions(+) create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index f47f00b162a4..461d6b40656d 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -194,6 +194,7 @@ i915-y += \ i915-y += \ gt/uc/intel_gsc_fw.o \ gt/uc/intel_gsc_uc.o \ + gt/uc/intel_gsc_uc_heci_cmd_submit.o\ gt/uc/intel_guc.o \ gt/uc/intel_guc_ads.o \ gt/uc/intel_guc_capture.o \ diff --git a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h index 2af1ae3831df..454179884801 100644 --- a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h +++ b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h @@ -439,6 +439,8 @@ #define GSC_FW_LOAD GSC_INSTR(1, 0, 2) #define HECI1_FW_LIMIT_VALID (1 << 31) +#define GSC_HECI_CMD_PKT GSC_INSTR(0, 0, 6) + /* * Used to convert any address to canonical form. * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS, diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.h index 4b5dbb44afb4..146ac0128f69 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.h @@ -12,4 +12,5 @@ struct intel_gsc_uc; int intel_gsc_uc_fw_upload(struct intel_gsc_uc *gsc); bool intel_gsc_uc_fw_init_done(struct intel_gsc_uc *gsc); + #endif diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c b/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c new file mode 100644 index ..be2424af521d --- /dev/null +++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright © 2023 Intel Corporation + */ + +#include "gt/intel_engine_pm.h" +#include "gt/intel_gpu_commands.h" +#include "gt/intel_gt.h" +#include "gt/intel_ring.h" +#include "intel_gsc_uc_heci_cmd_submit.h" + +struct gsc_heci_pkt { + u64 addr_in; + u32 size_in; + u64 addr_out; + u32 size_out; +}; + +static int emit_gsc_heci_pkt(struct i915_request *rq, struct gsc_heci_pkt *pkt) +{ + u32 *cs; + + cs = intel_ring_begin(rq, 8); + if (IS_ERR(cs)) + return PTR_ERR(cs); + + *cs++ = GSC_HECI_CMD_PKT; + *cs++ = lower_32_bits(pkt->addr_in); + *cs++ = upper_32_bits(pkt->addr_in); + *cs++ = pkt->size_in; + *cs++ = lower_32_bits(pkt->addr_out); + *cs++ = upper_32_bits(pkt->addr_out); + *cs++ = pkt->size_out; + *cs++ = 0; + + intel_ring_advance(rq, cs); + + return 0; +} + +int intel_gsc_uc_heci_cmd_submit_packet(struct intel_gsc_uc *gsc, u64 addr_in, + u32 size_in, u64 addr_out, + u32 size_out) +{ + struct intel_context *ce = gsc->ce; + struct i915_request *rq; + struct gsc_heci_pkt pkt = { + .addr_in = addr_in, + .size_in = size_in, + .addr_out = addr_out, + .size_out = size_out + }; + int err; + + if (!ce) + return -ENODEV; + + rq = i915_request_create(ce); + if (IS_ERR(rq)) + return PTR_ERR(rq); + + if (ce->engine->emit_init_breadcrumb) { + err = ce->engine->emit_init_breadcrumb(rq); + if (err) + goto out_rq; + } + + err = emit_gsc_heci_pkt(rq, &pkt); + + if (err) + goto out_rq; + + err = ce->engine->emit_flush(rq, 0); + +out_rq: + i915_request_get(rq); + + if (unlikely(err)) + i915_request_set_error_once(rq, err); + + i915_request_add(rq); + + if (!err && i915_request_wait(rq, 0, msecs_to_jiffies(500)) < 0) + err = -ETIME; + + i915_request_put(rq); + + if (err) + drm_err(&gsc_uc_to_gt(gsc)->i915->drm, + "Request submission for GSC heci cmd failed (%d)\n", + err); + + return err; +} diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_
[Intel-gfx] [PATCH v8 3/6] i915/hdcp: HDCP2.x Refactoring to agnostic hdcp
As now we have more then one type of content protection secrity firmware. Let change the i915_hdcp_interface.h header naming convention to suit generic f/w type. %s/MEI_/HDCP_ %s/mei_dev/hdcp_dev As interface to CP FW can be either a non i915 component or i915 intergral component, change structure name Accordingly. %s/i915_hdcp_comp_master/i915_hdcp_master %s/i915_hdcp_component_ops/i915_hdcp_ops --v3 -Changing names to drop cp_fw to make naming more agnostic[Jani] Cc: Tomas Winkler Cc: Rodrigo Vivi Cc: Uma Shankar Cc: Ankit Nautiyal Signed-off-by: Anshuman Gupta Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_display_core.h | 1 + drivers/gpu/drm/i915/display/intel_hdcp.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h index de71ff6ad80a..132e9134ba05 100644 --- a/drivers/gpu/drm/i915/display/intel_display_core.h +++ b/drivers/gpu/drm/i915/display/intel_display_core.h @@ -15,6 +15,7 @@ #include #include +#include #include "intel_cdclk.h" #include "intel_display.h" diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 262c76f21801..0d6aed1eb171 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -1409,7 +1409,7 @@ static int hdcp2_authenticate_port(struct intel_connector *connector) return ret; } -static int hdcp2_close_mei_session(struct intel_connector *connector) +static int hdcp2_close_session(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct drm_i915_private *dev_priv = to_i915(connector->base.dev); @@ -1433,7 +1433,7 @@ static int hdcp2_close_mei_session(struct intel_connector *connector) static int hdcp2_deauthenticate_port(struct intel_connector *connector) { - return hdcp2_close_mei_session(connector); + return hdcp2_close_session(connector); } /* Authentication flow starts from here */ -- 2.25.1
[Intel-gfx] [PATCH v8 2/6] drm/i915/hdcp: Keep hdcp agonstic naming convention
From: Anshuman Gupta Change the include/drm/i915_mei_hdcp_interface.h to include/drm/i915_hdcp_interface.h --v6 -make each patch build individually [Jani] --v8 -change ME FW to ME/GSC FW [Ankit] -fix formatting issue [Ankit] Cc: Tomas Winkler Cc: Rodrigo Vivi Cc: Uma Shankar Cc: Ankit Nautiyal Signed-off-by: Anshuman Gupta Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Acked-by: Tomas Winkler --- .../gpu/drm/i915/display/intel_display_core.h | 2 +- .../drm/i915/display/intel_display_types.h| 2 +- drivers/gpu/drm/i915/display/intel_hdcp.c | 81 drivers/misc/mei/hdcp/mei_hdcp.c | 61 ++-- ...hdcp_interface.h => i915_hdcp_interface.h} | 92 +-- 5 files changed, 118 insertions(+), 120 deletions(-) rename include/drm/{i915_mei_hdcp_interface.h => i915_hdcp_interface.h} (73%) diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h index 57ddce3ba02b..de71ff6ad80a 100644 --- a/drivers/gpu/drm/i915/display/intel_display_core.h +++ b/drivers/gpu/drm/i915/display/intel_display_core.h @@ -368,7 +368,7 @@ struct intel_display { } gmbus; struct { - struct i915_hdcp_comp_master *master; + struct i915_hdcp_master *master; bool comp_added; /* Mutex to protect the above hdcp component related values. */ diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 32e8b2fc3cc6..81d195ef5e57 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include "i915_vma.h" diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 6406fd487ee5..262c76f21801 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -1143,7 +1143,7 @@ hdcp2_prepare_ake_init(struct intel_connector *connector, struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct i915_hdcp_comp_master *comp; + struct i915_hdcp_master *comp; int ret; mutex_lock(&dev_priv->display.hdcp.comp_mutex); @@ -1154,7 +1154,7 @@ hdcp2_prepare_ake_init(struct intel_connector *connector, return -EINVAL; } - ret = comp->ops->initiate_hdcp2_session(comp->mei_dev, data, ake_data); + ret = comp->ops->initiate_hdcp2_session(comp->hdcp_dev, data, ake_data); if (ret) drm_dbg_kms(&dev_priv->drm, "Prepare_ake_init failed. %d\n", ret); @@ -1173,7 +1173,7 @@ hdcp2_verify_rx_cert_prepare_km(struct intel_connector *connector, struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct i915_hdcp_comp_master *comp; + struct i915_hdcp_master *comp; int ret; mutex_lock(&dev_priv->display.hdcp.comp_mutex); @@ -1184,7 +1184,7 @@ hdcp2_verify_rx_cert_prepare_km(struct intel_connector *connector, return -EINVAL; } - ret = comp->ops->verify_receiver_cert_prepare_km(comp->mei_dev, data, + ret = comp->ops->verify_receiver_cert_prepare_km(comp->hdcp_dev, data, rx_cert, paired, ek_pub_km, msg_sz); if (ret < 0) @@ -1201,7 +1201,7 @@ static int hdcp2_verify_hprime(struct intel_connector *connector, struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct i915_hdcp_comp_master *comp; + struct i915_hdcp_master *comp; int ret; mutex_lock(&dev_priv->display.hdcp.comp_mutex); @@ -1212,7 +1212,7 @@ static int hdcp2_verify_hprime(struct intel_connector *connector, return -EINVAL; } - ret = comp->ops->verify_hprime(comp->mei_dev, data, rx_hprime); + ret = comp->ops->verify_hprime(comp->hdcp_dev, data, rx_hprime); if (ret < 0) drm_dbg_kms(&dev_priv->drm, "Verify hprime failed. %d\n", ret); mutex_unlock(&dev_priv->display.hdcp.comp_mutex); @@ -1227,7 +1227,7 @@ hdcp2_store_pairing_info(struct intel_connector *connector, struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data;
[Intel-gfx] [PATCH v8 4/6] drm/i915/hdcp: Refactor HDCP API structures
It requires to move intel specific HDCP API structures to i915_hdcp_interface.h from driver/misc/mei/hdcp/mei_hdcp.h so that any content protection fw interfaces can use these structures. Cc: Tomas Winkler Cc: Rodrigo Vivi Cc: Uma Shankar Cc: Ankit Nautiyal Signed-off-by: Anshuman Gupta Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal --- drivers/misc/mei/hdcp/mei_hdcp.c | 44 ++-- drivers/misc/mei/hdcp/mei_hdcp.h | 354 - include/drm/i915_hdcp_interface.h | 355 ++ 3 files changed, 377 insertions(+), 376 deletions(-) diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c index b2c49599809c..a262e1fa3b48 100644 --- a/drivers/misc/mei/hdcp/mei_hdcp.c +++ b/drivers/misc/mei/hdcp/mei_hdcp.c @@ -52,7 +52,7 @@ mei_hdcp_initiate_session(struct device *dev, struct hdcp_port_data *data, session_init_in.header.api_version = HDCP_API_VERSION; session_init_in.header.command_id = WIRED_INITIATE_HDCP2_SESSION; - session_init_in.header.status = ME_HDCP_STATUS_SUCCESS; + session_init_in.header.status = FW_HDCP_STATUS_SUCCESS; session_init_in.header.buffer_len = WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN; @@ -75,7 +75,7 @@ mei_hdcp_initiate_session(struct device *dev, struct hdcp_port_data *data, return byte; } - if (session_init_out.header.status != ME_HDCP_STATUS_SUCCESS) { + if (session_init_out.header.status != FW_HDCP_STATUS_SUCCESS) { dev_dbg(dev, "ME cmd 0x%08X Failed. Status: 0x%X\n", WIRED_INITIATE_HDCP2_SESSION, session_init_out.header.status); @@ -122,7 +122,7 @@ mei_hdcp_verify_receiver_cert_prepare_km(struct device *dev, verify_rxcert_in.header.api_version = HDCP_API_VERSION; verify_rxcert_in.header.command_id = WIRED_VERIFY_RECEIVER_CERT; - verify_rxcert_in.header.status = ME_HDCP_STATUS_SUCCESS; + verify_rxcert_in.header.status = FW_HDCP_STATUS_SUCCESS; verify_rxcert_in.header.buffer_len = WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_IN; @@ -148,7 +148,7 @@ mei_hdcp_verify_receiver_cert_prepare_km(struct device *dev, return byte; } - if (verify_rxcert_out.header.status != ME_HDCP_STATUS_SUCCESS) { + if (verify_rxcert_out.header.status != FW_HDCP_STATUS_SUCCESS) { dev_dbg(dev, "ME cmd 0x%08X Failed. Status: 0x%X\n", WIRED_VERIFY_RECEIVER_CERT, verify_rxcert_out.header.status); @@ -194,7 +194,7 @@ mei_hdcp_verify_hprime(struct device *dev, struct hdcp_port_data *data, send_hprime_in.header.api_version = HDCP_API_VERSION; send_hprime_in.header.command_id = WIRED_AKE_SEND_HPRIME; - send_hprime_in.header.status = ME_HDCP_STATUS_SUCCESS; + send_hprime_in.header.status = FW_HDCP_STATUS_SUCCESS; send_hprime_in.header.buffer_len = WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_IN; send_hprime_in.port.integrated_port_type = data->port_type; @@ -218,7 +218,7 @@ mei_hdcp_verify_hprime(struct device *dev, struct hdcp_port_data *data, return byte; } - if (send_hprime_out.header.status != ME_HDCP_STATUS_SUCCESS) { + if (send_hprime_out.header.status != FW_HDCP_STATUS_SUCCESS) { dev_dbg(dev, "ME cmd 0x%08X Failed. Status: 0x%X\n", WIRED_AKE_SEND_HPRIME, send_hprime_out.header.status); return -EIO; @@ -251,7 +251,7 @@ mei_hdcp_store_pairing_info(struct device *dev, struct hdcp_port_data *data, pairing_info_in.header.api_version = HDCP_API_VERSION; pairing_info_in.header.command_id = WIRED_AKE_SEND_PAIRING_INFO; - pairing_info_in.header.status = ME_HDCP_STATUS_SUCCESS; + pairing_info_in.header.status = FW_HDCP_STATUS_SUCCESS; pairing_info_in.header.buffer_len = WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_IN; @@ -276,7 +276,7 @@ mei_hdcp_store_pairing_info(struct device *dev, struct hdcp_port_data *data, return byte; } - if (pairing_info_out.header.status != ME_HDCP_STATUS_SUCCESS) { + if (pairing_info_out.header.status != FW_HDCP_STATUS_SUCCESS) { dev_dbg(dev, "ME cmd 0x%08X failed. Status: 0x%X\n", WIRED_AKE_SEND_PAIRING_INFO, pairing_info_out.header.status); @@ -311,7 +311,7 @@ mei_hdcp_initiate_locality_check(struct device *dev, lc_init_in.header.api_version = HDCP_API_VERSION; lc_init_in.header.command_id = WIRED_INIT_LOCALITY_CHECK; - lc_init_in.header.status = ME_HDCP_STATUS_SUCCESS; + lc_init_in.header.status = FW_HDCP_STATUS_SUCCESS; lc_init_in.header.buffer_len = WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_IN; lc_init_in.port.integrat
[Intel-gfx] [PATCH v8 5/6] drm/i915/mtl: Add function to send command to GSC CS
Add function that takes care of sending command to gsc cs. We start of with allocation of memory for our command intel_hdcp_gsc_message that contains gsc cs memory header as directed in specs followed by the actual payload hdcp message that we want to send. Spec states that we need to poll pending bit of response header around 20 times each try being 50ms apart hence adding that to current gsc_msg_send function Also we use the same function to take care of both sending and receiving hence no separate function to get the response. --v4 -Create common function to fill in gsc_mtl_header [Alan] -define host session bitmask [Alan] --v5 -use i915 directly instead of gt->i915 [Alan] -No need to make fields NULL as we are already using kzalloc [Alan] --v8 -change mechanism to reuse the same memory for one hdcp session[Alan] -fix header ordering -add comments to explain flags and host session mask [Alan] Cc: Ankit Nautiyal Cc: Daniele Ceraolo Spurio Cc: Alan Pervin Teres Cc: Uma Shankar Cc: Anshuman Gupta Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/Makefile | 1 + .../gpu/drm/i915/display/intel_display_core.h | 5 + drivers/gpu/drm/i915/display/intel_hdcp.c | 20 ++ drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 185 ++ drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 27 +++ .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c | 15 ++ .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h | 16 ++ 7 files changed, 269 insertions(+) create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc.h diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 461d6b40656d..194aae92c354 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -254,6 +254,7 @@ i915-y += \ display/intel_frontbuffer.o \ display/intel_global_state.o \ display/intel_hdcp.o \ + display/intel_hdcp_gsc.o \ display/intel_hotplug.o \ display/intel_hti.o \ display/intel_lpe_audio.o \ diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h index 132e9134ba05..7e9f3f87c767 100644 --- a/drivers/gpu/drm/i915/display/intel_display_core.h +++ b/drivers/gpu/drm/i915/display/intel_display_core.h @@ -372,6 +372,11 @@ struct intel_display { struct i915_hdcp_master *master; bool comp_added; + /*HDCP message struct for allocation of memory which can be reused +* when sending message to gsc cs +* this is only populated post Meteorlake +*/ + struct intel_hdcp_gsc_message *hdcp_message; /* Mutex to protect the above hdcp component related values. */ struct mutex comp_mutex; } hdcp; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 0d6aed1eb171..c578fcc34bfd 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -23,6 +23,7 @@ #include "intel_display_power_well.h" #include "intel_display_types.h" #include "intel_hdcp.h" +#include "intel_hdcp_gsc.h" #include "intel_hdcp_regs.h" #include "intel_pcode.h" @@ -1966,12 +1967,28 @@ static int _intel_hdcp2_enable(struct intel_connector *connector) { struct drm_i915_private *i915 = to_i915(connector->base.dev); struct intel_hdcp *hdcp = &connector->hdcp; + struct intel_hdcp_gsc_message *hdcp_message; int ret; drm_dbg_kms(&i915->drm, "[%s:%d] HDCP2.2 is being enabled. Type: %d\n", connector->base.name, connector->base.base.id, hdcp->content_type); + if (DISPLAY_VER(i915) >= 14) { + hdcp_message = kzalloc(sizeof(*hdcp_message), GFP_KERNEL); + + if (!hdcp_message) + return -ENOMEM; + + i915->display.hdcp.hdcp_message = hdcp_message; + ret = intel_hdcp_gsc_initialize_message(i915, hdcp_message); + + if (ret) { + drm_err(&i915->drm, "Could not initialize hdcp_message\n"); + return ret; + } + } + ret = hdcp2_authenticate_and_encrypt(connector); if (ret) { drm_dbg_kms(&i915->drm, "HDCP2 Type%d Enabling Failed. (%d)\n", @@ -2018,6 +2035,9 @@ _intel_hdcp2_disable(struct intel_connector *connector, bool hdcp2_link_recovery if (hdcp2_deauthenticate_port(connector) < 0) drm_dbg_kms(&i915->drm, "Port deauth failed.\n"); + if (DISPLAY_VER(i915) >= 14) + intel_hdcp_gsc_free_message(i915); + connector->hdcp.hdcp2_encrypted = false; dig_port->hdcp_auth_status = false; data->k = 0; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c b/drivers/gpu/drm/i915
[Intel-gfx] [PATCH v8 6/6] drm/i915/mtl: Add HDCP GSC interface
MTL uses GSC command streamer i.e gsc cs to send HDCP/PXP commands to GSC f/w. It requires to keep hdcp display driver agnostic to content protection f/w (ME/GSC fw) in the form of i915_hdcp_fw_ops generic ops. Adding HDCP GSC CS interface by leveraging the i915_hdcp_fw_ops generic ops instead of I915_HDCP_COMPONENT as integral part of i915. Adding checks to see if GSC is loaded and proxy is setup --v6 -dont change the license date in same patch series [Jani] -fix the license year {Jani] --v8 -remove stale comment [Ankit] -get headers in alphabetical order [Ankit] -fix hdcp2_supported check [Ankit] Cc: Tomas Winkler Cc: Rodrigo Vivi Cc: Uma Shankar Cc: Ankit Nautiyal Signed-off-by: Anshuman Gupta Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_hdcp.c | 31 +- drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 631 +- drivers/gpu/drm/i915/display/intel_hdcp_gsc.h | 3 + 3 files changed, 657 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index c578fcc34bfd..ddae476e4371 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -204,13 +204,20 @@ bool intel_hdcp2_capable(struct intel_connector *connector) struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct drm_i915_private *dev_priv = to_i915(connector->base.dev); struct intel_hdcp *hdcp = &connector->hdcp; + struct intel_gt *gt = dev_priv->media_gt; + struct intel_gsc_uc *gsc = >->uc.gsc; bool capable = false; /* I915 support for HDCP2.2 */ if (!hdcp->hdcp2_supported) return false; - /* MEI interface is solid */ + /* If MTL+ make sure gsc is loaded and proxy is setup */ + if (intel_hdcp_gsc_cs_required(dev_priv)) + if (!intel_uc_fw_is_running(&gsc->fw)) + return false; + + /* MEI/GSC interface is solid depending on which is used */ mutex_lock(&dev_priv->display.hdcp.comp_mutex); if (!dev_priv->display.hdcp.comp_added || !dev_priv->display.hdcp.master) { mutex_unlock(&dev_priv->display.hdcp.comp_mutex); @@ -1974,7 +1981,7 @@ static int _intel_hdcp2_enable(struct intel_connector *connector) connector->base.name, connector->base.base.id, hdcp->content_type); - if (DISPLAY_VER(i915) >= 14) { + if (intel_hdcp_gsc_cs_required(i915)) { hdcp_message = kzalloc(sizeof(*hdcp_message), GFP_KERNEL); if (!hdcp_message) @@ -2035,7 +2042,7 @@ _intel_hdcp2_disable(struct intel_connector *connector, bool hdcp2_link_recovery if (hdcp2_deauthenticate_port(connector) < 0) drm_dbg_kms(&i915->drm, "Port deauth failed.\n"); - if (DISPLAY_VER(i915) >= 14) + if (intel_hdcp_gsc_cs_required(i915)) intel_hdcp_gsc_free_message(i915); connector->hdcp.hdcp2_encrypted = false; @@ -2255,6 +2262,9 @@ static int initialize_hdcp_port_data(struct intel_connector *connector, static bool is_hdcp2_supported(struct drm_i915_private *dev_priv) { + if (intel_hdcp_gsc_cs_required(dev_priv)) + return true; + if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) return false; @@ -2276,10 +2286,14 @@ void intel_hdcp_component_init(struct drm_i915_private *dev_priv) dev_priv->display.hdcp.comp_added = true; mutex_unlock(&dev_priv->display.hdcp.comp_mutex); - ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, - I915_COMPONENT_HDCP); + if (intel_hdcp_gsc_cs_required(dev_priv)) + ret = intel_hdcp_gsc_init(dev_priv); + else + ret = component_add_typed(dev_priv->drm.dev, &i915_hdcp_ops, + I915_COMPONENT_HDCP); + if (ret < 0) { - drm_dbg_kms(&dev_priv->drm, "Failed at component add(%d)\n", + drm_dbg_kms(&dev_priv->drm, "Failed at fw component add(%d)\n", ret); mutex_lock(&dev_priv->display.hdcp.comp_mutex); dev_priv->display.hdcp.comp_added = false; @@ -2506,7 +2520,10 @@ void intel_hdcp_component_fini(struct drm_i915_private *dev_priv) dev_priv->display.hdcp.comp_added = false; mutex_unlock(&dev_priv->display.hdcp.comp_mutex); - component_del(dev_priv->drm.dev, &i915_hdcp_ops); + if (intel_hdcp_gsc_cs_required(dev_priv)) + intel_hdcp_gsc_fini(dev_priv); + else + component_del(dev_priv->drm.dev, &i915_hdcp_ops); } void intel_hdcp_cleanup(struct intel_connector *connector) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c b/drivers/gpu/drm/i915/display/intel_hdcp_gsc.c index 8da4faf9b10c..fb6042684014 100644 --- a/drivers/gpu/dr
Re: [Intel-gfx] [PATCH 1/2] drm/ttm: prevent moving of pinned BOs
Am 11.01.23 um 14:17 schrieb Matthew Auld: On Wed, 11 Jan 2023 at 11:43, Christian König wrote: We have checks for this in the individual drivers move callback, but it's probably better to generally forbit that on a higher level. Also stops exporting ttm_resource_compat() since that's not necessary any more after removing the extra checks in vmwgfx. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 drivers/gpu/drm/nouveau/nouveau_bo.c| 3 --- drivers/gpu/drm/radeon/radeon_ttm.c | 4 drivers/gpu/drm/ttm/ttm_bo.c| 20 drivers/gpu/drm/ttm/ttm_resource.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 19 ++- 6 files changed, 14 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 068c2d8495fd..677cd7d91687 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -466,11 +466,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, return r; } - /* Can't move a pinned BO */ abo = ttm_to_amdgpu_bo(bo); - if (WARN_ON_ONCE(abo->tbo.pin_count > 0)) - return -EINVAL; - adev = amdgpu_ttm_adev(bo->bdev); if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM && diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 288eebc70a67..c2ec91cc845d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1015,9 +1015,6 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, if (ret) goto out_ntfy; - if (nvbo->bo.pin_count) - NV_WARN(drm, "Moving pinned object %p!\n", nvbo); - if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) { ret = nouveau_bo_vm_bind(bo, new_reg, &new_tile); if (ret) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 1e8e287e113c..67075c85f847 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -211,11 +211,7 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, if (r) return r; - /* Can't move a pinned BO */ rbo = container_of(bo, struct radeon_bo, tbo); - if (WARN_ON_ONCE(rbo->tbo.pin_count > 0)) - return -EINVAL; - rdev = radeon_get_rdev(bo->bdev); if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { ttm_bo_move_null(bo, new_mem); diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 326a3d13a829..9baccb2f6e99 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -894,14 +894,18 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, if (!placement->num_placement && !placement->num_busy_placement) return ttm_bo_pipeline_gutting(bo); - /* -* Check whether we need to move buffer. -*/ - if (!bo->resource || !ttm_resource_compat(bo->resource, placement)) { - ret = ttm_bo_move_buffer(bo, placement, ctx); - if (ret) - return ret; - } + /* Check whether we need to move buffer. */ + if (bo->resource && ttm_resource_compat(bo->resource, placement)) + return 0; Note this now skips the tt create below (intentional?). I think i915 needed that, since it creates a dummy system resource initially for all objects, and then relies on ZERO_ALLOC being set for certain objects to know if the memory needs to be cleared or not when later doing the dummy -> vram. Thoughts? That's unproblematic. On initial allocation bo->resource is NULL so we never branch out here. Christian. + + /* Moving of pinned BOs is forbidden */ + if (bo->pin_count) + return -EINVAL; + + ret = ttm_bo_move_buffer(bo, placement, ctx); + if (ret) + return ret; + /* * We might need to add a TTM. */ diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c index b8a826a24fb2..7333f7a87a2f 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -361,7 +361,6 @@ bool ttm_resource_compat(struct ttm_resource *res, return false; } -EXPORT_SYMBOL(ttm_resource_compat); void ttm_resource_set_bo(struct ttm_resource *res, struct ttm_buffer_object *bo) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c index 321c551784a1..dbcef460c452 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c @@ -87,12 +87,7 @@ int vmw_bo_pin_in_placement(struct vmw_private *dev_priv, if (unlikely(ret != 0
Re: [Intel-gfx] [PATCH] drm/i915: Use uabi engines for the default engine map
On 23/01/2023 18:56, Jonathan Cavitt wrote: From: Tvrtko Ursulin Default engine map is exactly about uabi engines so no excuse not to use the appropriate iterator to populate it. Signed-off-by: Tvrtko Ursulin Signed-off-by: Jonathan Cavitt Reveiwed-by: Jonathan Cavitt Fixed the r-b spelling and pushed - thanks for the review and sending the patch over! Regards, Tvrtko --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index 454e73a433c8..42a39e103d7c 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -1096,16 +1096,15 @@ static struct i915_gem_engines *alloc_engines(unsigned int count) static struct i915_gem_engines *default_engines(struct i915_gem_context *ctx, struct intel_sseu rcs_sseu) { - const struct intel_gt *gt = to_gt(ctx->i915); + const unsigned int max = I915_NUM_ENGINES; struct intel_engine_cs *engine; struct i915_gem_engines *e, *err; - enum intel_engine_id id; - e = alloc_engines(I915_NUM_ENGINES); + e = alloc_engines(max); if (!e) return ERR_PTR(-ENOMEM); - for_each_engine(engine, gt, id) { + for_each_uabi_engine(engine, ctx->i915) { struct intel_context *ce; struct intel_sseu sseu = {}; int ret; @@ -1113,7 +1112,7 @@ static struct i915_gem_engines *default_engines(struct i915_gem_context *ctx, if (engine->legacy_idx == INVALID_ENGINE) continue; - GEM_BUG_ON(engine->legacy_idx >= I915_NUM_ENGINES); + GEM_BUG_ON(engine->legacy_idx >= max); GEM_BUG_ON(e->engines[engine->legacy_idx]); ce = intel_context_create(engine);
Re: [Intel-gfx] [PATCH 2/2] drm/ttm: replace busy placement with flags
Am 11.01.23 um 14:03 schrieb Matthew Auld: On Wed, 11 Jan 2023 at 11:43, Christian König wrote: Instead of a list of separate busy placement add flags which indicate that a placement should only be used when there is room or if we need to evict. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 11 +- drivers/gpu/drm/drm_gem_vram_helper.c | 2 - drivers/gpu/drm/i915/gem/i915_gem_ttm.c| 36 +++--- drivers/gpu/drm/nouveau/nouveau_bo.c | 59 -- drivers/gpu/drm/nouveau/nouveau_bo.h | 1 - drivers/gpu/drm/qxl/qxl_object.c | 2 - drivers/gpu/drm/qxl/qxl_ttm.c | 2 - drivers/gpu/drm/radeon/radeon_object.c | 2 - drivers/gpu/drm/radeon/radeon_ttm.c| 8 +- drivers/gpu/drm/radeon/radeon_uvd.c| 1 - drivers/gpu/drm/ttm/ttm_bo.c | 21 ++-- drivers/gpu/drm/ttm/ttm_resource.c | 73 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 - drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 121 ++--- include/drm/ttm/ttm_placement.h| 10 +- include/drm/ttm/ttm_resource.h | 8 +- 17 files changed, 134 insertions(+), 231 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 974e85d8b6cc..0995a2f41305 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -201,9 +201,6 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) placement->num_placement = c; placement->placement = places; - - placement->num_busy_placement = c; - placement->busy_placement = places; } /** @@ -1369,8 +1366,7 @@ vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) AMDGPU_GEM_DOMAIN_GTT); /* Avoid costly evictions; only set GTT as a busy placement */ - abo->placement.num_busy_placement = 1; - abo->placement.busy_placement = &abo->placements[1]; + abo->placements[0].flags |= TTM_PL_FLAG_IDLE; r = ttm_bo_validate(bo, &abo->placement, &ctx); if (unlikely(r == -EBUSY || r == -ERESTARTSYS)) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 677cd7d91687..33cf6e835a68 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -104,23 +104,19 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, /* Don't handle scatter gather BOs */ if (bo->type == ttm_bo_type_sg) { placement->num_placement = 0; - placement->num_busy_placement = 0; return; } /* Object isn't an AMDGPU object so ignore */ if (!amdgpu_bo_is_amdgpu_bo(bo)) { placement->placement = &placements; - placement->busy_placement = &placements; placement->num_placement = 1; - placement->num_busy_placement = 1; return; } abo = ttm_to_amdgpu_bo(bo); if (abo->flags & AMDGPU_GEM_CREATE_DISCARDABLE) { placement->num_placement = 0; - placement->num_busy_placement = 0; return; } @@ -129,13 +125,13 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, case AMDGPU_PL_GWS: case AMDGPU_PL_OA: placement->num_placement = 0; - placement->num_busy_placement = 0; return; case TTM_PL_VRAM: if (!adev->mman.buffer_funcs_enabled) { /* Move to system memory */ amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU); + } else if (!amdgpu_gmc_vram_full_visible(&adev->gmc) && !(abo->flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) && amdgpu_bo_in_cpu_visible_vram(abo)) { @@ -150,8 +146,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, AMDGPU_GEM_DOMAIN_CPU); abo->placements[0].fpfn = adev->gmc.visible_vram_size >> PAGE_SHIFT; abo->placements[0].lpfn = 0; - abo->placement.busy_placement = &abo->placements[1]; - abo->placement.num_busy_placement = 1; + abo->placements[0].flags |= TTM_PL_FLAG_IDLE; } else { /* Move to GTT memory */ amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT | @@ -923,8 +918,6 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo) /* allocate GART space */ placement.num_placement = 1; placeme
Re: [Intel-gfx] [PATCH 1/2] drm/ttm: prevent moving of pinned BOs
On Tue, 24 Jan 2023 at 09:51, Christian König wrote: > > Am 11.01.23 um 14:17 schrieb Matthew Auld: > > On Wed, 11 Jan 2023 at 11:43, Christian König > > wrote: > >> We have checks for this in the individual drivers move callback, but > >> it's probably better to generally forbit that on a higher level. > >> > >> Also stops exporting ttm_resource_compat() since that's not necessary > >> any more after removing the extra checks in vmwgfx. > >> > >> Signed-off-by: Christian König > >> --- > >> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 > >> drivers/gpu/drm/nouveau/nouveau_bo.c| 3 --- > >> drivers/gpu/drm/radeon/radeon_ttm.c | 4 > >> drivers/gpu/drm/ttm/ttm_bo.c| 20 > >> drivers/gpu/drm/ttm/ttm_resource.c | 1 - > >> drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 19 ++- > >> 6 files changed, 14 insertions(+), 37 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > >> index 068c2d8495fd..677cd7d91687 100644 > >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > >> @@ -466,11 +466,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object > >> *bo, bool evict, > >> return r; > >> } > >> > >> - /* Can't move a pinned BO */ > >> abo = ttm_to_amdgpu_bo(bo); > >> - if (WARN_ON_ONCE(abo->tbo.pin_count > 0)) > >> - return -EINVAL; > >> - > >> adev = amdgpu_ttm_adev(bo->bdev); > >> > >> if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM && > >> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c > >> b/drivers/gpu/drm/nouveau/nouveau_bo.c > >> index 288eebc70a67..c2ec91cc845d 100644 > >> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c > >> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c > >> @@ -1015,9 +1015,6 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool > >> evict, > >> if (ret) > >> goto out_ntfy; > >> > >> - if (nvbo->bo.pin_count) > >> - NV_WARN(drm, "Moving pinned object %p!\n", nvbo); > >> - > >> if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) { > >> ret = nouveau_bo_vm_bind(bo, new_reg, &new_tile); > >> if (ret) > >> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c > >> b/drivers/gpu/drm/radeon/radeon_ttm.c > >> index 1e8e287e113c..67075c85f847 100644 > >> --- a/drivers/gpu/drm/radeon/radeon_ttm.c > >> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c > >> @@ -211,11 +211,7 @@ static int radeon_bo_move(struct ttm_buffer_object > >> *bo, bool evict, > >> if (r) > >> return r; > >> > >> - /* Can't move a pinned BO */ > >> rbo = container_of(bo, struct radeon_bo, tbo); > >> - if (WARN_ON_ONCE(rbo->tbo.pin_count > 0)) > >> - return -EINVAL; > >> - > >> rdev = radeon_get_rdev(bo->bdev); > >> if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { > >> ttm_bo_move_null(bo, new_mem); > >> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > >> index 326a3d13a829..9baccb2f6e99 100644 > >> --- a/drivers/gpu/drm/ttm/ttm_bo.c > >> +++ b/drivers/gpu/drm/ttm/ttm_bo.c > >> @@ -894,14 +894,18 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, > >> if (!placement->num_placement && !placement->num_busy_placement) > >> return ttm_bo_pipeline_gutting(bo); > >> > >> - /* > >> -* Check whether we need to move buffer. > >> -*/ > >> - if (!bo->resource || !ttm_resource_compat(bo->resource, > >> placement)) { > >> - ret = ttm_bo_move_buffer(bo, placement, ctx); > >> - if (ret) > >> - return ret; > >> - } > >> + /* Check whether we need to move buffer. */ > >> + if (bo->resource && ttm_resource_compat(bo->resource, placement)) > >> + return 0; > > Note this now skips the tt create below (intentional?). I think i915 > > needed that, since it creates a dummy system resource initially for > > all objects, and then relies on ZERO_ALLOC being set for certain > > objects to know if the memory needs to be cleared or not when later > > doing the dummy -> vram. Thoughts? > > That's unproblematic. On initial allocation bo->resource is NULL so we > never branch out here. Here is what I see in drm-tip, when first creating an object with ttm: ttm_bo_init_reserved() -> ttm_resource_alloc(PL_SYSTEM, &bo->resource) -> ttm_bo_validate() So bo->resource is for sure not NULL on initial allocation, and is pointing to PL_SYSTEM. And in i915 we initially stuff everything into SYSTEM as a dummy placement. IIRC you had a series that tried to address that (allowing NULL resource or so), but it never landed: https://patchwork.freedesktop.org/patch/500698/?series=107680&rev=2 > > Christian. > > > > >> + > >> +
[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/fbdev: Implement wrappers for callbacks used by fbcon
== Series Details == Series: drm/i915/fbdev: Implement wrappers for callbacks used by fbcon URL : https://patchwork.freedesktop.org/series/113255/ State : success == Summary == CI Bug Log - changes from CI_DRM_12626 -> Patchwork_113255v1 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/index.html Participating hosts (39 -> 39) -- Additional (1): fi-bsw-kefka Missing(1): fi-snb-2520m Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_113255v1: ### IGT changes ### Suppressed The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@i915_module_load@load: - {bat-dg2-9}:[PASS][1] -> [DMESG-WARN][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/bat-dg2-9/igt@i915_module_l...@load.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/bat-dg2-9/igt@i915_module_l...@load.html Known issues Here are the changes found in Patchwork_113255v1 that come from known issues: ### CI changes ### Possible fixes * boot: - fi-ivb-3770:[FAIL][3] -> [PASS][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/fi-ivb-3770/boot.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-ivb-3770/boot.html ### IGT changes ### Issues hit * igt@i915_selftest@live@gt_heartbeat: - fi-kbl-soraka: [PASS][5] -> [DMESG-FAIL][6] ([i915#5334] / [i915#7872]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html * igt@i915_selftest@live@guc_multi_lrc: - fi-kbl-soraka: NOTRUN -> [INCOMPLETE][7] ([i915#7640]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-kbl-soraka/igt@i915_selftest@live@guc_multi_lrc.html * igt@kms_chamelium_hpd@common-hpd-after-suspend: - fi-bsw-n3050: NOTRUN -> [SKIP][8] ([fdo#109271]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-bsw-n3050/igt@kms_chamelium_...@common-hpd-after-suspend.html * igt@kms_psr@cursor_plane_move: - fi-ivb-3770:NOTRUN -> [SKIP][9] ([fdo#109271]) +27 similar issues [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-ivb-3770/igt@kms_psr@cursor_plane_move.html * igt@prime_vgem@basic-fence-flip: - fi-bsw-kefka: NOTRUN -> [SKIP][10] ([fdo#109271]) +26 similar issues [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-bsw-kefka/igt@prime_v...@basic-fence-flip.html Possible fixes * igt@i915_selftest@live@execlists: - fi-bsw-n3050: [INCOMPLETE][11] ([i915#6972] / [i915#7911]) -> [PASS][12] [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/fi-bsw-n3050/igt@i915_selftest@l...@execlists.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-bsw-n3050/igt@i915_selftest@l...@execlists.html * igt@i915_selftest@live@requests: - fi-kbl-soraka: [INCOMPLETE][13] ([i915#7640] / [i915#7913]) -> [PASS][14] [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/fi-kbl-soraka/igt@i915_selftest@l...@requests.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-kbl-soraka/igt@i915_selftest@l...@requests.html * igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size: - fi-bsw-n3050: [FAIL][15] ([i915#6298]) -> [PASS][16] [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/fi-bsw-n3050/igt@kms_cursor_legacy@basic-busy-flip-before-cur...@atomic-transitions-varying-size.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-bsw-n3050/igt@kms_cursor_legacy@basic-busy-flip-before-cur...@atomic-transitions-varying-size.html * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-lvds-1: - fi-ctg-p8600: [FAIL][17] ([fdo#103375]) -> [PASS][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/fi-ctg-p8600/igt@kms_pipe_crc_basic@suspend-read-...@pipe-b-lvds-1.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/fi-ctg-p8600/igt@kms_pipe_crc_basic@suspend-read-...@pipe-b-lvds-1.html * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-edp-1: - {bat-rplp-1}: [DMESG-WARN][19] -> [PASS][20] [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/bat-rplp-1/igt@kms_pipe_crc_basic@suspend-read-...@pipe-d-edp-1.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/bat-rplp-1/igt@kms_pipe_crc_basic@suspend-read-...@pipe-d-edp-1.html {name}: This element is suppressed. Thi
Re: [Intel-gfx] [PATCH 1/2] drm/ttm: prevent moving of pinned BOs
Am 24.01.23 um 11:12 schrieb Matthew Auld: On Tue, 24 Jan 2023 at 09:51, Christian König wrote: Am 11.01.23 um 14:17 schrieb Matthew Auld: On Wed, 11 Jan 2023 at 11:43, Christian König wrote: We have checks for this in the individual drivers move callback, but it's probably better to generally forbit that on a higher level. Also stops exporting ttm_resource_compat() since that's not necessary any more after removing the extra checks in vmwgfx. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 drivers/gpu/drm/nouveau/nouveau_bo.c| 3 --- drivers/gpu/drm/radeon/radeon_ttm.c | 4 drivers/gpu/drm/ttm/ttm_bo.c| 20 drivers/gpu/drm/ttm/ttm_resource.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 19 ++- 6 files changed, 14 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 068c2d8495fd..677cd7d91687 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -466,11 +466,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, return r; } - /* Can't move a pinned BO */ abo = ttm_to_amdgpu_bo(bo); - if (WARN_ON_ONCE(abo->tbo.pin_count > 0)) - return -EINVAL; - adev = amdgpu_ttm_adev(bo->bdev); if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM && diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 288eebc70a67..c2ec91cc845d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1015,9 +1015,6 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, if (ret) goto out_ntfy; - if (nvbo->bo.pin_count) - NV_WARN(drm, "Moving pinned object %p!\n", nvbo); - if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) { ret = nouveau_bo_vm_bind(bo, new_reg, &new_tile); if (ret) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 1e8e287e113c..67075c85f847 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -211,11 +211,7 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, if (r) return r; - /* Can't move a pinned BO */ rbo = container_of(bo, struct radeon_bo, tbo); - if (WARN_ON_ONCE(rbo->tbo.pin_count > 0)) - return -EINVAL; - rdev = radeon_get_rdev(bo->bdev); if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { ttm_bo_move_null(bo, new_mem); diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 326a3d13a829..9baccb2f6e99 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -894,14 +894,18 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, if (!placement->num_placement && !placement->num_busy_placement) return ttm_bo_pipeline_gutting(bo); - /* -* Check whether we need to move buffer. -*/ - if (!bo->resource || !ttm_resource_compat(bo->resource, placement)) { - ret = ttm_bo_move_buffer(bo, placement, ctx); - if (ret) - return ret; - } + /* Check whether we need to move buffer. */ + if (bo->resource && ttm_resource_compat(bo->resource, placement)) + return 0; Note this now skips the tt create below (intentional?). I think i915 needed that, since it creates a dummy system resource initially for all objects, and then relies on ZERO_ALLOC being set for certain objects to know if the memory needs to be cleared or not when later doing the dummy -> vram. Thoughts? That's unproblematic. On initial allocation bo->resource is NULL so we never branch out here. Here is what I see in drm-tip, when first creating an object with ttm: ttm_bo_init_reserved() -> ttm_resource_alloc(PL_SYSTEM, &bo->resource) -> ttm_bo_validate() So bo->resource is for sure not NULL on initial allocation, and is pointing to PL_SYSTEM. And in i915 we initially stuff everything into SYSTEM as a dummy placement. IIRC you had a series that tried to address that (allowing NULL resource or so), but it never landed: https://patchwork.freedesktop.org/patch/500698/?series=107680&rev=2 Oh! My recollection was that this was done! Sorry my memory failed me here, thanks for the notice. Christian. Christian. + + /* Moving of pinned BOs is forbidden */ + if (bo->pin_count) + return -EINVAL; + + ret = ttm_bo_move_buffer(bo, placement, ctx); + if (ret) + return ret; + /* * We might need to add a TTM. */ diff --git a/drivers/gpu/dr
[Intel-gfx] [PATCH v2 0/2] drm/i915/psr: PSR related workarounds
Implement Wa_14014971492 and apply Wa_14013475917 for all MTL steppings v2: Adjust platforms where Wa_14014971492 is applied Cc: Rodrigo Vivi Cc: José Roberto de Souza Cc: Mika Kahola Jouni Högander (2): drm/i915/psr: Implement Wa_14014971492 drm/i915/mtl: Apply Wa_14013475917 for all MTL steppings drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +--- drivers/gpu/drm/i915/display/intel_psr.c | 6 ++ 2 files changed, 7 insertions(+), 3 deletions(-) -- 2.34.1
[Intel-gfx] [PATCH v2 1/2] drm/i915/psr: Implement Wa_14014971492
Implement Wa_14014971492 and apply it for affected platforms. Bspec: 52890, 54369, 55378, 66624 v2: Adjust platforms where applied Cc: Rodrigo Vivi Cc: Mika Kahola Cc: José Roberto de Souza Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_psr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 7d4a15a283a0..7a72e15e6836 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1842,6 +1842,12 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, if (full_update) goto skip_sel_fetch_set_loop; + /* Wa_14014971492 */ + if ((IS_MTL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0) || +IS_ALDERLAKE_P(dev_priv) || IS_TIGERLAKE(dev_priv)) && + crtc_state->splitter.enable) + pipe_clip.y1 = 0; + ret = drm_atomic_add_affected_planes(&state->base, &crtc->base); if (ret) return ret; -- 2.34.1
[Intel-gfx] [PATCH v2 2/2] drm/i915/mtl: Apply Wa_14013475917 for all MTL steppings
Wa_14013475917 has to be applied for all MTL steppings. Bspec: 66624 Cc: Mika Kahola Cc: José Roberto de Souza Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 6a2ee342eab5..b7a154b46da6 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -537,9 +537,7 @@ void hsw_write_infoframe(struct intel_encoder *encoder, 0); /* Wa_14013475917 */ - if ((DISPLAY_VER(dev_priv) == 13 || -IS_MTL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) && crtc_state->has_psr && - type == DP_SDP_VSC) + if (IS_DISPLAY_VER(dev_priv, 13, 14) && crtc_state->has_psr && type == DP_SDP_VSC) return; val |= hsw_infoframe_enable(type); -- 2.34.1
Re: [Intel-gfx] [PATCH 1/2] drm/i915/psr: Implement Wa_14014971492
On Mon, 2023-01-23 at 16:00 -0500, Rodrigo Vivi wrote: > On Wed, Jan 18, 2023 at 10:51:59AM +0200, Jouni Högander wrote: > > Implement Wa_14014971492 and apply it for affected platforms. > > > > Bspec: 52890, 54369, 55378, 66624 > > > > Cc: Mika Kahola > > Cc: José Roberto de Souza > > Signed-off-by: Jouni Högander > > --- > > drivers/gpu/drm/i915/display/intel_psr.c | 5 + > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c > > b/drivers/gpu/drm/i915/display/intel_psr.c > > index 7d4a15a283a0..24900a790508 100644 > > --- a/drivers/gpu/drm/i915/display/intel_psr.c > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c > > @@ -1842,6 +1842,11 @@ int intel_psr2_sel_fetch_update(struct > > intel_atomic_state *state, > > if (full_update) > > goto skip_sel_fetch_set_loop; > > > > + /* Wa_14014971492 */ > > + if ((IS_MTL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0) || > > + IS_DISPLAY_VER(dev_priv, 12, 13)) > > This is not true. > > This lineage number shows as not needed for most of platforms with > the display version 12. > you should only have TGL and ADL-P here, besides the MTL one... > > Which, btw, why we have a MTL_DISPLAY macro instead of using the > display > version :'( Thank you for checking my patch. Sent new version addressing this. > > && crtc_state->splitter.enable) > > + pipe_clip.y1 = 0; > > + > > ret = drm_atomic_add_affected_planes(&state->base, &crtc- > > >base); > > if (ret) > > return ret; > > -- > > 2.34.1 > >
Re: [Intel-gfx] [PATCH v2] drm/probe_helper: sort out poll_running vs poll_enabled
On 20/01/2023 18:39, Laurent Pinchart wrote: Hi Dmitry, Thank you for the patch. On Wed, Jan 18, 2023 at 01:39:05AM +0200, Dmitry Baryshkov wrote: There are two flags attemting to guard connector polling: poll_enabled and poll_running. While poll_enabled semantics is clearly defined and fully adhered (mark that drm_kms_helper_poll_init() was called and not finalized by the _fini() call), the poll_running flag doesn't have such clearliness. This flag is used only in drm_helper_probe_single_connector_modes() to guard calling of drm_kms_helper_poll_enable, it doesn't guard the drm_kms_helper_poll_fini(), etc. Change it to only be set if the polling is actually running. Tie HPD enablement to this flag. This fixes the following warning reported after merging the HPD series: Hot plug detection already enabled WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm] Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6 Hardware name: NXP i.MX8MQ EVK (DT) Workqueue: events_unbound deferred_probe_work_func pstate: 6005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : drm_bridge_hpd_enable+0x94/0x9c [drm] lr : drm_bridge_hpd_enable+0x94/0x9c [drm] sp : 89ef3740 x29: 89ef3740 x28: 09331f00 x27: 1000 x26: 0020 x25: 81148ed8 x24: 0a8fe000 x23: fffd x22: 05086348 x21: 81133ee0 x20: 0550d800 x19: 05086288 x18: 0006 x17: x16: 896ef008 x15: 972891004260 x14: 2a1403e19400 x13: 972891004260 x12: 2a1403e19400 x11: 7100385f29400801 x10: 0aa0 x9 : 88112744 x8 : 00250b00 x7 : 0003 x6 : 0011 x5 : x4 : bd986a48 x3 : 0001 x2 : x1 : x0 : 0025 Call trace: drm_bridge_hpd_enable+0x94/0x9c [drm] drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper] drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper] drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper] drm_client_modeset_probe+0x204/0x1190 [drm] __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper] drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper] drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper] drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper] dcss_kms_attach+0x1c8/0x254 [imx_dcss] dcss_drv_platform_probe+0x90/0xfc [imx_dcss] platform_probe+0x70/0xcc really_probe+0xc4/0x2e0 __driver_probe_device+0x80/0xf0 driver_probe_device+0xe0/0x164 __device_attach_driver+0xc0/0x13c bus_for_each_drv+0x84/0xe0 __device_attach+0xa4/0x1a0 device_initial_probe+0x1c/0x30 bus_probe_device+0xa4/0xb0 deferred_probe_work_func+0x90/0xd0 process_one_work+0x200/0x474 worker_thread+0x74/0x43c kthread+0xfc/0x110 ret_from_fork+0x10/0x20 ---[ end trace ]--- Reported-by: Laurentiu Palcu Fixes: c8268795c9a9 ("drm/probe-helper: enable and disable HPD on connectors") Tested-by: Marek Szyprowski Tested-by: Chen-Yu Tsai Signed-off-by: Dmitry Baryshkov This fixes the issue on my Renesas boards. Tested-by: Laurent Pinchart Please see below for a few comments. [skipped two small comments, will fix them in v3] @@ -886,7 +897,12 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init); */ void drm_kms_helper_poll_fini(struct drm_device *dev) { - drm_kms_helper_poll_disable_fini(dev, true); + if (!dev->mode_config.poll_enabled) + return; + + drm_kms_helper_poll_disable(dev); + + dev->mode_config.poll_enabled = false; The fact that poll_enabled guard init/fini and poll_running guards enable/disable is confusing :-S It would be nice if the poll_enable flag matched the enable/disable function names. One option could be - drm_kms_helper_poll_enable() -> drm_kms_helper_poll_resume() - drm_kms_helper_poll_disable() -> drm_kms_helper_poll_suspend() - drm_kms_helper_poll_init() -> drm_kms_helper_poll_enable() - drm_kms_helper_poll_fini() -> drm_kms_helper_poll_disable() This would align quite well with intended usage in drivers I think, the current enable/disable functions are documented as being used by drivers for suspend/resume, and the init()/fini() functions are documented as "init and enable" and "disable and cleanup". This isn't a candidate for this patch of course, it can be done on top. Yes, but I'd extremely dislike renaming a function to use the name of the function that existed previously. It can lead to very confusing issue. What do you think about keeping poll_init()/_fini() as is, reaming dev->mode_config.poll_enabled to poll_initialized, and renaming poll_enable()/disable() to suspend()/
[Intel-gfx] [PATCH v3 1/2] drm/probe_helper: extract two helper functions
Extract drm_kms_helper_enable_hpd() and drm_kms_helper_disable_hpd(), two helpers that enable and disable HPD handling on all device's connectors. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_probe_helper.c | 68 ++ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 95aeeed33cf5..ab787d71fa66 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -222,6 +222,45 @@ drm_connector_mode_valid(struct drm_connector *connector, return ret; } +static void drm_kms_helper_disable_hpd(struct drm_device *dev) +{ + struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; + + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->disable_hpd) + funcs->disable_hpd(connector); + } + drm_connector_list_iter_end(&conn_iter); +} + +static bool drm_kms_helper_enable_hpd(struct drm_device *dev) +{ + bool poll = false; + struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; + + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->enable_hpd) + funcs->enable_hpd(connector); + + if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | +DRM_CONNECTOR_POLL_DISCONNECT)) + poll = true; + } + drm_connector_list_iter_end(&conn_iter); + + return poll; +} + #define DRM_OUTPUT_POLL_PERIOD (10*HZ) /** * drm_kms_helper_poll_enable - re-enable output polling. @@ -241,26 +280,12 @@ drm_connector_mode_valid(struct drm_connector *connector, void drm_kms_helper_poll_enable(struct drm_device *dev) { bool poll = false; - struct drm_connector *connector; - struct drm_connector_list_iter conn_iter; unsigned long delay = DRM_OUTPUT_POLL_PERIOD; if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) return; - drm_connector_list_iter_begin(dev, &conn_iter); - drm_for_each_connector_iter(connector, &conn_iter) { - const struct drm_connector_helper_funcs *funcs = - connector->helper_private; - - if (funcs && funcs->enable_hpd) - funcs->enable_hpd(connector); - - if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | -DRM_CONNECTOR_POLL_DISCONNECT)) - poll = true; - } - drm_connector_list_iter_end(&conn_iter); + poll = drm_kms_helper_enable_hpd(dev); if (dev->mode_config.delayed_event) { /* @@ -810,24 +835,13 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker); static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini) { - struct drm_connector *connector; - struct drm_connector_list_iter conn_iter; - if (!dev->mode_config.poll_enabled) return; if (fini) dev->mode_config.poll_enabled = false; - drm_connector_list_iter_begin(dev, &conn_iter); - drm_for_each_connector_iter(connector, &conn_iter) { - const struct drm_connector_helper_funcs *funcs = - connector->helper_private; - - if (funcs && funcs->disable_hpd) - funcs->disable_hpd(connector); - } - drm_connector_list_iter_end(&conn_iter); + drm_kms_helper_disable_hpd(dev); cancel_delayed_work_sync(&dev->mode_config.output_poll_work); } -- 2.39.0
[Intel-gfx] [PATCH v3 2/2] drm/probe_helper: sort out poll_running vs poll_enabled
There are two flags attemting to guard connector polling: poll_enabled and poll_running. While poll_enabled semantics is clearly defined and fully adhered (mark that drm_kms_helper_poll_init() was called and not finalized by the _fini() call), the poll_running flag doesn't have such clearliness. This flag is used only in drm_helper_probe_single_connector_modes() to guard calling of drm_kms_helper_poll_enable, it doesn't guard the drm_kms_helper_poll_fini(), etc. Change it to only be set if the polling is actually running. Tie HPD enablement to this flag. This fixes the following warning reported after merging the HPD series: Hot plug detection already enabled WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm] Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6 Hardware name: NXP i.MX8MQ EVK (DT) Workqueue: events_unbound deferred_probe_work_func pstate: 6005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : drm_bridge_hpd_enable+0x94/0x9c [drm] lr : drm_bridge_hpd_enable+0x94/0x9c [drm] sp : 89ef3740 x29: 89ef3740 x28: 09331f00 x27: 1000 x26: 0020 x25: 81148ed8 x24: 0a8fe000 x23: fffd x22: 05086348 x21: 81133ee0 x20: 0550d800 x19: 05086288 x18: 0006 x17: x16: 896ef008 x15: 972891004260 x14: 2a1403e19400 x13: 972891004260 x12: 2a1403e19400 x11: 7100385f29400801 x10: 0aa0 x9 : 88112744 x8 : 00250b00 x7 : 0003 x6 : 0011 x5 : x4 : bd986a48 x3 : 0001 x2 : x1 : x0 : 0025 Call trace: drm_bridge_hpd_enable+0x94/0x9c [drm] drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper] drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper] drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper] drm_client_modeset_probe+0x204/0x1190 [drm] __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper] drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper] drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper] drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper] dcss_kms_attach+0x1c8/0x254 [imx_dcss] dcss_drv_platform_probe+0x90/0xfc [imx_dcss] platform_probe+0x70/0xcc really_probe+0xc4/0x2e0 __driver_probe_device+0x80/0xf0 driver_probe_device+0xe0/0x164 __device_attach_driver+0xc0/0x13c bus_for_each_drv+0x84/0xe0 __device_attach+0xa4/0x1a0 device_initial_probe+0x1c/0x30 bus_probe_device+0xa4/0xb0 deferred_probe_work_func+0x90/0xd0 process_one_work+0x200/0x474 worker_thread+0x74/0x43c kthread+0xfc/0x110 ret_from_fork+0x10/0x20 ---[ end trace ]--- Reported-by: Laurentiu Palcu Fixes: c8268795c9a9 ("drm/probe-helper: enable and disable HPD on connectors") Tested-by: Marek Szyprowski Tested-by: Chen-Yu Tsai Acked-by: Laurentiu Palcu Tested-by: Laurentiu Palcu Tested-by: Laurent Pinchart Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_probe_helper.c | 42 +++--- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index ab787d71fa66..8127be134c39 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -282,7 +282,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) bool poll = false; unsigned long delay = DRM_OUTPUT_POLL_PERIOD; - if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) + if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll || + dev->mode_config.poll_running) return; poll = drm_kms_helper_enable_hpd(dev); @@ -304,6 +305,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) if (poll) schedule_delayed_work(&dev->mode_config.output_poll_work, delay); + + dev->mode_config.poll_running = true; } EXPORT_SYMBOL(drm_kms_helper_poll_enable); @@ -592,10 +595,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, } /* Re-enable polling in case the global poll config changed. */ - if (drm_kms_helper_poll != dev->mode_config.poll_running) - drm_kms_helper_poll_enable(dev); - - dev->mode_config.poll_running = drm_kms_helper_poll; + drm_kms_helper_poll_enable(dev); if (connector->status == connector_status_disconnected) { DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", @@ -735,8 +735,11 @@ static void output_poll_execute(struct work_struct *work) changed = dev->mode_config.delayed_event; dev->mode_config.
Re: [Intel-gfx] [PATCH v2] drm/probe_helper: sort out poll_running vs poll_enabled
On 24/01/2023 10:55, Jani Nikula wrote: On Wed, 18 Jan 2023, Dmitry Baryshkov wrote: There are two flags attemting to guard connector polling: poll_enabled and poll_running. While poll_enabled semantics is clearly defined and fully adhered (mark that drm_kms_helper_poll_init() was called and not finalized by the _fini() call), the poll_running flag doesn't have such clearliness. This flag is used only in drm_helper_probe_single_connector_modes() to guard calling of drm_kms_helper_poll_enable, it doesn't guard the drm_kms_helper_poll_fini(), etc. Change it to only be set if the polling is actually running. Tie HPD enablement to this flag. This fixes the following warning reported after merging the HPD series: Hot plug detection already enabled WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm] Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6 Hardware name: NXP i.MX8MQ EVK (DT) Workqueue: events_unbound deferred_probe_work_func pstate: 6005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : drm_bridge_hpd_enable+0x94/0x9c [drm] lr : drm_bridge_hpd_enable+0x94/0x9c [drm] sp : 89ef3740 x29: 89ef3740 x28: 09331f00 x27: 1000 x26: 0020 x25: 81148ed8 x24: 0a8fe000 x23: fffd x22: 05086348 x21: 81133ee0 x20: 0550d800 x19: 05086288 x18: 0006 x17: x16: 896ef008 x15: 972891004260 x14: 2a1403e19400 x13: 972891004260 x12: 2a1403e19400 x11: 7100385f29400801 x10: 0aa0 x9 : 88112744 x8 : 00250b00 x7 : 0003 x6 : 0011 x5 : x4 : bd986a48 x3 : 0001 x2 : x1 : x0 : 0025 Call trace: drm_bridge_hpd_enable+0x94/0x9c [drm] drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper] drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper] drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper] drm_client_modeset_probe+0x204/0x1190 [drm] __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper] drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper] drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper] drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper] dcss_kms_attach+0x1c8/0x254 [imx_dcss] dcss_drv_platform_probe+0x90/0xfc [imx_dcss] platform_probe+0x70/0xcc really_probe+0xc4/0x2e0 __driver_probe_device+0x80/0xf0 driver_probe_device+0xe0/0x164 __device_attach_driver+0xc0/0x13c bus_for_each_drv+0x84/0xe0 __device_attach+0xa4/0x1a0 device_initial_probe+0x1c/0x30 bus_probe_device+0xa4/0xb0 deferred_probe_work_func+0x90/0xd0 process_one_work+0x200/0x474 worker_thread+0x74/0x43c kthread+0xfc/0x110 ret_from_fork+0x10/0x20 ---[ end trace ]--- Reported-by: Laurentiu Palcu Fixes: c8268795c9a9 ("drm/probe-helper: enable and disable HPD on connectors") Tested-by: Marek Szyprowski Tested-by: Chen-Yu Tsai Signed-off-by: Dmitry Baryshkov --- Changes since v1: - Fixed drm_kms_helper_enable_hpd() to call enable_hpd() instead of disable_hpd(). --- drivers/gpu/drm/drm_probe_helper.c | 110 + 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 7973f2589ced..04754bb7b131 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -222,6 +222,45 @@ drm_connector_mode_valid(struct drm_connector *connector, return ret; } +static void drm_kms_helper_disable_hpd(struct drm_device *dev) +{ + struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; + + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->disable_hpd) + funcs->disable_hpd(connector); + } + drm_connector_list_iter_end(&conn_iter); +} + +static bool drm_kms_helper_enable_hpd(struct drm_device *dev) +{ + bool poll = false; + struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; + + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->enable_hpd) + funcs->enable_hpd(connector); + + if (connector->polled & (D
Re: [Intel-gfx] [PATCH v3 1/2] drm/probe_helper: extract two helper functions
On 24/01/2023 11:45, Dmitry Baryshkov wrote: Extract drm_kms_helper_enable_hpd() and drm_kms_helper_disable_hpd(), two helpers that enable and disable HPD handling on all device's connectors. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_probe_helper.c | 68 ++ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 95aeeed33cf5..ab787d71fa66 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -222,6 +222,45 @@ drm_connector_mode_valid(struct drm_connector *connector, return ret; } +static void drm_kms_helper_disable_hpd(struct drm_device *dev) +{ + struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; + + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->disable_hpd) + funcs->disable_hpd(connector); + } + drm_connector_list_iter_end(&conn_iter); +} + +static bool drm_kms_helper_enable_hpd(struct drm_device *dev) +{ + bool poll = false; + struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; + + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->enable_hpd) + funcs->enable_hpd(connector); + + if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | +DRM_CONNECTOR_POLL_DISCONNECT)) + poll = true; + } + drm_connector_list_iter_end(&conn_iter); + + return poll; +} + #define DRM_OUTPUT_POLL_PERIOD (10*HZ) /** * drm_kms_helper_poll_enable - re-enable output polling. @@ -241,26 +280,12 @@ drm_connector_mode_valid(struct drm_connector *connector, void drm_kms_helper_poll_enable(struct drm_device *dev) { bool poll = false; - struct drm_connector *connector; - struct drm_connector_list_iter conn_iter; unsigned long delay = DRM_OUTPUT_POLL_PERIOD; if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) return; - drm_connector_list_iter_begin(dev, &conn_iter); - drm_for_each_connector_iter(connector, &conn_iter) { - const struct drm_connector_helper_funcs *funcs = - connector->helper_private; - - if (funcs && funcs->enable_hpd) - funcs->enable_hpd(connector); - - if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | -DRM_CONNECTOR_POLL_DISCONNECT)) - poll = true; - } - drm_connector_list_iter_end(&conn_iter); + poll = drm_kms_helper_enable_hpd(dev); if (dev->mode_config.delayed_event) { /* @@ -810,24 +835,13 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker); static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini) { - struct drm_connector *connector; - struct drm_connector_list_iter conn_iter; - if (!dev->mode_config.poll_enabled) return; if (fini) dev->mode_config.poll_enabled = false; - drm_connector_list_iter_begin(dev, &conn_iter); - drm_for_each_connector_iter(connector, &conn_iter) { - const struct drm_connector_helper_funcs *funcs = - connector->helper_private; - - if (funcs && funcs->disable_hpd) - funcs->disable_hpd(connector); - } - drm_connector_list_iter_end(&conn_iter); + drm_kms_helper_disable_hpd(dev); cancel_delayed_work_sync(&dev->mode_config.output_poll_work); } Reviewed-by: Neil Armstrong
Re: [Intel-gfx] [PATCH 1/8] drm/i915/guc: Add GuC oriented print macros
On 24.01.2023 00:27, John Harrison wrote: > On 1/20/2023 08:40, Michal Wajdeczko wrote: >> While we do have GT oriented print macros, add few more GuC >> specific to have common look and feel across all messages >> related to the GuC and to avoid chasing the gt pointer. >> >> We will use these macros shortly in upcoming patches. >> >> Signed-off-by: Michal Wajdeczko >> Cc: Tvrtko Ursulin >> Cc: John Harrison >> --- >> drivers/gpu/drm/i915/gt/uc/intel_guc_print.h | 48 >> 1 file changed, 48 insertions(+) >> create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_guc_print.h >> >> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_print.h >> b/drivers/gpu/drm/i915/gt/uc/intel_guc_print.h >> new file mode 100644 >> index ..e75989d4ba06 >> --- /dev/null >> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_print.h >> @@ -0,0 +1,48 @@ >> +/* SPDX-License-Identifier: MIT */ >> +/* >> + * Copyright © 2023 Intel Corporation >> + */ >> + >> +#ifndef __INTEL_GUC_PRINT__ >> +#define __INTEL_GUC_PRINT__ >> + >> +#include "gt/intel_gt.h" > This necessary only for the guc_to_gt() accessor? Hmm. Maybe it is worth > moving that to intel_guc.h? I know Jani for one would like to see all of > that cleaned up. But maybe that's a follow up patch. we can't move it easily without creating new intel_guc_types.h file for all struct definitions, so definitely separate follow up series would be needed Michal > > John. > >> +#include "gt/intel_gt_print.h" >> + >> +#define guc_printk(_guc, _level, _fmt, ...) \ >> + gt_##_level(guc_to_gt(_guc), "GUC: " _fmt, ##__VA_ARGS__) >> + >> +#define guc_err(_guc, _fmt, ...) \ >> + guc_printk((_guc), err, _fmt, ##__VA_ARGS__) >> + >> +#define guc_warn(_guc, _fmt, ...) \ >> + guc_printk((_guc), warn, _fmt, ##__VA_ARGS__) >> + >> +#define guc_notice(_guc, _fmt, ...) \ >> + guc_printk((_guc), notice, _fmt, ##__VA_ARGS__) >> + >> +#define guc_info(_guc, _fmt, ...) \ >> + guc_printk((_guc), info, _fmt, ##__VA_ARGS__) >> + >> +#define guc_dbg(_guc, _fmt, ...) \ >> + guc_printk((_guc), dbg, _fmt, ##__VA_ARGS__) >> + >> +#define guc_err_ratelimited(_guc, _fmt, ...) \ >> + guc_printk((_guc), err_ratelimited, _fmt, ##__VA_ARGS__) >> + >> +#define guc_probe_error(_guc, _fmt, ...) \ >> + guc_printk((_guc), probe_error, _fmt, ##__VA_ARGS__) >> + >> +#define guc_WARN(_guc, _cond, _fmt, ...) \ >> + gt_WARN(guc_to_gt(_guc), _cond, "GUC: " _fmt, ##__VA_ARGS__) >> + >> +#define guc_WARN_ONCE(_guc, _cond, _fmt, ...) \ >> + gt_WARN_ONCE(guc_to_gt(_guc), _cond, "GUC: " _fmt, ##__VA_ARGS__) >> + >> +#define guc_WARN_ON(_guc, _cond) \ >> + gt_WARN(guc_to_gt(_guc), _cond, "%s(%s)", "guc_WARN_ON", >> __stringify(_cond)) >> + >> +#define guc_WARN_ON_ONCE(_guc, _cond) \ >> + gt_WARN_ONCE(guc_to_gt(_guc), _cond, "%s(%s)", >> "guc_WARN_ON_ONCE", __stringify(_cond)) >> + >> +#endif /* __INTEL_GUC_PRINT__ */ >
[Intel-gfx] [PATCH] drm/i915/gt: Clear wedged status upon suspend
From: Chris Wilson Currently we use set-wedged on suspend if the workload is not responding in order to allow a fast suspend (albeit at the cost of discarding the current userspace). This may leave the device wedged during suspend, where we may require the device available in order to swapout CPU inaccessible device memory. Clear any temporary wedged-status after flushing userspace off the device so we can use the blitter ourselves inside suspend. Testcase: igt/gem_eio/in-flight-suspend Cc: Mika Kuoppala Cc: Tvrtko Ursulin Signed-off-by: Chris Wilson Signed-off-by: Nirmoy Das --- drivers/gpu/drm/i915/gt/intel_gt_pm.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c index cef3d6f5c34e..74d1dd3793f9 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c @@ -317,19 +317,17 @@ int intel_gt_resume(struct intel_gt *gt) static void wait_for_suspend(struct intel_gt *gt) { - if (!intel_gt_pm_is_awake(gt)) - return; - - if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) { + if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) /* * Forcibly cancel outstanding work and leave * the gpu quiet. */ intel_gt_set_wedged(gt); - intel_gt_retire_requests(gt); - } intel_gt_pm_wait_for_idle(gt); + + /* Make the GPU available again for swapout */ + intel_gt_unset_wedged(gt); } void intel_gt_suspend_prepare(struct intel_gt *gt) -- 2.39.0
Re: [Intel-gfx] [PATCH] drm/i915/gt: Clear wedged status upon suspend
Forgot to add the drm issue a reference. On 1/24/2023 12:05 PM, Nirmoy Das wrote: From: Chris Wilson Currently we use set-wedged on suspend if the workload is not responding in order to allow a fast suspend (albeit at the cost of discarding the current userspace). This may leave the device wedged during suspend, where we may require the device available in order to swapout CPU inaccessible device memory. Clear any temporary wedged-status after flushing userspace off the device so we can use the blitter ourselves inside suspend. Testcase: igt/gem_eio/in-flight-suspend References: https://gitlab.freedesktop.org/drm/intel/-/issues/7896 Cc: Mika Kuoppala Cc: Tvrtko Ursulin Signed-off-by: Chris Wilson Signed-off-by: Nirmoy Das --- drivers/gpu/drm/i915/gt/intel_gt_pm.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c index cef3d6f5c34e..74d1dd3793f9 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c @@ -317,19 +317,17 @@ int intel_gt_resume(struct intel_gt *gt) static void wait_for_suspend(struct intel_gt *gt) { - if (!intel_gt_pm_is_awake(gt)) - return; - - if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) { + if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) /* * Forcibly cancel outstanding work and leave * the gpu quiet. */ intel_gt_set_wedged(gt); - intel_gt_retire_requests(gt); - } intel_gt_pm_wait_for_idle(gt); + + /* Make the GPU available again for swapout */ + intel_gt_unset_wedged(gt); } void intel_gt_suspend_prepare(struct intel_gt *gt)
Re: [Intel-gfx] [PATCH 10/10] drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info'
Hi Am 23.01.23 um 21:50 schrieb Sam Ravnborg: Hi Thomas, a quick drive-by comment. On Mon, Jan 23, 2023 at 11:05:59AM +0100, Thomas Zimmermann wrote: The generic fbdev emulation names variables of type struct fb_info both 'fbi' and 'info'. The latter seems to be more common in fbdev code, so name fbi accordingly. Also replace the duplicate variable in drm_fbdev_fb_destroy(). Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 49 ++--- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 49a0bba86ce7..7633da5c13c3 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -46,17 +46,16 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user) static void drm_fbdev_fb_destroy(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - struct fb_info *fbi = fb_helper->info; void *shadow = NULL; if (!fb_helper->dev) return; - if (fbi) { - if (fbi->fbdefio) - fb_deferred_io_cleanup(fbi); + if (info) { As info is already used above to find fb_helper, this check is redundant. Oh indeed; will fix. This change belongs to patch 8, which streamlines the cleanup a bit. Best regards Thomas Sam + if (info->fbdefio) + fb_deferred_io_cleanup(info); if (drm_fbdev_use_shadow_fb(fb_helper)) - shadow = fbi->screen_buffer; + shadow = info->screen_buffer; } drm_fb_helper_fini(fb_helper); @@ -173,7 +172,7 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper, struct drm_device *dev = fb_helper->dev; struct drm_client_buffer *buffer; struct drm_framebuffer *fb; - struct fb_info *fbi; + struct fb_info *info; u32 format; struct iosys_map map; int ret; @@ -192,35 +191,35 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper, fb_helper->fb = buffer->fb; fb = buffer->fb; - fbi = drm_fb_helper_alloc_info(fb_helper); - if (IS_ERR(fbi)) - return PTR_ERR(fbi); + info = drm_fb_helper_alloc_info(fb_helper); + if (IS_ERR(info)) + return PTR_ERR(info); - fbi->fbops = &drm_fbdev_fb_ops; - fbi->screen_size = sizes->surface_height * fb->pitches[0]; - fbi->fix.smem_len = fbi->screen_size; - fbi->flags = FBINFO_DEFAULT; + info->fbops = &drm_fbdev_fb_ops; + info->screen_size = sizes->surface_height * fb->pitches[0]; + info->fix.smem_len = info->screen_size; + info->flags = FBINFO_DEFAULT; - drm_fb_helper_fill_info(fbi, fb_helper, sizes); + drm_fb_helper_fill_info(info, fb_helper, sizes); if (drm_fbdev_use_shadow_fb(fb_helper)) { - fbi->screen_buffer = vzalloc(fbi->screen_size); - if (!fbi->screen_buffer) + info->screen_buffer = vzalloc(info->screen_size); + if (!info->screen_buffer) return -ENOMEM; - fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST; + info->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST; - fbi->fbdefio = &drm_fbdev_defio; - fb_deferred_io_init(fbi); + info->fbdefio = &drm_fbdev_defio; + fb_deferred_io_init(info); } else { /* buffer is mapped for HW framebuffer */ ret = drm_client_buffer_vmap(fb_helper->buffer, &map); if (ret) return ret; if (map.is_iomem) { - fbi->screen_base = map.vaddr_iomem; + info->screen_base = map.vaddr_iomem; } else { - fbi->screen_buffer = map.vaddr; - fbi->flags |= FBINFO_VIRTFB; + info->screen_buffer = map.vaddr; + info->flags |= FBINFO_VIRTFB; } /* @@ -229,10 +228,10 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper, * case. */ #if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM) - if (fb_helper->hint_leak_smem_start && fbi->fix.smem_start == 0 && + if (fb_helper->hint_leak_smem_start && info->fix.smem_start == 0 && !drm_WARN_ON_ONCE(dev, map.is_iomem)) - fbi->fix.smem_start = - page_to_phys(virt_to_page(fbi->screen_buffer)); + info->fix.smem_start = + page_to_phys(virt_to_page(info->screen_buffer)); #endif } -- 2.39.0 -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 368
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm/edid: reverse display info preserve/clear logic, defaulting to clear
== Series Details == Series: series starting with [1/3] drm/edid: reverse display info preserve/clear logic, defaulting to clear URL : https://patchwork.freedesktop.org/series/113256/ State : warning == Summary == Error: dim sparse failed Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/fbdev: Implement wrappers for callbacks used by fbcon
== Series Details == Series: drm/i915/fbdev: Implement wrappers for callbacks used by fbcon URL : https://patchwork.freedesktop.org/series/113255/ State : success == Summary == CI Bug Log - changes from CI_DRM_12626_full -> Patchwork_113255v1_full Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/index.html Participating hosts (12 -> 11) -- Additional (1): shard-rkl0 Missing(2): pig-skl-6260u pig-kbl-iris Known issues Here are the changes found in Patchwork_113255v1_full that come from known issues: ### IGT changes ### Possible fixes * igt@drm_fdinfo@idle@rcs0: - {shard-rkl}:[FAIL][1] ([i915#7742]) -> [PASS][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-rkl-2/igt@drm_fdinfo@i...@rcs0.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-rkl-5/igt@drm_fdinfo@i...@rcs0.html * igt@gem_eio@reset-stress: - {shard-dg1}:[FAIL][3] ([i915#5784]) -> [PASS][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-dg1-17/igt@gem_...@reset-stress.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-dg1-14/igt@gem_...@reset-stress.html * igt@gem_exec_balancer@fairslice: - {shard-rkl}:[SKIP][5] ([i915#6259]) -> [PASS][6] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-rkl-5/igt@gem_exec_balan...@fairslice.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-rkl-2/igt@gem_exec_balan...@fairslice.html * igt@gem_exec_reloc@basic-wc-read-noreloc: - {shard-rkl}:[SKIP][7] ([i915#3281]) -> [PASS][8] +8 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-rkl-3/igt@gem_exec_re...@basic-wc-read-noreloc.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-rkl-5/igt@gem_exec_re...@basic-wc-read-noreloc.html * igt@gem_set_tiling_vs_pwrite: - {shard-rkl}:[SKIP][9] ([i915#3282]) -> [PASS][10] +3 similar issues [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-rkl-3/igt@gem_set_tiling_vs_pwrite.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-rkl-5/igt@gem_set_tiling_vs_pwrite.html * igt@gen9_exec_parse@batch-zero-length: - {shard-rkl}:[SKIP][11] ([i915#2527]) -> [PASS][12] [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-rkl-3/igt@gen9_exec_pa...@batch-zero-length.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-rkl-5/igt@gen9_exec_pa...@batch-zero-length.html * igt@i915_hangman@gt-engine-error@bcs0: - {shard-rkl}:[SKIP][13] ([i915#6258]) -> [PASS][14] [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-rkl-5/igt@i915_hangman@gt-engine-er...@bcs0.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-rkl-2/igt@i915_hangman@gt-engine-er...@bcs0.html * igt@i915_pm_sseu@full-enable: - {shard-rkl}:[SKIP][15] ([i915#4387]) -> [PASS][16] [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-rkl-3/igt@i915_pm_s...@full-enable.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-rkl-5/igt@i915_pm_s...@full-enable.html * igt@i915_selftest@live@gt_heartbeat: - shard-glk: [DMESG-FAIL][17] ([i915#5334]) -> [PASS][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-glk4/igt@i915_selftest@live@gt_heartbeat.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-glk8/igt@i915_selftest@live@gt_heartbeat.html * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions: - shard-glk: [FAIL][19] ([i915#2346]) -> [PASS][20] [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-glk6/igt@kms_cursor_legacy@flip-vs-cur...@atomic-transitions.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-glk1/igt@kms_cursor_legacy@flip-vs-cur...@atomic-transitions.html * igt@kms_fbcon_fbt@fbc: - shard-glk: [FAIL][21] ([i915#4767]) -> [PASS][22] [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-glk7/igt@kms_fbcon_...@fbc.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-glk1/igt@kms_fbcon_...@fbc.html * igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes: - {shard-tglu}: [SKIP][23] ([i915#1849] / [i915#3558]) -> [PASS][24] +1 similar issue [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12626/shard-tglu-6/igt@kms_plane@plane-panning-bottom-right-susp...@pipe-a-planes.html [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113255v1/shard-tglu-1/igt@kms_plane@plane-panning-bottom-right-susp...@pipe-a-planes.html * igt@kms_properti
[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/3] drm/edid: reverse display info preserve/clear logic, defaulting to clear
== Series Details == Series: series starting with [1/3] drm/edid: reverse display info preserve/clear logic, defaulting to clear URL : https://patchwork.freedesktop.org/series/113256/ State : success == Summary == CI Bug Log - changes from CI_DRM_12627 -> Patchwork_113256v1 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/index.html Participating hosts (41 -> 39) -- Missing(2): fi-kbl-soraka fi-snb-2520m Known issues Here are the changes found in Patchwork_113256v1 that come from known issues: ### IGT changes ### Issues hit * igt@gem_exec_gttfill@basic: - fi-pnv-d510:[PASS][1] -> [FAIL][2] ([i915#7229]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/fi-pnv-d510/igt@gem_exec_gttf...@basic.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/fi-pnv-d510/igt@gem_exec_gttf...@basic.html Possible fixes * igt@i915_selftest@live@guc: - {bat-rpls-2}: [DMESG-WARN][3] ([i915#7852]) -> [PASS][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-rpls-2/igt@i915_selftest@l...@guc.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/bat-rpls-2/igt@i915_selftest@l...@guc.html * igt@i915_selftest@live@hangcheck: - {bat-dg1-7}:[INCOMPLETE][5] ([i915#4983]) -> [PASS][6] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html * igt@i915_selftest@live@migrate: - {bat-dg2-11}: [DMESG-WARN][7] ([i915#7699]) -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-dg2-11/igt@i915_selftest@l...@migrate.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/bat-dg2-11/igt@i915_selftest@l...@migrate.html * igt@i915_selftest@live@reset: - {bat-rpls-1}: [DMESG-FAIL][9] ([i915#4983]) -> [PASS][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-rpls-1/igt@i915_selftest@l...@reset.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/bat-rpls-1/igt@i915_selftest@l...@reset.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982 [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867 [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078 [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983 [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334 [i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229 [i915#7359]: https://gitlab.freedesktop.org/drm/intel/issues/7359 [i915#7625]: https://gitlab.freedesktop.org/drm/intel/issues/7625 [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699 [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828 [i915#7852]: https://gitlab.freedesktop.org/drm/intel/issues/7852 Build changes - * Linux: CI_DRM_12627 -> Patchwork_113256v1 CI-20190529: 20190529 CI_DRM_12627: a89114c496133077159d90f4ffc0ab3a5e6e89c0 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_7136: 31b6af91747ad8c705399c9006cdb81cb1864146 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git Patchwork_113256v1: a89114c496133077159d90f4ffc0ab3a5e6e89c0 @ git://anongit.freedesktop.org/gfx-ci/linux ### Linux commits b65b2b13e778 drm/connector: move ELD and video/audio latencies to display info 508746392003 drm/connector: move HDR sink metadata to display info c0a969b6932d drm/edid: reverse display info preserve/clear logic, defaulting to clear == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/index.html
Re: [Intel-gfx] [PATCH 3/3] drm/connector: move ELD and video/audio latencies to display info
Hi Jani, I love your patch! Yet something to improve: [auto build test ERROR on drm-tip/drm-tip] url: https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-connector-move-HDR-sink-metadata-to-display-info/20230124-174322 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip patch link: https://lore.kernel.org/r/20230124094154.2282778-3-jani.nikula%40intel.com patch subject: [Intel-gfx] [PATCH 3/3] drm/connector: move ELD and video/audio latencies to display info config: arm-defconfig (https://download.01.org/0day-ci/archive/20230124/202301242049.ekzx7rzz-...@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/1e92b5478cfc1b0df6615365217e9548b0d5 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jani-Nikula/drm-connector-move-HDR-sink-metadata-to-display-info/20230124-174322 git checkout 1e92b5478cfc1b0df6615365217e9548b0d5 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): drivers/gpu/drm/tegra/hdmi.c: In function 'tegra_hdmi_write_eld': >> drivers/gpu/drm/tegra/hdmi.c:620:60: error: 'struct drm_connector' has no >> member named 'eld' 620 | size_t length = drm_eld_size(hdmi->output.connector.eld), i; |^ drivers/gpu/drm/tegra/hdmi.c:624:72: error: 'struct drm_connector' has no member named 'eld' 624 | tegra_hdmi_writel(hdmi, i << 8 | hdmi->output.connector.eld[i], | ^ -- drivers/gpu/drm/tegra/sor.c: In function 'tegra_sor_write_eld': >> drivers/gpu/drm/tegra/sor.c:1951:59: error: 'struct drm_connector' has no >> member named 'eld' 1951 | size_t length = drm_eld_size(sor->output.connector.eld), i; | ^ drivers/gpu/drm/tegra/sor.c:1954:69: error: 'struct drm_connector' has no member named 'eld' 1954 | tegra_sor_writel(sor, i << 8 | sor->output.connector.eld[i], | ^ vim +620 drivers/gpu/drm/tegra/hdmi.c edec4af4c3d6d2 Thierry Reding 2012-11-15 617 5234549b93aa2a Thierry Reding 2015-08-07 618 static void tegra_hdmi_write_eld(struct tegra_hdmi *hdmi) 5234549b93aa2a Thierry Reding 2015-08-07 619 { 5234549b93aa2a Thierry Reding 2015-08-07 @620 size_t length = drm_eld_size(hdmi->output.connector.eld), i; 5234549b93aa2a Thierry Reding 2015-08-07 621 u32 value; edec4af4c3d6d2 Thierry Reding 2012-11-15 622 5234549b93aa2a Thierry Reding 2015-08-07 623 for (i = 0; i < length; i++) 5234549b93aa2a Thierry Reding 2015-08-07 624 tegra_hdmi_writel(hdmi, i << 8 | hdmi->output.connector.eld[i], 5234549b93aa2a Thierry Reding 2015-08-07 625 HDMI_NV_PDISP_SOR_AUDIO_HDA_ELD_BUFWR); edec4af4c3d6d2 Thierry Reding 2012-11-15 626 5234549b93aa2a Thierry Reding 2015-08-07 627 /* 5234549b93aa2a Thierry Reding 2015-08-07 628* The HDA codec will always report an ELD buffer size of 96 bytes and 5234549b93aa2a Thierry Reding 2015-08-07 629* the HDA codec driver will check that each byte read from the buffer 5234549b93aa2a Thierry Reding 2015-08-07 630* is valid. Therefore every byte must be written, even if no 96 bytes 5234549b93aa2a Thierry Reding 2015-08-07 631* were parsed from EDID. 5234549b93aa2a Thierry Reding 2015-08-07 632*/ 5234549b93aa2a Thierry Reding 2015-08-07 633 for (i = length; i < HDMI_ELD_BUFFER_SIZE; i++) 5234549b93aa2a Thierry Reding 2015-08-07 634 tegra_hdmi_writel(hdmi, i << 8 | 0, 5234549b93aa2a Thierry Reding 2015-08-07 635 HDMI_NV_PDISP_SOR_AUDIO_HDA_ELD_BUFWR); 5234549b93aa2a Thierry Reding 2015-08-07 636 5234549b93aa2a Thierry Reding 2015-08-07 637 value = SOR_AUDIO_HDA_PRESENSE_VALID | SOR_AUDIO_HDA_PRESENSE_PRESENT; 5234549b93aa2a Thierry Reding 2015-08-07 638 tegra_hdmi_writel(hdmi, value, HDMI_NV_PDISP_SOR_AUDIO_HDA_PRESENSE); edec4af4c3d6d2 Thierry Reding 2012-11-15 639 } edec4af4c3d6d2 Thierry Reding 2012-11-15 640 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests
Re: [Intel-gfx] [PATCH] drm/i915/fbdev: Implement wrappers for callbacks used by fbcon
Hi Am 24.01.23 um 10:10 schrieb Jouni Högander: After disconnecting damage worker from update logic our dirty callback is not called on fbcon events. This is causing problems to features (PSR, FBC, DRRS) relying on dirty callback getting called and breaking fb console when these features are in use. Implement wrappers for callbacks used by fbcon and call our dirty callback in those. Fixes: f231af498c29 ("drm/fb-helper: Disconnect damage worker from update logic") Cc: Ville Syrjälä Cc: Thomas Zimmermann Cc: Jani Nikula Signed-off-by: Jouni Högander This is the better solution wrt what fbdev wants. Acked-by: Thomas Zimmermann Best regards Thomas --- drivers/gpu/drm/i915/display/intel_fbdev.c | 53 -- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 19f3b5d92a55..b1653624552e 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -77,6 +77,18 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev) intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU); } +static void intel_fbdev_dirty(struct fb_info *info) +{ + struct drm_fb_helper *helper = info->par; + + /* +* Intel_fb dirty implementation doesn't use damage clips -> +* no need to pass them here +*/ + if (helper->fb->funcs->dirty) + helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, NULL, 0); +} + static int intel_fbdev_set_par(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; @@ -91,6 +103,39 @@ static int intel_fbdev_set_par(struct fb_info *info) return ret; } +static ssize_t intel_fbdev_write(struct fb_info *info, const char __user *buf, +size_t count, loff_t *ppos) +{ + int ret; + + ret = drm_fb_helper_cfb_write(info, buf, count, ppos); + if (ret > 0) + intel_fbdev_dirty(info); + + return ret; +} + +static void intel_fbdev_fillrect(struct fb_info *info, + const struct fb_fillrect *rect) +{ + drm_fb_helper_cfb_fillrect(info, rect); + intel_fbdev_dirty(info); +} + +static void intel_fbdev_copyarea(struct fb_info *info, + const struct fb_copyarea *area) +{ + drm_fb_helper_cfb_copyarea(info, area); + intel_fbdev_dirty(info); +} + +static void intel_fbdev_imageblit(struct fb_info *info, +const struct fb_image *image) +{ + drm_fb_helper_cfb_imageblit(info, image); + intel_fbdev_dirty(info); +} + static int intel_fbdev_blank(int blank, struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; @@ -125,10 +170,10 @@ static const struct fb_ops intelfb_ops = { DRM_FB_HELPER_DEFAULT_OPS, .fb_set_par = intel_fbdev_set_par, .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, + .fb_write = intel_fbdev_write, + .fb_fillrect = intel_fbdev_fillrect, + .fb_copyarea = intel_fbdev_copyarea, + .fb_imageblit = intel_fbdev_imageblit, .fb_pan_display = intel_fbdev_pan_display, .fb_blank = intel_fbdev_blank, }; -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev OpenPGP_signature Description: OpenPGP digital signature
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for Enable HDCP2.x via GSC CS (rev8)
== Series Details == Series: Enable HDCP2.x via GSC CS (rev8) URL : https://patchwork.freedesktop.org/series/111876/ State : warning == Summary == Error: dim sparse failed Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
[Intel-gfx] ✓ Fi.CI.BAT: success for Enable HDCP2.x via GSC CS (rev8)
== Series Details == Series: Enable HDCP2.x via GSC CS (rev8) URL : https://patchwork.freedesktop.org/series/111876/ State : success == Summary == CI Bug Log - changes from CI_DRM_12627 -> Patchwork_111876v8 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/index.html Participating hosts (41 -> 35) -- Missing(6): fi-kbl-soraka fi-rkl-11600 fi-tgl-dsi fi-snb-2520m fi-pnv-d510 fi-bsw-kefka Known issues Here are the changes found in Patchwork_111876v8 that come from known issues: ### IGT changes ### Issues hit * igt@i915_selftest@live@gt_heartbeat: - fi-apl-guc: [PASS][1] -> [DMESG-FAIL][2] ([i915#5334]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html Possible fixes * igt@i915_selftest@live@guc: - {bat-rpls-2}: [DMESG-WARN][3] ([i915#7852]) -> [PASS][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-rpls-2/igt@i915_selftest@l...@guc.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/bat-rpls-2/igt@i915_selftest@l...@guc.html * igt@i915_selftest@live@hangcheck: - {bat-dg1-7}:[INCOMPLETE][5] ([i915#4983]) -> [PASS][6] [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html * igt@i915_selftest@live@reset: - {bat-rpls-1}: [DMESG-FAIL][7] ([i915#4983]) -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-rpls-1/igt@i915_selftest@l...@reset.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/bat-rpls-1/igt@i915_selftest@l...@reset.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078 [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983 [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334 [i915#7359]: https://gitlab.freedesktop.org/drm/intel/issues/7359 [i915#7625]: https://gitlab.freedesktop.org/drm/intel/issues/7625 [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828 [i915#7852]: https://gitlab.freedesktop.org/drm/intel/issues/7852 Build changes - * Linux: CI_DRM_12627 -> Patchwork_111876v8 CI-20190529: 20190529 CI_DRM_12627: a89114c496133077159d90f4ffc0ab3a5e6e89c0 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_7136: 31b6af91747ad8c705399c9006cdb81cb1864146 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git Patchwork_111876v8: a89114c496133077159d90f4ffc0ab3a5e6e89c0 @ git://anongit.freedesktop.org/gfx-ci/linux ### Linux commits 2ec48fe121ac drm/i915/mtl: Add HDCP GSC interface d58561b33f14 drm/i915/mtl: Add function to send command to GSC CS 214b7b5ea3e3 drm/i915/hdcp: Refactor HDCP API structures b66a1e6bc92c i915/hdcp: HDCP2.x Refactoring to agnostic hdcp 6083a73d7f6c drm/i915/hdcp: Keep hdcp agonstic naming convention 083d344ec146 drm/i915/gsc: Create GSC request submission mechanism == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/index.html
[Intel-gfx] [PATCH 1/5] drm/i915: audit bo->resource usage v3
From: Christian König Make sure we can at least move and alloc TT objects without backing store. v2: clear the tt object even when no resource is allocated. v3: add Matthews changes for i915 as well. Signed-off-by: Christian König --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 27 -- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 56 +--- 2 files changed, 71 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 8cfed1bef629..7420276827a5 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -274,8 +274,6 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo, { struct drm_i915_private *i915 = container_of(bo->bdev, typeof(*i915), bdev); - struct ttm_resource_manager *man = - ttm_manager_type(bo->bdev, bo->resource->mem_type); struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo); unsigned long ccs_pages = 0; enum ttm_caching caching; @@ -289,8 +287,8 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo, if (!i915_tt) return NULL; - if (obj->flags & I915_BO_ALLOC_CPU_CLEAR && - man->use_tt) + if (obj->flags & I915_BO_ALLOC_CPU_CLEAR && (!bo->resource || + ttm_manager_type(bo->bdev, bo->resource->mem_type)->use_tt)) page_flags |= TTM_TT_FLAG_ZERO_ALLOC; caching = i915_ttm_select_tt_caching(obj); @@ -1058,7 +1056,26 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) return VM_FAULT_SIGBUS; } - if (!i915_ttm_resource_mappable(bo->resource)) { + /* +* This must be swapped out with shmem ttm_tt (pipeline-gutting). +* Calling ttm_bo_validate() here with TTM_PL_SYSTEM should only go as +* far as far doing a ttm_bo_move_null(), which should skip all the +* other junk. +*/ + if (!bo->resource) { + struct ttm_operation_ctx ctx = { + .interruptible = true, + .no_wait_gpu = true, /* should be idle already */ + }; + + GEM_BUG_ON(!bo->ttm || !(bo->ttm->page_flags & TTM_TT_FLAG_SWAPPED)); + + ret = ttm_bo_validate(bo, i915_ttm_sys_placement(), &ctx); + if (ret) { + dma_resv_unlock(bo->base.resv); + return VM_FAULT_SIGBUS; + } + } else if (!i915_ttm_resource_mappable(bo->resource)) { int err = -ENODEV; int i; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c index 2ebaaf4d663c..76dd9e5e1a8b 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -103,7 +103,27 @@ void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj) { struct ttm_buffer_object *bo = i915_gem_to_ttm(obj); unsigned int cache_level; + unsigned int mem_flags; unsigned int i; + int mem_type; + + /* +* We might have been purged (or swapped out) if the resource is NULL, +* in which case the SYSTEM placement is the closest match to describe +* the current domain. If the object is ever used in this state then we +* will require moving it again. +*/ + if (!bo->resource) { + mem_flags = I915_BO_FLAG_STRUCT_PAGE; + mem_type = I915_PL_SYSTEM; + cache_level = I915_CACHE_NONE; + } else { + mem_flags = i915_ttm_cpu_maps_iomem(bo->resource) ? I915_BO_FLAG_IOMEM : + I915_BO_FLAG_STRUCT_PAGE; + mem_type = bo->resource->mem_type; + cache_level = i915_ttm_cache_level(to_i915(bo->base.dev), bo->resource, + bo->ttm); + } /* * If object was moved to an allowable region, update the object @@ -111,11 +131,11 @@ void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj) * in an allowable region, it's evicted and we don't update the * object region. */ - if (intel_region_to_ttm_type(obj->mm.region) != bo->resource->mem_type) { + if (intel_region_to_ttm_type(obj->mm.region) != mem_type) { for (i = 0; i < obj->mm.n_placements; ++i) { struct intel_memory_region *mr = obj->mm.placements[i]; - if (intel_region_to_ttm_type(mr) == bo->resource->mem_type && + if (intel_region_to_ttm_type(mr) == mem_type && mr != obj->mm.region) { i915_gem_object_release_memory_region(obj); i915_gem_object_
[Intel-gfx] [PATCH 3/5] drm/ttm: stop allocating a dummy resource for pipelined gutting
That should not be necessary any more when drivers should at least be able to handle a move without a resource. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 7635d7d6b13b..d9d2b0903b22 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -704,30 +704,23 @@ EXPORT_SYMBOL(ttm_bo_move_sync_cleanup); */ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) { - static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM }; struct ttm_buffer_object *ghost; - struct ttm_resource *sys_res; struct ttm_tt *ttm; int ret; - ret = ttm_resource_alloc(bo, &sys_mem, &sys_res); - if (ret) - return ret; - /* If already idle, no need for ghost object dance. */ if (dma_resv_test_signaled(bo->base.resv, DMA_RESV_USAGE_BOOKKEEP)) { if (!bo->ttm) { /* See comment below about clearing. */ ret = ttm_tt_create(bo, true); if (ret) - goto error_free_sys_mem; + return ret; } else { ttm_tt_unpopulate(bo->bdev, bo->ttm); if (bo->type == ttm_bo_type_device) ttm_tt_mark_for_clear(bo->ttm); } ttm_resource_free(bo, &bo->resource); - ttm_bo_assign_mem(bo, sys_res); return 0; } @@ -744,7 +737,7 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) ret = ttm_tt_create(bo, true); swap(bo->ttm, ttm); if (ret) - goto error_free_sys_mem; + return ret; ret = ttm_buffer_object_transfer(bo, &ghost); if (ret) @@ -760,13 +753,9 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) dma_resv_unlock(&ghost->base._resv); ttm_bo_put(ghost); bo->ttm = ttm; - ttm_bo_assign_mem(bo, sys_res); return 0; error_destroy_tt: ttm_tt_destroy(bo->bdev, ttm); - -error_free_sys_mem: - ttm_resource_free(bo, &sys_res); return ret; } -- 2.34.1
[Intel-gfx] [PATCH 5/5] drm/ttm: replace busy placement with flags v2
Instead of a list of separate busy placement add flags which indicate that a placement should only be used when there is room or if we need to evict. v2: add missing TTM_PL_FLAG_IDLE for i915 Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 11 +- drivers/gpu/drm/drm_gem_vram_helper.c | 2 - drivers/gpu/drm/i915/gem/i915_gem_ttm.c| 37 +++ drivers/gpu/drm/nouveau/nouveau_bo.c | 59 -- drivers/gpu/drm/nouveau/nouveau_bo.h | 1 - drivers/gpu/drm/qxl/qxl_object.c | 2 - drivers/gpu/drm/qxl/qxl_ttm.c | 2 - drivers/gpu/drm/radeon/radeon_object.c | 2 - drivers/gpu/drm/radeon/radeon_ttm.c| 8 +- drivers/gpu/drm/radeon/radeon_uvd.c| 1 - drivers/gpu/drm/ttm/ttm_bo.c | 21 ++-- drivers/gpu/drm/ttm/ttm_resource.c | 73 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 - drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 121 ++--- include/drm/ttm/ttm_placement.h| 10 +- include/drm/ttm/ttm_resource.h | 8 +- 17 files changed, 135 insertions(+), 231 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 25a68de0..9c594607109c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -201,9 +201,6 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) placement->num_placement = c; placement->placement = places; - - placement->num_busy_placement = c; - placement->busy_placement = places; } /** @@ -1369,8 +1366,7 @@ vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) AMDGPU_GEM_DOMAIN_GTT); /* Avoid costly evictions; only set GTT as a busy placement */ - abo->placement.num_busy_placement = 1; - abo->placement.busy_placement = &abo->placements[1]; + abo->placements[0].flags |= TTM_PL_FLAG_IDLE; r = ttm_bo_validate(bo, &abo->placement, &ctx); if (unlikely(r == -EBUSY || r == -ERESTARTSYS)) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 2cd081cbf706..e7d6b7d1d393 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -104,23 +104,19 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, /* Don't handle scatter gather BOs */ if (bo->type == ttm_bo_type_sg) { placement->num_placement = 0; - placement->num_busy_placement = 0; return; } /* Object isn't an AMDGPU object so ignore */ if (!amdgpu_bo_is_amdgpu_bo(bo)) { placement->placement = &placements; - placement->busy_placement = &placements; placement->num_placement = 1; - placement->num_busy_placement = 1; return; } abo = ttm_to_amdgpu_bo(bo); if (abo->flags & AMDGPU_GEM_CREATE_DISCARDABLE) { placement->num_placement = 0; - placement->num_busy_placement = 0; return; } @@ -129,13 +125,13 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, case AMDGPU_PL_GWS: case AMDGPU_PL_OA: placement->num_placement = 0; - placement->num_busy_placement = 0; return; case TTM_PL_VRAM: if (!adev->mman.buffer_funcs_enabled) { /* Move to system memory */ amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU); + } else if (!amdgpu_gmc_vram_full_visible(&adev->gmc) && !(abo->flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) && amdgpu_bo_in_cpu_visible_vram(abo)) { @@ -150,8 +146,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, AMDGPU_GEM_DOMAIN_CPU); abo->placements[0].fpfn = adev->gmc.visible_vram_size >> PAGE_SHIFT; abo->placements[0].lpfn = 0; - abo->placement.busy_placement = &abo->placements[1]; - abo->placement.num_busy_placement = 1; + abo->placements[0].flags |= TTM_PL_FLAG_IDLE; } else { /* Move to GTT memory */ amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT | @@ -930,8 +925,6 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo) /* allocate GART space */ placement.num_placement = 1; placement.placement = &placements; - placement.num_busy_placement = 1; - placement.busy_placement = &plac
[Intel-gfx] [PATCH 4/5] drm/ttm: prevent moving of pinned BOs
We have checks for this in the individual drivers move callback, but it's probably better to generally forbit that on a higher level. Also stops exporting ttm_resource_compat() since that's not necessary any more after removing the extra checks in vmwgfx. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 drivers/gpu/drm/nouveau/nouveau_bo.c| 3 --- drivers/gpu/drm/radeon/radeon_ttm.c | 4 drivers/gpu/drm/ttm/ttm_bo.c| 20 drivers/gpu/drm/ttm/ttm_resource.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 19 ++- 6 files changed, 14 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index c5ef7f7bdc15..2cd081cbf706 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -466,11 +466,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, return r; } - /* Can't move a pinned BO */ abo = ttm_to_amdgpu_bo(bo); - if (WARN_ON_ONCE(abo->tbo.pin_count > 0)) - return -EINVAL; - adev = amdgpu_ttm_adev(bo->bdev); if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM && diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 288eebc70a67..c2ec91cc845d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1015,9 +1015,6 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, if (ret) goto out_ntfy; - if (nvbo->bo.pin_count) - NV_WARN(drm, "Moving pinned object %p!\n", nvbo); - if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) { ret = nouveau_bo_vm_bind(bo, new_reg, &new_tile); if (ret) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 1e8e287e113c..67075c85f847 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -211,11 +211,7 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, if (r) return r; - /* Can't move a pinned BO */ rbo = container_of(bo, struct radeon_bo, tbo); - if (WARN_ON_ONCE(rbo->tbo.pin_count > 0)) - return -EINVAL; - rdev = radeon_get_rdev(bo->bdev); if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { ttm_bo_move_null(bo, new_mem); diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index bb0c21c8caac..33471e363ff4 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -894,14 +894,18 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, if (!placement->num_placement && !placement->num_busy_placement) return ttm_bo_pipeline_gutting(bo); - /* -* Check whether we need to move buffer. -*/ - if (!bo->resource || !ttm_resource_compat(bo->resource, placement)) { - ret = ttm_bo_move_buffer(bo, placement, ctx); - if (ret) - return ret; - } + /* Check whether we need to move buffer. */ + if (bo->resource && ttm_resource_compat(bo->resource, placement)) + return 0; + + /* Moving of pinned BOs is forbidden */ + if (bo->pin_count) + return -EINVAL; + + ret = ttm_bo_move_buffer(bo, placement, ctx); + if (ret) + return ret; + /* * We might need to add a TTM. */ diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c index b8a826a24fb2..7333f7a87a2f 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -361,7 +361,6 @@ bool ttm_resource_compat(struct ttm_resource *res, return false; } -EXPORT_SYMBOL(ttm_resource_compat); void ttm_resource_set_bo(struct ttm_resource *res, struct ttm_buffer_object *bo) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c index aa1cd5126a32..9bf1f9d2f9b6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c @@ -87,12 +87,7 @@ int vmw_bo_pin_in_placement(struct vmw_private *dev_priv, if (unlikely(ret != 0)) goto err; - if (buf->base.pin_count > 0) - ret = ttm_resource_compat(bo->resource, placement) - ? 0 : -EINVAL; - else - ret = ttm_bo_validate(bo, placement, &ctx); - + ret = ttm_bo_validate(bo, placement, &ctx); if (!ret) vmw_bo_pin_reserved(buf, true); @@ -128,12 +123,6 @@ int vmw_bo_pin_in_vram_or_gmr(struct vmw_private *dev_priv, if (unlikely(ret != 0)) goto err; - if (buf->base.pin_count > 0)
[Intel-gfx] [PATCH 2/5] drm/ttm: stop allocating dummy resources during BO creation
That should not be necessary any more when drivers should at least be able to handle the move without a resource. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 326a3d13a829..bb0c21c8caac 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -953,7 +953,6 @@ int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo, struct sg_table *sg, struct dma_resv *resv, void (*destroy) (struct ttm_buffer_object *)) { - static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM }; int ret; kref_init(&bo->kref); @@ -970,12 +969,6 @@ int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo, bo->base.resv = &bo->base._resv; atomic_inc(&ttm_glob.bo_count); - ret = ttm_resource_alloc(bo, &sys_mem, &bo->resource); - if (unlikely(ret)) { - ttm_bo_put(bo); - return ret; - } - /* * For ttm_bo_type_device buffers, allocate * address space from the device. -- 2.34.1
Re: [Intel-gfx] [PATCH 3/3] drm/connector: move ELD and video/audio latencies to display info
Hi Jani, I love your patch! Yet something to improve: [auto build test ERROR on drm-tip/drm-tip] url: https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-connector-move-HDR-sink-metadata-to-display-info/20230124-174322 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip patch link: https://lore.kernel.org/r/20230124094154.2282778-3-jani.nikula%40intel.com patch subject: [Intel-gfx] [PATCH 3/3] drm/connector: move ELD and video/audio latencies to display info config: hexagon-randconfig-r045-20230123 (https://download.01.org/0day-ci/archive/20230124/202301242053.vcyjqiue-...@intel.com/config) compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 4196ca3278f78c6e19246e54ab0ecb364e37d66a) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/1e92b5478cfc1b0df6615365217e9548b0d5 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jani-Nikula/drm-connector-move-HDR-sink-metadata-to-display-info/20230124-174322 git checkout 1e92b5478cfc1b0df6615365217e9548b0d5 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/gpu/drm/bridge/ drivers/gpu/drm/i2c/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from drivers/gpu/drm/bridge/sii902x.c:17: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from drivers/gpu/drm/bridge/sii902x.c:17: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from drivers/gpu/drm/bridge/sii902x.c:17: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/
[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/psr: PSR related workarounds (rev2)
== Series Details == Series: drm/i915/psr: PSR related workarounds (rev2) URL : https://patchwork.freedesktop.org/series/113002/ State : warning == Summary == Error: dim sparse failed Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. +./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit' +./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return' +./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return' +drivers/gpu/drm/i915/display/intel_display_types.h:1838:17: warning: unreplaced symbol 'encoder' +drivers/gpu/drm/i915/display/intel_display_types.h:1838:9: warning: unreplaced symbol 'break' +drivers/gpu/drm/i915/display/intel_display_types.h:1838:9: warning: unreplaced symbol 'case' +drivers/gpu/drm/i915/display/intel_display_types.h:1839:9: warning: too many warnings +drivers/gpu/drm/i915/display/intel_display_types.h:1839:9: warning: unreplaced symbol '' +drivers/gpu/drm/i915/display/intel_display_types.h:1840:9: warning: unreplaced symbol '' +drivers/gpu/drm/i915/display/intel_display_types.h:1841:9: warning: unreplaced symbol '' +drivers/gpu/drm/i915/display/intel_display_types.h:1842:9: warning: unreplaced symbol '' +drivers/gpu/drm/i915/display/intel_display_types.h:1843:17: warning: unreplaced symbol 'return' +drivers/gpu/drm/i915/display/intel_display_types.h:1844:9: warning: unreplaced symbol '' +drivers/gpu/drm/i915/display/intel_display_types.h:1845:17: warning: unreplaced symbol 'return' +drivers/gpu/drm/i915/display/intel_display_types.h:1864:9: warning: unreplaced symbol 'intel_encoder' +drivers/gpu/drm/i915/display/intel_display_types.h:1911:24: warning: trying to copy expression type 31 +drivers/gpu/drm/i915/display/intel_display_types.h:1911:24: warning: trying to copy expression type 31 +./drivers/gpu/drm/i915/intel_uncore.h:351:1: warning: trying to copy expression type 31 +./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old' +./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask' +./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return' +./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return' +./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask' +./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p' +./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old' +./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p' +./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old' +./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask' +./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old' +./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask' +./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return' +./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return' +./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return' +./include/asm-generic/bitops/generic-non-atomic.h:166:1: warning: unreplaced symbol 'return' +./include/asm-generic/bitops/generic-non-atomic.h:168:9: warning: unreplaced symbol 'p' +./include/asm-generic/bitops/generic-non-atomic.h:169:9: warning: unreplaced symbol 'mask' +./include/asm-generic/bitops/generic-non-atomic.h:170:9: warning: unreplaced symbol 'val' +
[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/psr: PSR related workarounds (rev2)
== Series Details == Series: drm/i915/psr: PSR related workarounds (rev2) URL : https://patchwork.freedesktop.org/series/113002/ State : failure == Summary == CI Bug Log - changes from CI_DRM_12627 -> Patchwork_113002v2 Summary --- **FAILURE** Serious unknown changes coming with Patchwork_113002v2 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in Patchwork_113002v2, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/index.html Participating hosts (41 -> 38) -- Missing(3): fi-bsw-kefka fi-tgl-dsi fi-snb-2520m Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_113002v2: ### IGT changes ### Possible regressions * igt@i915_selftest@live@execlists: - fi-kbl-soraka: [PASS][1] -> [INCOMPLETE][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/fi-kbl-soraka/igt@i915_selftest@l...@execlists.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/fi-kbl-soraka/igt@i915_selftest@l...@execlists.html Suppressed The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@gem_exec_suspend@basic-s0@lmem0: - {bat-dg2-11}: [PASS][3] -> [INCOMPLETE][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-dg2-11/igt@gem_exec_suspend@basic...@lmem0.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/bat-dg2-11/igt@gem_exec_suspend@basic...@lmem0.html Known issues Here are the changes found in Patchwork_113002v2 that come from known issues: ### IGT changes ### Issues hit * igt@gem_exec_gttfill@basic: - fi-pnv-d510:[PASS][5] -> [FAIL][6] ([i915#7229]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/fi-pnv-d510/igt@gem_exec_gttf...@basic.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/fi-pnv-d510/igt@gem_exec_gttf...@basic.html * igt@i915_module_load@load: - fi-ctg-p8600: [PASS][7] -> [DMESG-WARN][8] ([i915#6020]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/fi-ctg-p8600/igt@i915_module_l...@load.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/fi-ctg-p8600/igt@i915_module_l...@load.html Possible fixes * igt@i915_selftest@live@hangcheck: - {bat-dg1-7}:[INCOMPLETE][9] ([i915#4983]) -> [PASS][10] [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/bat-dg1-7/igt@i915_selftest@l...@hangcheck.html * igt@i915_selftest@live@migrate: - {bat-dg2-11}: [DMESG-WARN][11] ([i915#7699]) -> [PASS][12] [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-dg2-11/igt@i915_selftest@l...@migrate.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/bat-dg2-11/igt@i915_selftest@l...@migrate.html * igt@i915_selftest@live@reset: - {bat-rpls-1}: [DMESG-FAIL][13] ([i915#4983]) -> [PASS][14] [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/bat-rpls-1/igt@i915_selftest@l...@reset.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113002v2/bat-rpls-1/igt@i915_selftest@l...@reset.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867 [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078 [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312 [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983 [i915#6020]: https://gitlab.freedesktop.org/drm/intel/issues/6020 [i915#6257]: https://gitlab.freedesktop.org/drm/intel/issues/6257 [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367 [i915#7077]: https://gitlab.freedesktop.org/drm/intel/issues/7077 [i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229 [i915#7359]: https://gitlab.freedesktop.org/drm/intel/issues/7359 [i915#7625]: https://gitlab.freedesktop.org/drm/intel/issues/7625 [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699 [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828 Build changes - * Linux: CI_DRM_12627 -> Patchwork_113002v2 CI-20190529: 20190529 CI_DRM_12627: a89114c496133077159d90f4ffc0ab3a5e6e89c0 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_7136: 31b6af91747ad8c705399c9006cdb81cb1864146 @ https://gitlab.freedesktop.org/drm/igt-gp
[Intel-gfx] [PATCH v2 00/10] drm/fb-helper: Various cleanups
Add various cleanups and changes to DRM's fbdev helpers and the generic fbdev emulation. There's no clear theme here, just lots of small things that need to be updated. In the end, the code will better reflect which parts are in the DRM client, which is fbdev emulation, and which are shared fbdev helpers. v2: * cleanups in drm_fbdev_fb_destroy() (Sam) * fix declaration of drm_fb_helper_unprepare() Thomas Zimmermann (10): drm/client: Test for connectors before sending hotplug event drm/client: Add hotplug_failed flag drm/fb-helper: Introduce drm_fb_helper_unprepare() drm/fbdev-generic: Initialize fb-helper structure in generic setup drm/fb-helper: Remove preferred_bpp parameter from fbdev internals drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function drm/fbdev-generic: Minimize hotplug error handling drm/fbdev-generic: Minimize client unregistering drm/fbdev-generic: Inline clean-up helpers into drm_fbdev_fb_destroy() drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info' drivers/gpu/drm/armada/armada_fbdev.c | 4 +- drivers/gpu/drm/drm_client.c | 10 ++ drivers/gpu/drm/drm_fb_helper.c| 58 ++--- drivers/gpu/drm/drm_fbdev_generic.c| 131 - drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 4 +- drivers/gpu/drm/gma500/framebuffer.c | 4 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +- drivers/gpu/drm/msm/msm_fbdev.c| 4 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 4 +- drivers/gpu/drm/radeon/radeon_fb.c | 4 +- drivers/gpu/drm/tegra/fb.c | 7 +- include/drm/drm_client.h | 8 ++ include/drm/drm_fb_helper.h| 8 +- 13 files changed, 134 insertions(+), 123 deletions(-) base-commit: 7d3e7f64a42d66ba8da6e7b66a8d85457ef84570 -- 2.39.0
[Intel-gfx] [PATCH v2 01/10] drm/client: Test for connectors before sending hotplug event
Test for connectors in the client code and remove a similar test from the generic fbdev emulation. Do nothing if the test fails. Not having connectors indicates a driver bug. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_client.c| 5 + drivers/gpu/drm/drm_fbdev_generic.c | 5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index 262ec64d4397..09ac191c202d 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -198,6 +198,11 @@ void drm_client_dev_hotplug(struct drm_device *dev) if (!drm_core_check_feature(dev, DRIVER_MODESET)) return; + if (!dev->mode_config.num_connector) { + drm_dbg_kms(dev, "No connectors found, will not send hotplug events!\n"); + return; + } + mutex_lock(&dev->clientlist_mutex); list_for_each_entry(client, &dev->clientlist, list) { if (!client->funcs || !client->funcs->hotplug) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 0a4c160e0e58..3d455a2e3fb5 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -389,11 +389,6 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client) if (dev->fb_helper) return drm_fb_helper_hotplug_event(dev->fb_helper); - if (!dev->mode_config.num_connector) { - drm_dbg_kms(dev, "No connectors found, will not create framebuffer!\n"); - return 0; - } - drm_fb_helper_prepare(dev, fb_helper, &drm_fb_helper_generic_funcs); ret = drm_fb_helper_init(dev, fb_helper); -- 2.39.0
[Intel-gfx] [PATCH v2 02/10] drm/client: Add hotplug_failed flag
Signal failed hotplugging with a flag in struct drm_client_dev. If set, the client helpers will not further try to set up the fbdev display. This used to be signalled with a combination of cleared pointers in struct drm_fb_helper, which prevents us from initializing these pointers early after allocation. The change also harmonizes behavior among DRM clients. Additional DRM clients will now handle failed hotplugging like fbdev does. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_client.c| 5 + drivers/gpu/drm/drm_fbdev_generic.c | 4 include/drm/drm_client.h| 8 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index 09ac191c202d..009e7b10455c 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -208,8 +208,13 @@ void drm_client_dev_hotplug(struct drm_device *dev) if (!client->funcs || !client->funcs->hotplug) continue; + if (client->hotplug_failed) + continue; + ret = client->funcs->hotplug(client); drm_dbg_kms(dev, "%s: ret=%d\n", client->name, ret); + if (ret) + client->hotplug_failed = true; } mutex_unlock(&dev->clientlist_mutex); } diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 3d455a2e3fb5..135d58b8007b 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -382,10 +382,6 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client) struct drm_device *dev = client->dev; int ret; - /* Setup is not retried if it has failed */ - if (!fb_helper->dev && fb_helper->funcs) - return 0; - if (dev->fb_helper) return drm_fb_helper_hotplug_event(dev->fb_helper); diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h index 4fc8018eddda..39482527a775 100644 --- a/include/drm/drm_client.h +++ b/include/drm/drm_client.h @@ -106,6 +106,14 @@ struct drm_client_dev { * @modesets: CRTC configurations */ struct drm_mode_set *modesets; + + /** +* @hotplug failed: +* +* Set by client hotplug helpers if the hotplugging failed +* before. It is usually not tried again. +*/ + bool hotplug_failed; }; int drm_client_init(struct drm_device *dev, struct drm_client_dev *client, -- 2.39.0
[Intel-gfx] [PATCH v2 06/10] drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function
Initialize the fb-helper's preferred_bpp field early from within drm_fb_helper_prepare(); instead of the later client hot-plugging callback. This simplifies the generic fbdev setup function. No real changes, but all drivers' fbdev code has to be adapted. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/armada/armada_fbdev.c | 4 ++-- drivers/gpu/drm/drm_fb_helper.c| 22 ++ drivers/gpu/drm/drm_fbdev_generic.c| 19 ++- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 4 ++-- drivers/gpu/drm/gma500/framebuffer.c | 4 ++-- drivers/gpu/drm/i915/display/intel_fbdev.c | 11 ++- drivers/gpu/drm/msm/msm_fbdev.c| 4 ++-- drivers/gpu/drm/omapdrm/omap_fbdev.c | 4 ++-- drivers/gpu/drm/radeon/radeon_fb.c | 4 ++-- drivers/gpu/drm/tegra/fb.c | 7 +++ include/drm/drm_fb_helper.h| 3 ++- 11 files changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index 584cee123bd8..07e410c62b7a 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -129,7 +129,7 @@ int armada_fbdev_init(struct drm_device *dev) priv->fbdev = fbh; - drm_fb_helper_prepare(dev, fbh, &armada_fb_helper_funcs); + drm_fb_helper_prepare(dev, fbh, 32, &armada_fb_helper_funcs); ret = drm_fb_helper_init(dev, fbh); if (ret) { @@ -137,7 +137,7 @@ int armada_fbdev_init(struct drm_device *dev) goto err_fb_helper; } - ret = drm_fb_helper_initial_config(fbh, 32); + ret = drm_fb_helper_initial_config(fbh); if (ret) { DRM_ERROR("failed to set initial config\n"); goto err_fb_setup; diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 258103d317ac..28c428e9c530 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -416,14 +416,30 @@ static void drm_fb_helper_damage_work(struct work_struct *work) * drm_fb_helper_prepare - setup a drm_fb_helper structure * @dev: DRM device * @helper: driver-allocated fbdev helper structure to set up + * @preferred_bpp: Preferred bits per pixel for the device. * @funcs: pointer to structure of functions associate with this helper * * Sets up the bare minimum to make the framebuffer helper usable. This is * useful to implement race-free initialization of the polling helpers. */ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, + unsigned int preferred_bpp, const struct drm_fb_helper_funcs *funcs) { + /* +* Pick a preferred bpp of 32 if no value has been given. This +* will select XRGB for the framebuffer formats. All drivers +* have to support XRGB for backwards compatibility with legacy +* userspace, so it's the safe choice here. +* +* TODO: Replace struct drm_mode_config.preferred_depth and this +* bpp value with a preferred format that is given as struct +* drm_format_info. Then derive all other values from the +* format. +*/ + if (!preferred_bpp) + preferred_bpp = 32; + INIT_LIST_HEAD(&helper->kernel_fb_list); spin_lock_init(&helper->damage_lock); INIT_WORK(&helper->resume_work, drm_fb_helper_resume_worker); @@ -432,6 +448,7 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, mutex_init(&helper->lock); helper->funcs = funcs; helper->dev = dev; + helper->preferred_bpp = preferred_bpp; } EXPORT_SYMBOL(drm_fb_helper_prepare); @@ -2183,7 +2200,6 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper) /** * drm_fb_helper_initial_config - setup a sane initial connector configuration * @fb_helper: fb_helper device struct - * @bpp_sel: bpp value to use for the framebuffer configuration * * Scans the CRTCs and connectors and tries to put together an initial setup. * At the moment, this is a cloned configuration across all heads with @@ -2221,15 +2237,13 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper) * RETURNS: * Zero if everything went ok, nonzero otherwise. */ -int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) +int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper) { int ret; if (!drm_fbdev_emulation) return 0; - fb_helper->preferred_bpp = bpp_sel; - mutex_lock(&fb_helper->lock); ret = __drm_fb_helper_initial_config_and_unlock(fb_helper); diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 63f66325a8a5..6ae014040df3 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++
[Intel-gfx] [PATCH v2 03/10] drm/fb-helper: Introduce drm_fb_helper_unprepare()
Move the fb-helper clean-up code into drm_fb_helper_unprepare(). No functional changes. v2: * declare as static inline (kernel test robot) Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 14 +- include/drm/drm_fb_helper.h | 5 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index c5c13e192b64..4379bcd7718b 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -435,6 +435,18 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, } EXPORT_SYMBOL(drm_fb_helper_prepare); +/** + * drm_fb_helper_unprepare - clean up a drm_fb_helper structure + * @fb_helper: driver-allocated fbdev helper structure to set up + * + * Cleans up the framebuffer helper. Inverse of drm_fb_helper_prepare(). + */ +void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper) +{ + mutex_destroy(&fb_helper->lock); +} +EXPORT_SYMBOL(drm_fb_helper_unprepare); + /** * drm_fb_helper_init - initialize a &struct drm_fb_helper * @dev: drm device @@ -561,7 +573,7 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) } mutex_unlock(&kernel_fb_helper_lock); - mutex_destroy(&fb_helper->lock); + drm_fb_helper_unprepare(fb_helper); if (!fb_helper->client.funcs) drm_client_release(&fb_helper->client); diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index f443e1f11654..39710c570a04 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -230,6 +230,7 @@ drm_fb_helper_from_client(struct drm_client_dev *client) #ifdef CONFIG_DRM_FBDEV_EMULATION void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, const struct drm_fb_helper_funcs *funcs); +void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper); int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper); void drm_fb_helper_fini(struct drm_fb_helper *helper); int drm_fb_helper_blank(int blank, struct fb_info *info); @@ -296,6 +297,10 @@ static inline void drm_fb_helper_prepare(struct drm_device *dev, { } +static inline void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper) +{ +} + static inline int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper) { -- 2.39.0
[Intel-gfx] [PATCH v2 09/10] drm/fbdev-generic: Inline clean-up helpers into drm_fbdev_fb_destroy()
The fbdev framebuffer cleanup in drm_fbdev_fb_destroy() calls drm_fbdev_release() and drm_fbdev_cleanup(). Inline both into the caller. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 9fe37903e3eb..13b31a95d434 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -43,8 +43,9 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user) return 0; } -static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) +static void drm_fbdev_fb_destroy(struct fb_info *info) { + struct drm_fb_helper *fb_helper = info->par; struct fb_info *fbi = fb_helper->info; void *shadow = NULL; @@ -64,24 +65,10 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) drm_client_buffer_vunmap(fb_helper->buffer); drm_client_framebuffer_delete(fb_helper->buffer); -} - -static void drm_fbdev_release(struct drm_fb_helper *fb_helper) -{ - drm_fbdev_cleanup(fb_helper); drm_client_release(&fb_helper->client); kfree(fb_helper); } -/* - * fb_ops.fb_destroy is called by the last put_fb_info() call at the end of - * unregister_framebuffer() or fb_release(). - */ -static void drm_fbdev_fb_destroy(struct fb_info *info) -{ - drm_fbdev_release(info->par); -} - static int drm_fbdev_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) { struct drm_fb_helper *fb_helper = info->par; -- 2.39.0
[Intel-gfx] [PATCH v2 08/10] drm/fbdev-generic: Minimize client unregistering
For uninitialized framebuffers, only release the DRM client and free the fbdev memory. Do not attempt to clean up the framebuffer. DRM fbdev clients have a two-step initialization: first create the DRM client; then create the framebuffer device on the first successful hotplug event. In cases where the client never creates the framebuffer, only the client state needs to be released. We can detect which case it is, full or client-only cleanup, be looking at the presence of fb_helper's info field. v2: * remove test for (fbi != NULL) in drm_fbdev_cleanup() (Sam) Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index dd8be5e0f271..9fe37903e3eb 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -51,12 +51,10 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) if (!fb_helper->dev) return; - if (fbi) { - if (fbi->fbdefio) - fb_deferred_io_cleanup(fbi); - if (drm_fbdev_use_shadow_fb(fb_helper)) - shadow = fbi->screen_buffer; - } + if (fbi->fbdefio) + fb_deferred_io_cleanup(fbi); + if (drm_fbdev_use_shadow_fb(fb_helper)) + shadow = fbi->screen_buffer; drm_fb_helper_fini(fb_helper); @@ -362,11 +360,13 @@ static void drm_fbdev_client_unregister(struct drm_client_dev *client) { struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); - if (fb_helper->info) - /* drm_fbdev_fb_destroy() takes care of cleanup */ + if (fb_helper->info) { drm_fb_helper_unregister_info(fb_helper); - else - drm_fbdev_release(fb_helper); + } else { + drm_fb_helper_unprepare(fb_helper); + drm_client_release(&fb_helper->client); + kfree(fb_helper); + } } static int drm_fbdev_client_restore(struct drm_client_dev *client) -- 2.39.0
[Intel-gfx] [PATCH v2 04/10] drm/fbdev-generic: Initialize fb-helper structure in generic setup
Initialize the fb-helper structure immediately after its allocation in drm_fbdev_generic_setup(). That will make it easier to fill it with driver-specific values, such as the preferred BPP. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 135d58b8007b..63f66325a8a5 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -385,8 +385,6 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client) if (dev->fb_helper) return drm_fb_helper_hotplug_event(dev->fb_helper); - drm_fb_helper_prepare(dev, fb_helper, &drm_fb_helper_generic_funcs); - ret = drm_fb_helper_init(dev, fb_helper); if (ret) goto err; @@ -456,12 +454,12 @@ void drm_fbdev_generic_setup(struct drm_device *dev, fb_helper = kzalloc(sizeof(*fb_helper), GFP_KERNEL); if (!fb_helper) return; + drm_fb_helper_prepare(dev, fb_helper, &drm_fb_helper_generic_funcs); ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs); if (ret) { - kfree(fb_helper); drm_err(dev, "Failed to register client: %d\n", ret); - return; + goto err_drm_client_init; } /* @@ -484,5 +482,12 @@ void drm_fbdev_generic_setup(struct drm_device *dev, drm_dbg_kms(dev, "client hotplug ret=%d\n", ret); drm_client_register(&fb_helper->client); + + return; + +err_drm_client_init: + drm_fb_helper_unprepare(fb_helper); + kfree(fb_helper); + return; } EXPORT_SYMBOL(drm_fbdev_generic_setup); -- 2.39.0
[Intel-gfx] [PATCH v2 10/10] drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info'
The generic fbdev emulation names variables of type struct fb_info both 'fbi' and 'info'. The latter seems to be more common in fbdev code, so name fbi accordingly. Also replace the duplicate variable in drm_fbdev_fb_destroy(). Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 47 ++--- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 13b31a95d434..b6565c1e3531 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -46,16 +46,15 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user) static void drm_fbdev_fb_destroy(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - struct fb_info *fbi = fb_helper->info; void *shadow = NULL; if (!fb_helper->dev) return; - if (fbi->fbdefio) - fb_deferred_io_cleanup(fbi); + if (info->fbdefio) + fb_deferred_io_cleanup(info); if (drm_fbdev_use_shadow_fb(fb_helper)) - shadow = fbi->screen_buffer; + shadow = info->screen_buffer; drm_fb_helper_fini(fb_helper); @@ -171,7 +170,7 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper, struct drm_device *dev = fb_helper->dev; struct drm_client_buffer *buffer; struct drm_framebuffer *fb; - struct fb_info *fbi; + struct fb_info *info; u32 format; struct iosys_map map; int ret; @@ -190,35 +189,35 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper, fb_helper->fb = buffer->fb; fb = buffer->fb; - fbi = drm_fb_helper_alloc_info(fb_helper); - if (IS_ERR(fbi)) - return PTR_ERR(fbi); + info = drm_fb_helper_alloc_info(fb_helper); + if (IS_ERR(info)) + return PTR_ERR(info); - fbi->fbops = &drm_fbdev_fb_ops; - fbi->screen_size = sizes->surface_height * fb->pitches[0]; - fbi->fix.smem_len = fbi->screen_size; - fbi->flags = FBINFO_DEFAULT; + info->fbops = &drm_fbdev_fb_ops; + info->screen_size = sizes->surface_height * fb->pitches[0]; + info->fix.smem_len = info->screen_size; + info->flags = FBINFO_DEFAULT; - drm_fb_helper_fill_info(fbi, fb_helper, sizes); + drm_fb_helper_fill_info(info, fb_helper, sizes); if (drm_fbdev_use_shadow_fb(fb_helper)) { - fbi->screen_buffer = vzalloc(fbi->screen_size); - if (!fbi->screen_buffer) + info->screen_buffer = vzalloc(info->screen_size); + if (!info->screen_buffer) return -ENOMEM; - fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST; + info->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST; - fbi->fbdefio = &drm_fbdev_defio; - fb_deferred_io_init(fbi); + info->fbdefio = &drm_fbdev_defio; + fb_deferred_io_init(info); } else { /* buffer is mapped for HW framebuffer */ ret = drm_client_buffer_vmap(fb_helper->buffer, &map); if (ret) return ret; if (map.is_iomem) { - fbi->screen_base = map.vaddr_iomem; + info->screen_base = map.vaddr_iomem; } else { - fbi->screen_buffer = map.vaddr; - fbi->flags |= FBINFO_VIRTFB; + info->screen_buffer = map.vaddr; + info->flags |= FBINFO_VIRTFB; } /* @@ -227,10 +226,10 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper, * case. */ #if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM) - if (fb_helper->hint_leak_smem_start && fbi->fix.smem_start == 0 && + if (fb_helper->hint_leak_smem_start && info->fix.smem_start == 0 && !drm_WARN_ON_ONCE(dev, map.is_iomem)) - fbi->fix.smem_start = - page_to_phys(virt_to_page(fbi->screen_buffer)); + info->fix.smem_start = + page_to_phys(virt_to_page(info->screen_buffer)); #endif } -- 2.39.0
[Intel-gfx] [PATCH v2 05/10] drm/fb-helper: Remove preferred_bpp parameter from fbdev internals
Store the console's preferred BPP value in struct drm_fb_helper and remove the respective function parameters from the internal fbdev code. The BPP value is only required as a fallback and will now always be available in the fb-helper instance. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 4379bcd7718b..258103d317ac 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1786,7 +1786,7 @@ static uint32_t drm_fb_helper_find_color_mode_format(struct drm_fb_helper *fb_he return drm_fb_helper_find_format(fb_helper, formats, format_count, bpp, depth); } -static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, int preferred_bpp, +static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { struct drm_client_dev *client = &fb_helper->client; @@ -1831,7 +1831,7 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, int prefe surface_format = drm_fb_helper_find_color_mode_format(fb_helper, plane->format_types, plane->format_count, - preferred_bpp); + fb_helper->preferred_bpp); if (surface_format != DRM_FORMAT_INVALID) break; /* found supported format */ } @@ -1903,7 +1903,7 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, int prefe return 0; } -static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, int preferred_bpp, +static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes) { struct drm_client_dev *client = &fb_helper->client; @@ -1912,7 +1912,7 @@ static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, int preferr int ret; mutex_lock(&client->modeset_mutex); - ret = __drm_fb_helper_find_sizes(fb_helper, preferred_bpp, sizes); + ret = __drm_fb_helper_find_sizes(fb_helper, sizes); mutex_unlock(&client->modeset_mutex); if (ret) @@ -1934,15 +1934,14 @@ static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper, int preferr * Allocates the backing storage and sets up the fbdev info structure through * the ->fb_probe callback. */ -static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, -int preferred_bpp) +static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper) { struct drm_client_dev *client = &fb_helper->client; struct drm_device *dev = fb_helper->dev; struct drm_fb_helper_surface_size sizes; int ret; - ret = drm_fb_helper_find_sizes(fb_helper, preferred_bpp, &sizes); + ret = drm_fb_helper_find_sizes(fb_helper, &sizes); if (ret) { /* First time: disable all crtc's.. */ if (!fb_helper->deferred_setup) @@ -2125,8 +2124,7 @@ static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper) /* Note: Drops fb_helper->lock before returning. */ static int -__drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper, - int bpp_sel) +__drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper) { struct drm_device *dev = fb_helper->dev; struct fb_info *info; @@ -2137,10 +2135,9 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper, height = dev->mode_config.max_height; drm_client_modeset_probe(&fb_helper->client, width, height); - ret = drm_fb_helper_single_fb_probe(fb_helper, bpp_sel); + ret = drm_fb_helper_single_fb_probe(fb_helper); if (ret < 0) { if (ret == -EAGAIN) { - fb_helper->preferred_bpp = bpp_sel; fb_helper->deferred_setup = true; ret = 0; } @@ -2231,8 +2228,10 @@ int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) if (!drm_fbdev_emulation) return 0; + fb_helper->preferred_bpp = bpp_sel; + mutex_lock(&fb_helper->lock); - ret = __drm_fb_helper_initial_config_and_unlock(fb_helper, bpp_sel); + ret = __drm_fb_helper_initial_config_and_unlock(fb_helper); return ret; } @@ -2268,8 +2267,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) mutex
[Intel-gfx] [PATCH v2 07/10] drm/fbdev-generic: Minimize hotplug error handling
Call drm_fb_helper_init() in the generic-fbdev hotplug helper to revert the effects of drm_fb_helper_init(). No full cleanup is required. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 6ae014040df3..dd8be5e0f271 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -387,25 +387,21 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client) ret = drm_fb_helper_init(dev, fb_helper); if (ret) - goto err; + goto err_drm_err; if (!drm_drv_uses_atomic_modeset(dev)) drm_helper_disable_unused_functions(dev); ret = drm_fb_helper_initial_config(fb_helper); if (ret) - goto err_cleanup; + goto err_drm_fb_helper_fini; return 0; -err_cleanup: - drm_fbdev_cleanup(fb_helper); -err: - fb_helper->dev = NULL; - fb_helper->info = NULL; - +err_drm_fb_helper_fini: + drm_fb_helper_fini(fb_helper); +err_drm_err: drm_err(dev, "fbdev: Failed to setup generic emulation (ret=%d)\n", ret); - return ret; } -- 2.39.0
Re: [Intel-gfx] [PATCH v3 1/2] drm/probe_helper: extract two helper functions
On Tue, 24 Jan 2023, Dmitry Baryshkov wrote: > Extract drm_kms_helper_enable_hpd() and drm_kms_helper_disable_hpd(), > two helpers that enable and disable HPD handling on all device's > connectors. Thanks for separating this, it makes the other patch easier to read. Reviewed-by: Jani Nikula > > Signed-off-by: Dmitry Baryshkov > --- > drivers/gpu/drm/drm_probe_helper.c | 68 ++ > 1 file changed, 41 insertions(+), 27 deletions(-) > > diff --git a/drivers/gpu/drm/drm_probe_helper.c > b/drivers/gpu/drm/drm_probe_helper.c > index 95aeeed33cf5..ab787d71fa66 100644 > --- a/drivers/gpu/drm/drm_probe_helper.c > +++ b/drivers/gpu/drm/drm_probe_helper.c > @@ -222,6 +222,45 @@ drm_connector_mode_valid(struct drm_connector *connector, > return ret; > } > > +static void drm_kms_helper_disable_hpd(struct drm_device *dev) > +{ > + struct drm_connector *connector; > + struct drm_connector_list_iter conn_iter; > + > + drm_connector_list_iter_begin(dev, &conn_iter); > + drm_for_each_connector_iter(connector, &conn_iter) { > + const struct drm_connector_helper_funcs *funcs = > + connector->helper_private; > + > + if (funcs && funcs->disable_hpd) > + funcs->disable_hpd(connector); > + } > + drm_connector_list_iter_end(&conn_iter); > +} > + > +static bool drm_kms_helper_enable_hpd(struct drm_device *dev) > +{ > + bool poll = false; > + struct drm_connector *connector; > + struct drm_connector_list_iter conn_iter; > + > + drm_connector_list_iter_begin(dev, &conn_iter); > + drm_for_each_connector_iter(connector, &conn_iter) { > + const struct drm_connector_helper_funcs *funcs = > + connector->helper_private; > + > + if (funcs && funcs->enable_hpd) > + funcs->enable_hpd(connector); > + > + if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | > + DRM_CONNECTOR_POLL_DISCONNECT)) > + poll = true; > + } > + drm_connector_list_iter_end(&conn_iter); > + > + return poll; > +} > + > #define DRM_OUTPUT_POLL_PERIOD (10*HZ) > /** > * drm_kms_helper_poll_enable - re-enable output polling. > @@ -241,26 +280,12 @@ drm_connector_mode_valid(struct drm_connector > *connector, > void drm_kms_helper_poll_enable(struct drm_device *dev) > { > bool poll = false; > - struct drm_connector *connector; > - struct drm_connector_list_iter conn_iter; > unsigned long delay = DRM_OUTPUT_POLL_PERIOD; > > if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) > return; > > - drm_connector_list_iter_begin(dev, &conn_iter); > - drm_for_each_connector_iter(connector, &conn_iter) { > - const struct drm_connector_helper_funcs *funcs = > - connector->helper_private; > - > - if (funcs && funcs->enable_hpd) > - funcs->enable_hpd(connector); > - > - if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | > - DRM_CONNECTOR_POLL_DISCONNECT)) > - poll = true; > - } > - drm_connector_list_iter_end(&conn_iter); > + poll = drm_kms_helper_enable_hpd(dev); > > if (dev->mode_config.delayed_event) { > /* > @@ -810,24 +835,13 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker); > > static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool > fini) > { > - struct drm_connector *connector; > - struct drm_connector_list_iter conn_iter; > - > if (!dev->mode_config.poll_enabled) > return; > > if (fini) > dev->mode_config.poll_enabled = false; > > - drm_connector_list_iter_begin(dev, &conn_iter); > - drm_for_each_connector_iter(connector, &conn_iter) { > - const struct drm_connector_helper_funcs *funcs = > - connector->helper_private; > - > - if (funcs && funcs->disable_hpd) > - funcs->disable_hpd(connector); > - } > - drm_connector_list_iter_end(&conn_iter); > + drm_kms_helper_disable_hpd(dev); > > cancel_delayed_work_sync(&dev->mode_config.output_poll_work); > } -- Jani Nikula, Intel Open Source Graphics Center
Re: [Intel-gfx] [PATCH 6/8] drm/i915/guc: Update GuC messages in intel_guc_log.c
On 24.01.2023 00:01, John Harrison wrote: > On 1/20/2023 08:40, Michal Wajdeczko wrote: >> Use new macros to have common prefix that also include GT#. >> >> Signed-off-by: Michal Wajdeczko >> Cc: John Harrison >> --- >> drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 35 +++--- >> 1 file changed, 18 insertions(+), 17 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c >> b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c >> index 68331c538b0a..1d76497b783c 100644 >> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c >> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c >> @@ -12,6 +12,7 @@ >> #include "i915_memcpy.h" >> #include "intel_guc_capture.h" >> #include "intel_guc_log.h" >> +#include "intel_guc_print.h" >> #if defined(CONFIG_DRM_I915_DEBUG_GUC) >> #define GUC_LOG_DEFAULT_CRASH_BUFFER_SIZE SZ_2M >> @@ -39,7 +40,6 @@ struct guc_log_section { >> static void _guc_log_init_sizes(struct intel_guc_log *log) >> { >> struct intel_guc *guc = log_to_guc(log); >> - struct drm_i915_private *i915 = guc_to_gt(guc)->i915; >> static const struct guc_log_section >> sections[GUC_LOG_SECTIONS_LIMIT] = { >> { >> GUC_LOG_CRASH_MASK >> GUC_LOG_CRASH_SHIFT, >> @@ -82,12 +82,12 @@ static void _guc_log_init_sizes(struct >> intel_guc_log *log) >> } >> if (!IS_ALIGNED(log->sizes[i].bytes, log->sizes[i].units)) >> - drm_err(&i915->drm, "Mis-aligned GuC log %s size: 0x%X vs >> 0x%X!", >> + guc_err(guc, "Mis-aligned log %s size: 0x%X vs 0x%X!", >> sections[i].name, log->sizes[i].bytes, >> log->sizes[i].units); >> log->sizes[i].count = log->sizes[i].bytes / >> log->sizes[i].units; >> if (!log->sizes[i].count) { >> - drm_err(&i915->drm, "Zero GuC log %s size!", >> sections[i].name); >> + guc_err(guc, "Zero log %s size!", sections[i].name); >> } else { >> /* Size is +1 unit */ >> log->sizes[i].count--; >> @@ -95,14 +95,14 @@ static void _guc_log_init_sizes(struct >> intel_guc_log *log) >> /* Clip to field size */ >> if (log->sizes[i].count > sections[i].max) { >> - drm_err(&i915->drm, "GuC log %s size too large: %d vs %d!", >> + guc_err(guc, "log %s size too large: %d vs %d!", >> sections[i].name, log->sizes[i].count + 1, >> sections[i].max + 1); >> log->sizes[i].count = sections[i].max; >> } >> } >> if (log->sizes[GUC_LOG_SECTIONS_CRASH].units != >> log->sizes[GUC_LOG_SECTIONS_DEBUG].units) { >> - drm_err(&i915->drm, "Unit mis-match for GuC log crash and >> debug sections: %d vs %d!", >> + guc_err(guc, "Unit mis-match for GuC log crash and debug >> sections: %d vs %d!", > -> "for log, crash and debug sections" hmm, not sure, message seems to be about mismatch between just two buffers/sections, so maybe better to rephrase and use section names: guc_err("Unit mis-match between log sections: %s = %d vs %s = %d\n", log->sizes[GUC_LOG_SECTIONS_CRASH].name, log->sizes[GUC_LOG_SECTIONS_CRASH].units, log->sizes[GUC_LOG_SECTIONS_DEBUG].name, log->sizes[GUC_LOG_SECTIONS_DEBUG].units); > >> log->sizes[GUC_LOG_SECTIONS_CRASH].units, >> log->sizes[GUC_LOG_SECTIONS_DEBUG].units); >> log->sizes[GUC_LOG_SECTIONS_CRASH].units = >> log->sizes[GUC_LOG_SECTIONS_DEBUG].units; >> @@ -374,6 +374,7 @@ size_t intel_guc_get_log_buffer_offset(struct >> intel_guc_log *log, >> static void _guc_log_copy_debuglogs_for_relay(struct intel_guc_log >> *log) >> { >> + struct intel_guc *guc = log_to_guc(log); >> unsigned int buffer_size, read_offset, write_offset, >> bytes_to_copy, full_cnt; >> struct guc_log_buffer_state *log_buf_state, >> *log_buf_snapshot_state; >> struct guc_log_buffer_state log_buf_state_local; >> @@ -383,7 +384,7 @@ static void >> _guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log) >> mutex_lock(&log->relay.lock); >> - if (WARN_ON(!intel_guc_log_relay_created(log))) >> + if (guc_WARN_ON(guc, !intel_guc_log_relay_created(log))) >> goto out_unlock; >> /* Get the pointer to shared GuC log buffer */ >> @@ -398,7 +399,7 @@ static void >> _guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log) >> * Used rate limited to avoid deluge of messages, logs might be >> * getting consumed by User at a slow rate. >> */ >> - DRM_ERROR_RATELIMITED("no sub-buffer to copy general logs\n"); >> + guc_err_ratelimited(guc, "no sub-buffer to copy general >> logs\n"); >> log->relay.full_count++; >> goto out_unlock; >> @@ -451,7 +452,7 @@ static void >> _guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log) >> write_offset = buffer_size; >> } else if (unlikely((read_offset > buffer_
Re: [Intel-gfx] [PATCH 1/5] drm/i915: audit bo->resource usage v3
On Tue, 24 Jan 2023 at 12:57, Christian König wrote: > > From: Christian König > > Make sure we can at least move and alloc TT objects without backing store. > > v2: clear the tt object even when no resource is allocated. > v3: add Matthews changes for i915 as well. > > Signed-off-by: Christian König Reviewed-by: Matthew Auld
Re: [Intel-gfx] [PATCH 2/5] drm/ttm: stop allocating dummy resources during BO creation
On Tue, 24 Jan 2023 at 12:57, Christian König wrote: > > That should not be necessary any more when drivers should at least be > able to handle the move without a resource. > > Signed-off-by: Christian König Reviewed-by: Matthew Auld
Re: [Intel-gfx] [PATCH 3/5] drm/ttm: stop allocating a dummy resource for pipelined gutting
On Tue, 24 Jan 2023 at 12:57, Christian König wrote: > > That should not be necessary any more when drivers should at least be > able to handle a move without a resource. > > Signed-off-by: Christian König Reviewed-by: Matthew Auld
Re: [Intel-gfx] [PATCH v2] drm/i915: implement async_flip mode per plane tracking
On Wed, Jan 11, 2023 at 05:22:47PM +0100, Andrzej Hajda wrote: > Current implementation of async flip w/a relies on assumption that > previous atomic commit contains valid information if async_flip is still > enabled on the plane. It is incorrect. If previous commit did not modify > the plane its state->uapi.async_flip can be false. As a result DMAR/PIPE > errors can be observed: > i915 :00:02.0: [drm] *ERROR* Fault errors on pipe A: 0x0080 > i915 :00:02.0: [drm] *ERROR* Fault errors on pipe A: 0x0080 > DMAR: DRHD: handling fault status reg 2 > DMAR: [DMA Read NO_PASID] Request device [00:02.0] fault addr 0x0 [fault > reason 0x06] PTE Read access is not set > > v2: update async_flip_planes in more reliable places (Ville) > > Signed-off-by: Andrzej Hajda > --- > drivers/gpu/drm/i915/display/intel_atomic_plane.c | 5 - > drivers/gpu/drm/i915/display/intel_display.c | 7 --- > drivers/gpu/drm/i915/display/intel_display_types.h | 3 +++ > 3 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > index 10e1fc9d069827..3f1b1548ede025 100644 > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c > @@ -362,6 +362,7 @@ void intel_plane_set_invisible(struct intel_crtc_state > *crtc_state, > crtc_state->scaled_planes &= ~BIT(plane->id); > crtc_state->nv12_planes &= ~BIT(plane->id); > crtc_state->c8_planes &= ~BIT(plane->id); > + crtc_state->async_flip_planes &= ~BIT(plane->id); > crtc_state->data_rate[plane->id] = 0; > crtc_state->data_rate_y[plane->id] = 0; > crtc_state->rel_data_rate[plane->id] = 0; > @@ -581,8 +582,10 @@ static int intel_plane_atomic_calc_changes(const struct > intel_crtc_state *old_cr >intel_plane_is_scaled(new_plane_state > new_crtc_state->disable_lp_wm = true; > > - if (intel_plane_do_async_flip(plane, old_crtc_state, new_crtc_state)) > + if (intel_plane_do_async_flip(plane, old_crtc_state, new_crtc_state)) { > new_crtc_state->do_async_flip = true; > + new_crtc_state->async_flip_planes |= BIT(plane->id); > + } intel_modeset_all_pipes() and intel_color_add_affected_planes() would need to clear this stuff as well. Can't immediately think of other places that need the same treatment (the nv12 plane stuff I believe should be fine without this since we should be rejecting async flips with planar formats). Though I think that is still going to have annoying ping-pong for the the wm/ddb optimizations whenever there are internal sync plane updates injected between async flips. I think to sort that out fully we'd need to start tracking the last uapi async flip state for each plane. > > return 0; > } > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index e75b9b2a0e015a..e1c3b1b0b6a8f1 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -1303,7 +1303,8 @@ static void intel_crtc_async_flip_disable_wa(struct > intel_atomic_state *state, > intel_atomic_get_old_crtc_state(state, crtc); > const struct intel_crtc_state *new_crtc_state = > intel_atomic_get_new_crtc_state(state, crtc); > - u8 update_planes = new_crtc_state->update_planes; > + u8 disable_async_flip_planes = old_crtc_state->async_flip_planes & > +~new_crtc_state->async_flip_planes; > const struct intel_plane_state *old_plane_state; > struct intel_plane *plane; > bool need_vbl_wait = false; > @@ -1312,7 +1313,7 @@ static void intel_crtc_async_flip_disable_wa(struct > intel_atomic_state *state, > for_each_old_intel_plane_in_state(state, plane, old_plane_state, i) { > if (plane->need_async_flip_disable_wa && > plane->pipe == crtc->pipe && > - update_planes & BIT(plane->id)) { > + disable_async_flip_planes & BIT(plane->id)) { > /* >* Apart from the async flip bit we want to >* preserve the old state for the plane. > @@ -1429,7 +1430,7 @@ static void intel_pre_plane_update(struct > intel_atomic_state *state, >* WA for platforms where async address update enable bit >* is double buffered and only latched at start of vblank. >*/ > - if (old_crtc_state->uapi.async_flip && !new_crtc_state->uapi.async_flip) > + if (old_crtc_state->async_flip_planes & > ~new_crtc_state->async_flip_planes) > intel_crtc_async_flip_disable_wa(state, crtc); > } > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h > b/drivers/gpu/drm/i915/display/intel_display_types.h > index 32e8b2fc3cc642..61b1a0ec3dede1 1006
Re: [Intel-gfx] [PATCH 4/5] drm/ttm: prevent moving of pinned BOs
On Tue, 24 Jan 2023 at 12:57, Christian König wrote: > > We have checks for this in the individual drivers move callback, but > it's probably better to generally forbit that on a higher level. forbid > > Also stops exporting ttm_resource_compat() since that's not necessary > any more after removing the extra checks in vmwgfx. > > Signed-off-by: Christian König Idea seems reasonable to me, Reviewed-by: Matthew Auld
[Intel-gfx] [PATCH] drm/i915/display: Pass drm_i915_private as param to i915 funcs
For i915 functions pass struct drm_i915_private directly instead of struct drm_device. Cc: Rodrigo Vivi Suggested-by: Jani Nikula Signed-off-by: Nirmoy Das Reviewed-by: Jani Nikula Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 8 drivers/gpu/drm/i915/display/intel_fbdev.h | 8 drivers/gpu/drm/i915/i915_driver.c | 4 +++- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index e37cca6b18c6..b014d8626ef7 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -9004,7 +9004,7 @@ void intel_display_driver_register(struct drm_i915_private *i915) * enabled. We do it last so that the async config cannot run * before the connectors are registered. */ - intel_fbdev_initial_config_async(&i915->drm); + intel_fbdev_initial_config_async(i915); /* * We need to coordinate the hotplugs with the asynchronous diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 19f3b5d92a55..c2c52f8e5887 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -547,9 +547,9 @@ static void intel_fbdev_initial_config(void *data, async_cookie_t cookie) intel_fbdev_unregister(to_i915(ifbdev->helper.dev)); } -void intel_fbdev_initial_config_async(struct drm_device *dev) +void intel_fbdev_initial_config_async(struct drm_i915_private *dev_priv) { - struct intel_fbdev *ifbdev = to_i915(dev)->display.fbdev.fbdev; + struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; if (!ifbdev) return; @@ -686,9 +686,9 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev) drm_fb_helper_hotplug_event(&ifbdev->helper); } -void intel_fbdev_restore_mode(struct drm_device *dev) +void intel_fbdev_restore_mode(struct drm_i915_private *dev_priv) { - struct intel_fbdev *ifbdev = to_i915(dev)->display.fbdev.fbdev; + struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; if (!ifbdev) return; diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.h b/drivers/gpu/drm/i915/display/intel_fbdev.h index 0e95e9472fa3..04fd523a5023 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.h +++ b/drivers/gpu/drm/i915/display/intel_fbdev.h @@ -15,12 +15,12 @@ struct intel_framebuffer; #ifdef CONFIG_DRM_FBDEV_EMULATION int intel_fbdev_init(struct drm_device *dev); -void intel_fbdev_initial_config_async(struct drm_device *dev); +void intel_fbdev_initial_config_async(struct drm_i915_private *dev_priv); void intel_fbdev_unregister(struct drm_i915_private *dev_priv); void intel_fbdev_fini(struct drm_i915_private *dev_priv); void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous); void intel_fbdev_output_poll_changed(struct drm_device *dev); -void intel_fbdev_restore_mode(struct drm_device *dev); +void intel_fbdev_restore_mode(struct drm_i915_private *dev_priv); struct intel_framebuffer *intel_fbdev_framebuffer(struct intel_fbdev *fbdev); #else static inline int intel_fbdev_init(struct drm_device *dev) @@ -28,7 +28,7 @@ static inline int intel_fbdev_init(struct drm_device *dev) return 0; } -static inline void intel_fbdev_initial_config_async(struct drm_device *dev) +static inline void intel_fbdev_initial_config_async(struct drm_i915_private *dev_priv) { } @@ -48,7 +48,7 @@ static inline void intel_fbdev_output_poll_changed(struct drm_device *dev) { } -static inline void intel_fbdev_restore_mode(struct drm_device *dev) +static inline void intel_fbdev_restore_mode(struct drm_i915_private *i915) { } static inline struct intel_framebuffer *intel_fbdev_framebuffer(struct intel_fbdev *fbdev) diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index 6469c7c1e154..cd6069c1762d 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -1071,7 +1071,9 @@ static int i915_driver_open(struct drm_device *dev, struct drm_file *file) */ static void i915_driver_lastclose(struct drm_device *dev) { - intel_fbdev_restore_mode(dev); + struct drm_i915_private *i915 = to_i915(dev); + + intel_fbdev_restore_mode(i915); vga_switcheroo_process_delayed_switch(); } -- 2.39.0
[Intel-gfx] [PATCH] drm/i915/xehpsdv/selftests: Flush all tiles on test exit
From: Tvrtko Ursulin We want to idle all tiles when exiting selftests. Signed-off-by: Tvrtko Ursulin Signed-off-by: Nirmoy Das --- .../gpu/drm/i915/selftests/igt_flush_test.c | 28 +++ 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/igt_flush_test.c b/drivers/gpu/drm/i915/selftests/igt_flush_test.c index b484e12df417..29110abb4fe0 100644 --- a/drivers/gpu/drm/i915/selftests/igt_flush_test.c +++ b/drivers/gpu/drm/i915/selftests/igt_flush_test.c @@ -14,21 +14,27 @@ int igt_flush_test(struct drm_i915_private *i915) { - struct intel_gt *gt = to_gt(i915); - int ret = intel_gt_is_wedged(gt) ? -EIO : 0; + struct intel_gt *gt; + unsigned int i; + int ret = 0; - cond_resched(); + for_each_gt(gt, i915, i) { + if (intel_gt_is_wedged(gt)) + ret = -EIO; - if (intel_gt_wait_for_idle(gt, HZ * 3) == -ETIME) { - pr_err("%pS timed out, cancelling all further testing.\n", - __builtin_return_address(0)); + cond_resched(); - GEM_TRACE("%pS timed out.\n", - __builtin_return_address(0)); - GEM_TRACE_DUMP(); + if (intel_gt_wait_for_idle(gt, HZ * 3) == -ETIME) { + pr_err("%pS timed out, cancelling all further testing.\n", + __builtin_return_address(0)); - intel_gt_set_wedged(gt); - ret = -EIO; + GEM_TRACE("%pS timed out.\n", + __builtin_return_address(0)); + GEM_TRACE_DUMP(); + + intel_gt_set_wedged(gt); + ret = -EIO; + } } return ret; -- 2.39.0
Re: [Intel-gfx] [RFC 1/2] drm/i915: Add RPL-U sub platform
On Tue, 17 Jan 2023, Chaitanya Kumar Borah wrote: > Separate out RPLU device ids and add them to both RPL and > newly created RPL-U subplatforms. > > v2: (Matt) > - Sort PCI-IDs numerically > - Name the sub-platform to accurately depict what it is for > - Make RPL-U part of RPL subplatform > > v3: revert to RPL-U subplatform (Jani) > > Signed-off-by: Chaitanya Kumar Borah > --- > drivers/gpu/drm/i915/i915_drv.h | 2 ++ > drivers/gpu/drm/i915/i915_pci.c | 1 + > drivers/gpu/drm/i915/intel_device_info.c | 8 > drivers/gpu/drm/i915/intel_device_info.h | 2 ++ > include/drm/i915_pciids.h| 11 +++ > 5 files changed, 20 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > index 48fd82722f12..c88e514728a0 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -619,6 +619,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, > IS_SUBPLATFORM(dev_priv, INTEL_ALDERLAKE_P, INTEL_SUBPLATFORM_N) > #define IS_ADLP_RPLP(dev_priv) \ > IS_SUBPLATFORM(dev_priv, INTEL_ALDERLAKE_P, INTEL_SUBPLATFORM_RPL) > +#define IS_ADLP_RPLU(dev_priv) \ > + IS_SUBPLATFORM(dev_priv, INTEL_ALDERLAKE_P, INTEL_SUBPLATFORM_RPLU) > #define IS_HSW_EARLY_SDV(dev_priv) (IS_HASWELL(dev_priv) && \ > (INTEL_DEVID(dev_priv) & 0xFF00) == 0x0C00) > #define IS_BDW_ULT(dev_priv) \ > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c > index 6cc65079b18d..e9f3b99b3e00 100644 > --- a/drivers/gpu/drm/i915/i915_pci.c > +++ b/drivers/gpu/drm/i915/i915_pci.c > @@ -1234,6 +1234,7 @@ static const struct pci_device_id pciidlist[] = { > INTEL_DG1_IDS(&dg1_info), > INTEL_RPLS_IDS(&adl_s_info), > INTEL_RPLP_IDS(&adl_p_info), > + INTEL_RPLU_IDS(&adl_p_info), You may want to drop this change, see later comment on how and why. > INTEL_DG2_IDS(&dg2_info), > INTEL_ATS_M_IDS(&ats_m_info), > INTEL_MTL_IDS(&mtl_info), > diff --git a/drivers/gpu/drm/i915/intel_device_info.c > b/drivers/gpu/drm/i915/intel_device_info.c > index 849baf6c3b3c..fec8bd116436 100644 > --- a/drivers/gpu/drm/i915/intel_device_info.c > +++ b/drivers/gpu/drm/i915/intel_device_info.c > @@ -199,6 +199,11 @@ static const u16 subplatform_n_ids[] = { > static const u16 subplatform_rpl_ids[] = { > INTEL_RPLS_IDS(0), > INTEL_RPLP_IDS(0), > + INTEL_RPLU_IDS(0) Please always include the trailing , at the end to make future changes easier. (However, you may want to drop this change altogether, see later comment.) > +}; > + > +static const u16 subplatform_rplu_ids[] = { > + INTEL_RPLU_IDS(0), > }; > > static const u16 subplatform_g10_ids[] = { > @@ -268,6 +273,9 @@ static void intel_device_info_subplatform_init(struct > drm_i915_private *i915) > } else if (find_devid(devid, subplatform_rpl_ids, > ARRAY_SIZE(subplatform_rpl_ids))) { > mask = BIT(INTEL_SUBPLATFORM_RPL); > + if (find_devid(devid, subplatform_rplu_ids, > +ARRAY_SIZE(subplatform_rplu_ids))) > + mask |= BIT(INTEL_SUBPLATFORM_RPLU); > } else if (find_devid(devid, subplatform_g10_ids, > ARRAY_SIZE(subplatform_g10_ids))) { > mask = BIT(INTEL_SUBPLATFORM_G10); > diff --git a/drivers/gpu/drm/i915/intel_device_info.h > b/drivers/gpu/drm/i915/intel_device_info.h > index d588e5fd2eea..4a5cd337e4b5 100644 > --- a/drivers/gpu/drm/i915/intel_device_info.h > +++ b/drivers/gpu/drm/i915/intel_device_info.h > @@ -127,6 +127,8 @@ enum intel_platform { > * bit set > */ > #define INTEL_SUBPLATFORM_N1 > +/* Sub Platform for RPL-U */ This comment really adds nothing, it's exactly the same as the macro name. > +#define INTEL_SUBPLATFORM_RPLU 2 > > /* MTL */ > #define INTEL_SUBPLATFORM_M 0 > diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h > index 4a4c190f7698..758be5fb09a2 100644 > --- a/include/drm/i915_pciids.h > +++ b/include/drm/i915_pciids.h > @@ -684,14 +684,17 @@ > INTEL_VGA_DEVICE(0xA78A, info), \ > INTEL_VGA_DEVICE(0xA78B, info) > > +/* RPL-U */ > +#define INTEL_RPLU_IDS(info) \ > + INTEL_VGA_DEVICE(0xA721, info), \ > + INTEL_VGA_DEVICE(0xA7A1, info), \ > + INTEL_VGA_DEVICE(0xA7A9, info) > + > /* RPL-P */ > #define INTEL_RPLP_IDS(info) \ > INTEL_VGA_DEVICE(0xA720, info), \ > - INTEL_VGA_DEVICE(0xA721, info), \ > INTEL_VGA_DEVICE(0xA7A0, info), \ > - INTEL_VGA_DEVICE(0xA7A1, info), \ > - INTEL_VGA_DEVICE(0xA7A8, info), \ > - INTEL_VGA_DEVICE(0xA7A9, info) > + INTEL_VGA_DEVICE(0xA7A8, info) Changing the INTEL_RPLP_IDS impacts arch/x86/kernel/early-quirks.c too. As is, this drops the early quirks from RPL-U. Your options are 1) modify early-quirks.c too, or 2) include RPL-U ids in RPL-P: #define IN
Re: [Intel-gfx] [RFC 2/2] drm/i915/display: Add 480 MHz CDCLK steps for RPL-U
On Tue, 17 Jan 2023, Chaitanya Kumar Borah wrote: > A new step of 480MHz has been added on SKUs that have a RPL-U > device id to support 120Hz displays more efficiently. Use a > new quirk to identify the machine for which this change needs > to be applied. > > BSpec: 55409 > > v2: (Matt) > - Add missing clock steps > - Correct reference clock typo > > v3: - Revert to RPL-U subplatform > > Signed-off-by: Chaitanya Kumar Borah > --- > drivers/gpu/drm/i915/display/intel_cdclk.c | 27 ++ > 1 file changed, 27 insertions(+) > > diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c > b/drivers/gpu/drm/i915/display/intel_cdclk.c > index 0c107a38f9d0..a5e3497534f3 100644 > --- a/drivers/gpu/drm/i915/display/intel_cdclk.c > +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c > @@ -1329,6 +1329,30 @@ static const struct intel_cdclk_vals > adlp_cdclk_table[] = { > {} > }; > > +static const struct intel_cdclk_vals rplu_cdclk_table[] = { > + { .refclk = 19200, .cdclk = 172800, .divider = 3, .ratio = 27 }, > + { .refclk = 19200, .cdclk = 192000, .divider = 2, .ratio = 20 }, > + { .refclk = 19200, .cdclk = 307200, .divider = 2, .ratio = 32 }, > + { .refclk = 19200, .cdclk = 48, .divider = 2, .ratio = 50 }, > + { .refclk = 19200, .cdclk = 556800, .divider = 2, .ratio = 58 }, > + { .refclk = 19200, .cdclk = 652800, .divider = 2, .ratio = 68 }, > + > + { .refclk = 24000, .cdclk = 176000, .divider = 3, .ratio = 22 }, > + { .refclk = 24000, .cdclk = 192000, .divider = 2, .ratio = 16 }, > + { .refclk = 24000, .cdclk = 312000, .divider = 2, .ratio = 26 }, > + { .refclk = 24000, .cdclk = 48, .divider = 2, .ratio = 40 }, > + { .refclk = 24000, .cdclk = 552000, .divider = 2, .ratio = 46 }, > + { .refclk = 24000, .cdclk = 648000, .divider = 2, .ratio = 54 }, > + > + { .refclk = 38400, .cdclk = 179200, .divider = 3, .ratio = 14 }, > + { .refclk = 38400, .cdclk = 192000, .divider = 2, .ratio = 10 }, > + { .refclk = 38400, .cdclk = 307200, .divider = 2, .ratio = 16 }, > + { .refclk = 38400, .cdclk = 48, .divider = 2, .ratio = 25 }, > + { .refclk = 38400, .cdclk = 556800, .divider = 2, .ratio = 29 }, > + { .refclk = 38400, .cdclk = 652800, .divider = 2, .ratio = 34 }, > + {} > +}; > + > static const struct intel_cdclk_vals dg2_cdclk_table[] = { > { .refclk = 38400, .cdclk = 163200, .divider = 2, .ratio = 34, > .waveform = 0x }, > { .refclk = 38400, .cdclk = 204000, .divider = 2, .ratio = 34, > .waveform = 0x9248 }, > @@ -3353,6 +3377,9 @@ void intel_init_cdclk_hooks(struct drm_i915_private > *dev_priv) > /* Wa_22011320316:adl-p[a0] */ > if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) > dev_priv->display.cdclk.table = adlp_a_step_cdclk_table; > + /* Bspec: 55409 */ Please let's not add bspec references in comments. BR, Jani. > + else if (IS_ADLP_RPLU(dev_priv)) > + dev_priv->display.cdclk.table = rplu_cdclk_table; > else > dev_priv->display.cdclk.table = adlp_cdclk_table; > } else if (IS_ROCKETLAKE(dev_priv)) { -- Jani Nikula, Intel Open Source Graphics Center
Re: [Intel-gfx] [PATCH v4 2/7] drm/i915: Fix up locking around dumping requests lists
On 20/01/2023 23:28, john.c.harri...@intel.com wrote: From: John Harrison The debugfs dump of requests was confused about what state requires the execlist lock versus the GuC lock. There was also a bunch of duplicated messy code between it and the error capture code. So refactor the hung request search into a re-usable function. And reduce the span of the execlist state lock to only the execlist specific code paths. In order to do that, also move the report of hold count (which is an execlist only concept) from the top level dump function to the lower level execlist specific function. Also, move the execlist specific code into the execlist source file. v2: Rename some functions and move to more appropriate files (Daniele). Continuing from yesterday where you pointed out 2/7 exists, after I declared capitulation on 1/7.. I think this refactor makes sense and definitely improves things a lot. On the high level I am only unsure if the patch split could be improved. There seem to be three separate things, correct me if I missed something: 1) Locking fix in intel_guc_find_hung_context 2) Ref counting change throughout 3) Locking refactor / helper consolidation (Or 2 and 3 swapped around, not sure.) That IMO might be a bit easier to read because first patch wouldn't have two logical changes in it. Maybe easier to backport too if it comes to that? On the low level it all looks fine to me - hopefully Daniele can do a detailed pass. Regards, Tvrtko P.S. Only that intel_context_find_active_request_get hurts my eyes, and inflates the diff. I wouldn't rename it but if you guys insist okay. Signed-off-by: John Harrison --- drivers/gpu/drm/i915/gt/intel_engine.h| 4 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 74 +-- .../drm/i915/gt/intel_execlists_submission.c | 27 +++ .../drm/i915/gt/intel_execlists_submission.h | 4 + drivers/gpu/drm/i915/i915_gpu_error.c | 26 +-- 5 files changed, 73 insertions(+), 62 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_engine.h b/drivers/gpu/drm/i915/gt/intel_engine.h index 0e24af5efee9c..b58c30ac8ef02 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine.h +++ b/drivers/gpu/drm/i915/gt/intel_engine.h @@ -250,8 +250,8 @@ void intel_engine_dump_active_requests(struct list_head *requests, ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine, ktime_t *now); -struct i915_request * -intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine); +void intel_engine_get_hung_entity(struct intel_engine_cs *engine, + struct intel_context **ce, struct i915_request **rq); u32 intel_engine_context_size(struct intel_gt *gt, u8 class); struct intel_context * diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c index fbc0a81617e89..1d77e27801bce 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c @@ -2114,17 +2114,6 @@ static void print_request_ring(struct drm_printer *m, struct i915_request *rq) } } -static unsigned long list_count(struct list_head *list) -{ - struct list_head *pos; - unsigned long count = 0; - - list_for_each(pos, list) - count++; - - return count; -} - static unsigned long read_ul(void *p, size_t x) { return *(unsigned long *)(p + x); @@ -2216,11 +2205,11 @@ void intel_engine_dump_active_requests(struct list_head *requests, } } -static void engine_dump_active_requests(struct intel_engine_cs *engine, struct drm_printer *m) +static void engine_dump_active_requests(struct intel_engine_cs *engine, + struct drm_printer *m) { + struct intel_context *hung_ce = NULL; struct i915_request *hung_rq = NULL; - struct intel_context *ce; - bool guc; /* * No need for an engine->irq_seqno_barrier() before the seqno reads. @@ -2229,29 +2218,20 @@ static void engine_dump_active_requests(struct intel_engine_cs *engine, struct d * But the intention here is just to report an instantaneous snapshot * so that's fine. */ - lockdep_assert_held(&engine->sched_engine->lock); + intel_engine_get_hung_entity(engine, &hung_ce, &hung_rq); drm_printf(m, "\tRequests:\n"); - guc = intel_uc_uses_guc_submission(&engine->gt->uc); - if (guc) { - ce = intel_engine_get_hung_context(engine); - if (ce) - hung_rq = intel_context_find_active_request_get(ce); - } else { - hung_rq = intel_engine_execlist_find_hung_request(engine); - if (hung_rq) - hung_rq = i915_request_get_rcu(hung_rq); - } - if (hung_rq) engine_dump_request(hung_rq, m, "\t\thung"); + else if (hung_ce) +
[Intel-gfx] [PATCH v3 00/13] drm/i915: ELD precompute and readout
From: Ville Syrjälä Rebase of the ELD precompute/readout series, for CI mainly. No other changes since v2. Ville Syrjälä (13): drm/i915/audio: Don't program the hardware ELD buffer on ilk+ drm/i915/audio: Don't program the hardware ELD buffer on hsw+ drm/i915/audio: Introduce a struct for the acomp audio state drm/i915/audio: Precompute the ELD drm/i915/audio: Don't enable audio with bogus ELD drm/i915/audio: Hardware ELD readout drm/i915/sdvo: Precompute the ELD drm/i915/sdvo: Only use "presence detect" for has_audio readout drm/i915/sdvo: Do ELD hardware readout drm/i915/audio: Hook up ELD into the state checker drm/i915/audio: Include ELD in the state dump drm/i915/audio: s/ilk/ibx/ drm/i915/audio: Clean up the PCH type checks drivers/gpu/drm/i915/display/g4x_dp.c | 2 + drivers/gpu/drm/i915/display/g4x_hdmi.c | 2 + drivers/gpu/drm/i915/display/intel_audio.c| 317 ++ drivers/gpu/drm/i915/display/intel_audio.h| 7 + .../drm/i915/display/intel_crtc_state_dump.c | 17 + drivers/gpu/drm/i915/display/intel_ddi.c | 2 + drivers/gpu/drm/i915/display/intel_display.c | 43 +++ .../gpu/drm/i915/display/intel_display_core.h | 9 +- .../drm/i915/display/intel_display_types.h| 4 +- drivers/gpu/drm/i915/display/intel_dp.c | 4 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 43 ++- 12 files changed, 288 insertions(+), 166 deletions(-) -- 2.39.1
[Intel-gfx] [PATCH v3 01/13] drm/i915/audio: Don't program the hardware ELD buffer on ilk+
From: Ville Syrjälä Since we use the audio component to transfer the ELD to the audio driver on ilk+ platforms there is no point in even programming the hardware ELD buffer. Stop doing so. The one slight caveat here is that this is not strictly legal according to the HDA spec. PD=1;ELD=0 is only documented as an intermediate state during modeset. But if there is no hardware that depends on that then I guess we're fine. Or we could perhaps set ELD=1 without actually programming the buffer? Note that the bspec sequence of PD=0;ELD=0 -> PD=1;ELD=0 -> PD=1;ELD=1 is also not strictly correct according to the HDA spec, as the only documented transition from PD=0;ELD=0 is straight to PD=1;ELD=1. But that is not even possible on these platforms as the bits live in different registers. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_audio.c | 39 +++--- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 626c47e96a6d..fb8a960a4b3d 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -691,20 +691,6 @@ static void ilk_audio_regs_init(struct drm_i915_private *i915, } } -/* ELD buffer size in dwords */ -static int ilk_eld_buffer_size(struct drm_i915_private *i915, - enum pipe pipe) -{ - struct ilk_audio_regs regs; - u32 tmp; - - ilk_audio_regs_init(i915, pipe, ®s); - - tmp = intel_de_read(i915, regs.aud_cntl_st); - - return REG_FIELD_GET(IBX_ELD_BUFFER_SIZE_MASK, tmp); -} - static void ilk_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) @@ -747,11 +733,8 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder, { struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_connector *connector = conn_state->connector; - const u32 *eld = (const u32 *)connector->eld; enum port port = encoder->port; enum pipe pipe = crtc->pipe; - int eld_buffer_size, len, i; struct ilk_audio_regs regs; if (drm_WARN_ON(&i915->drm, port == PORT_A)) @@ -767,24 +750,10 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder, intel_de_rmw(i915, regs.aud_cntrl_st2, IBX_ELD_VALID(port), 0); - /* Reset ELD address */ - intel_de_rmw(i915, regs.aud_cntl_st, -IBX_ELD_ADDRESS_MASK, 0); - - eld_buffer_size = ilk_eld_buffer_size(i915, pipe); - len = min(drm_eld_size(connector->eld) / 4, eld_buffer_size); - - for (i = 0; i < len; i++) - intel_de_write(i915, regs.hdmiw_hdmiedid, eld[i]); - for (; i < eld_buffer_size; i++) - intel_de_write(i915, regs.hdmiw_hdmiedid, 0); - - drm_WARN_ON(&i915->drm, - (intel_de_read(i915, regs.aud_cntl_st) & IBX_ELD_ADDRESS_MASK) != 0); - - /* ELD valid */ - intel_de_rmw(i915, regs.aud_cntrl_st2, -0, IBX_ELD_VALID(port)); + /* +* The audio componenent is used to convey the ELD +* instead using of the hardware ELD buffer. +*/ /* Enable timestamps */ intel_de_rmw(i915, regs.aud_config, -- 2.39.1
[Intel-gfx] [PATCH v3 02/13] drm/i915/audio: Don't program the hardware ELD buffer on hsw+
From: Ville Syrjälä Since we use the audio component to transfer the ELD to the audio driver on hsw+ platforms there is no point in even programming the hardware ELD buffer. Stop doing so. The one slight caveat here is that this is not strictly legal according to the HDA spec. PD=1;ELD=0 is only documented as an intermediate state during modeset. But if there is no hardware that depends on that then I guess we're fine. Or we could perhaps set ELD=1 without actually programming the buffer? Note that the bspec sequence of PD=0;ELD=0 -> PD=1;ELD=0 -> PD=1;ELD=1 is also not strictly correct according to the HDA spec, as the only documented transition from PD=0;ELD=0 is straight to PD=1;ELD=1. Additionally on hsw/bdw the hardware buffer is tied in with the dedicated display HDA controller's power state, so currently we mostly fail at proramming the buffer anyway. When the HDA side is not sufficiently powered up the ELD address bits get stuck and the ELD data register accesses go nowhere. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai References: https://lore.kernel.org/intel-gfx/20221012104936.30911-1-ville.syrj...@linux.intel.com/ Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_audio.c | 37 +++--- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index fb8a960a4b3d..afebae999c50 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -459,17 +459,6 @@ hsw_audio_config_update(struct intel_encoder *encoder, hsw_hdmi_audio_config_update(encoder, crtc_state); } -/* ELD buffer size in dwords */ -static int hsw_eld_buffer_size(struct drm_i915_private *i915, - enum transcoder cpu_transcoder) -{ - u32 tmp; - - tmp = intel_de_read(i915, HSW_AUD_DIP_ELD_CTRL(cpu_transcoder)); - - return REG_FIELD_GET(IBX_ELD_BUFFER_SIZE_MASK, tmp); -} - static void hsw_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) @@ -618,10 +607,7 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder, { struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_connector *connector = conn_state->connector; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; - const u32 *eld = (const u32 *)connector->eld; - int eld_buffer_size, len, i; mutex_lock(&i915->display.audio.mutex); @@ -639,25 +625,10 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder, intel_de_rmw(i915, HSW_AUD_PIN_ELD_CP_VLD, AUDIO_ELD_VALID(cpu_transcoder), 0); - /* Reset ELD address */ - intel_de_rmw(i915, HSW_AUD_DIP_ELD_CTRL(cpu_transcoder), -IBX_ELD_ADDRESS_MASK, 0); - - eld_buffer_size = hsw_eld_buffer_size(i915, cpu_transcoder); - len = min(drm_eld_size(connector->eld) / 4, eld_buffer_size); - - for (i = 0; i < len; i++) - intel_de_write(i915, HSW_AUD_EDID_DATA(cpu_transcoder), eld[i]); - for (; i < eld_buffer_size; i++) - intel_de_write(i915, HSW_AUD_EDID_DATA(cpu_transcoder), 0); - - drm_WARN_ON(&i915->drm, - (intel_de_read(i915, HSW_AUD_DIP_ELD_CTRL(cpu_transcoder)) & -IBX_ELD_ADDRESS_MASK) != 0); - - /* ELD valid */ - intel_de_rmw(i915, HSW_AUD_PIN_ELD_CP_VLD, -0, AUDIO_ELD_VALID(cpu_transcoder)); + /* +* The audio componenent is used to convey the ELD +* instead using of the hardware ELD buffer. +*/ /* Enable timestamps */ hsw_audio_config_update(encoder, crtc_state); -- 2.39.1
[Intel-gfx] [PATCH v3 03/13] drm/i915/audio: Introduce a struct for the acomp audio state
From: Ville Syrjälä Currently we're spreading the stashed state for use of the audio component hooks all over the place. Start collecting it up into a single spot. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_audio.c| 106 ++ .../gpu/drm/i915/display/intel_display_core.h | 9 +- .../drm/i915/display/intel_display_types.h| 2 - 3 files changed, 65 insertions(+), 52 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index afebae999c50..f4cfb7c3a7ca 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -765,27 +765,29 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct i915_audio_component *acomp = i915->display.audio.component; struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_connector *connector = conn_state->connector; + struct intel_connector *connector = to_intel_connector(conn_state->connector); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; + struct intel_audio_state *audio_state; enum port port = encoder->port; enum pipe pipe = crtc->pipe; if (!crtc_state->has_audio) return; - drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s][ENCODER:%d:%s] Enable audio codec on pipe %c, %u bytes ELD\n", - connector->base.id, connector->name, + drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s][ENCODER:%d:%s] Enable audio codec on [CRTC:%d:%s], %u bytes ELD\n", + connector->base.base.id, connector->base.name, encoder->base.base.id, encoder->base.name, - pipe_name(pipe), drm_eld_size(connector->eld)); + crtc->base.base.id, crtc->base.name, + drm_eld_size(connector->base.eld)); /* FIXME precompute the ELD in .compute_config() */ - if (!connector->eld[0]) + if (!connector->base.eld[0]) drm_dbg_kms(&i915->drm, "Bogus ELD on [CONNECTOR:%d:%s]\n", - connector->base.id, connector->name); + connector->base.base.id, connector->base.name); - connector->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2; + connector->base.eld[6] = drm_av_sync_delay(&connector->base, adjusted_mode) / 2; if (i915->display.funcs.audio) i915->display.funcs.audio->audio_codec_enable(encoder, @@ -793,10 +795,12 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, conn_state); mutex_lock(&i915->display.audio.mutex); - encoder->audio_connector = connector; - /* referred in audio callbacks */ - i915->display.audio.encoder_map[pipe] = encoder; + audio_state = &i915->display.audio.state[pipe]; + + audio_state->encoder = encoder; + audio_state->connector = connector; + mutex_unlock(&i915->display.audio.mutex); if (acomp && acomp->base.audio_ops && @@ -808,7 +812,7 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, (int)port, (int)pipe); } - intel_lpe_audio_notify(i915, pipe, port, connector->eld, + intel_lpe_audio_notify(i915, pipe, port, connector->base.eld, crtc_state->port_clock, intel_crtc_has_dp_encoder(crtc_state)); } @@ -829,16 +833,18 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct i915_audio_component *acomp = i915->display.audio.component; struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); - struct drm_connector *connector = old_conn_state->connector; + struct intel_connector *connector = to_intel_connector(old_conn_state->connector); + struct intel_audio_state *audio_state; enum port port = encoder->port; enum pipe pipe = crtc->pipe; if (!old_crtc_state->has_audio) return; - drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s][ENCODER:%d:%s] Disable audio codec on pipe %c\n", - connector->base.id, connector->name, - encoder->base.base.id, encoder->base.name, pipe_name(pipe)); + drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s][ENCODER:%d:%s] Disable audio codec on [CRTC:%d:%s]\n", + connector->base.base.id, connector->base.name, + encoder->base.base.id, encoder->base.name, + crtc->base.base.id, crtc->base.name); if (i915->d
[Intel-gfx] [PATCH v3 04/13] drm/i915/audio: Precompute the ELD
From: Ville Syrjälä Stash the ELD into the crtc_state and precompute it. This gets rid of the ugly ELD mutation during intel_audio_codec_enable(), and opens the door for the state checker. v2: Make another copy for the acomp hooks (Chaitanya) Split out the bogus ELD handling change (Jani) Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Jani Nikula #v1 Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_audio.c| 50 --- drivers/gpu/drm/i915/display/intel_audio.h| 5 ++ .../gpu/drm/i915/display/intel_display_core.h | 2 +- .../drm/i915/display/intel_display_types.h| 2 + drivers/gpu/drm/i915/display/intel_dp.c | 4 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +- 6 files changed, 45 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index f4cfb7c3a7ca..326e93768687 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -335,8 +335,7 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder, { struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); - struct drm_connector *connector = conn_state->connector; - const u32 *eld = (const u32 *)connector->eld; + const u32 *eld = (const u32 *)crtc_state->eld; int eld_buffer_size, len, i; intel_crtc_wait_for_next_vblank(crtc); @@ -345,7 +344,7 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder, G4X_ELD_VALID | G4X_ELD_ADDRESS_MASK, 0); eld_buffer_size = g4x_eld_buffer_size(i915); - len = min(drm_eld_size(connector->eld) / 4, eld_buffer_size); + len = min(drm_eld_size(crtc_state->eld) / 4, eld_buffer_size); for (i = 0; i < len; i++) intel_de_write(i915, G4X_HDMIW_HDMIEDID, eld[i]); @@ -749,6 +748,28 @@ void intel_audio_sdp_split_update(struct intel_encoder *encoder, crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0); } +bool intel_audio_compute_config(struct intel_encoder *encoder, + struct intel_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct drm_connector *connector = conn_state->connector; + const struct drm_display_mode *adjusted_mode = + &crtc_state->hw.adjusted_mode; + + if (!connector->eld[0]) + drm_dbg_kms(&i915->drm, + "Bogus ELD on [CONNECTOR:%d:%s]\n", + connector->base.id, connector->name); + + BUILD_BUG_ON(sizeof(crtc_state->eld) != sizeof(connector->eld)); + memcpy(crtc_state->eld, connector->eld, sizeof(crtc_state->eld)); + + crtc_state->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2; + + return true; +} + /** * intel_audio_codec_enable - Enable the audio codec for HD audio * @encoder: encoder on which to enable audio @@ -766,8 +787,6 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, struct i915_audio_component *acomp = i915->display.audio.component; struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_connector *connector = to_intel_connector(conn_state->connector); - const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; struct intel_audio_state *audio_state; enum port port = encoder->port; enum pipe pipe = crtc->pipe; @@ -779,15 +798,7 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, connector->base.base.id, connector->base.name, encoder->base.base.id, encoder->base.name, crtc->base.base.id, crtc->base.name, - drm_eld_size(connector->base.eld)); - - /* FIXME precompute the ELD in .compute_config() */ - if (!connector->base.eld[0]) - drm_dbg_kms(&i915->drm, - "Bogus ELD on [CONNECTOR:%d:%s]\n", - connector->base.base.id, connector->base.name); - - connector->base.eld[6] = drm_av_sync_delay(&connector->base, adjusted_mode) / 2; + drm_eld_size(crtc_state->eld)); if (i915->display.funcs.audio) i915->display.funcs.audio->audio_codec_enable(encoder, @@ -799,7 +810,8 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, audio_state = &i915->display.audio.state[pipe]; audio_state->encoder = encoder; - audio_state->connector = connector; + BUILD_BUG_ON(sizeof(audio_state->eld) != sizeof(crtc_state->eld)); + memcpy(audio_state->eld, crtc_state->eld, sizeof(audio_state->eld));
[Intel-gfx] [PATCH v3 05/13] drm/i915/audio: Don't enable audio with bogus ELD
From: Ville Syrjälä Currently we just print a debug message if the ELD is bogus. Maybe we should just not enable audio at all in that case? Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_audio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 326e93768687..5123bab17063 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -757,10 +757,12 @@ bool intel_audio_compute_config(struct intel_encoder *encoder, const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; - if (!connector->eld[0]) + if (!connector->eld[0]) { drm_dbg_kms(&i915->drm, "Bogus ELD on [CONNECTOR:%d:%s]\n", connector->base.id, connector->name); + return false; + } BUILD_BUG_ON(sizeof(crtc_state->eld) != sizeof(connector->eld)); memcpy(crtc_state->eld, connector->eld, sizeof(crtc_state->eld)); -- 2.39.1
[Intel-gfx] [PATCH v3 06/13] drm/i915/audio: Hardware ELD readout
From: Ville Syrjälä Read out the ELD from the hardware buffer, or from our stashed copy for the audio component, so that we can hook up the state checker to validate it. v2: Deal with the platforms using acomp Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Jani Nikula #v1 Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/g4x_dp.c | 2 + drivers/gpu/drm/i915/display/g4x_hdmi.c| 2 + drivers/gpu/drm/i915/display/intel_audio.c | 56 ++ drivers/gpu/drm/i915/display/intel_audio.h | 2 + drivers/gpu/drm/i915/display/intel_ddi.c | 2 + 5 files changed, 64 insertions(+) diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c index 24ef36ec2d3d..fa754038d669 100644 --- a/drivers/gpu/drm/i915/display/g4x_dp.c +++ b/drivers/gpu/drm/i915/display/g4x_dp.c @@ -398,6 +398,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder, if (intel_dp_is_edp(intel_dp)) intel_edp_fixup_vbt_bpp(encoder, pipe_config->pipe_bpp); + + intel_audio_codec_get_config(encoder, pipe_config); } static void diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c index c3580d96765c..64c3b3990702 100644 --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c @@ -155,6 +155,8 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, intel_read_infoframe(encoder, pipe_config, HDMI_INFOFRAME_TYPE_VENDOR, &pipe_config->infoframes.hdmi); + + intel_audio_codec_get_config(encoder, pipe_config); } static void g4x_hdmi_enable_port(struct intel_encoder *encoder, diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 5123bab17063..f7b460a9c76e 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -71,6 +71,8 @@ struct intel_audio_funcs { void (*audio_codec_disable)(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state); + void (*audio_codec_get_config)(struct intel_encoder *encoder, + struct intel_crtc_state *crtc_state); }; /* DP N/M table */ @@ -314,6 +316,27 @@ static int g4x_eld_buffer_size(struct drm_i915_private *i915) return REG_FIELD_GET(G4X_ELD_BUFFER_SIZE_MASK, tmp); } +static void g4x_audio_codec_get_config(struct intel_encoder *encoder, + struct intel_crtc_state *crtc_state) +{ + struct drm_i915_private *i915 = to_i915(encoder->base.dev); + u32 *eld = (u32 *)crtc_state->eld; + int eld_buffer_size, len, i; + u32 tmp; + + tmp = intel_de_read(i915, G4X_AUD_CNTL_ST); + if ((tmp & G4X_ELD_VALID) == 0) + return; + + intel_de_rmw(i915, G4X_AUD_CNTL_ST, G4X_ELD_ADDRESS_MASK, 0); + + eld_buffer_size = g4x_eld_buffer_size(i915); + len = min_t(int, sizeof(crtc_state->eld) / 4, eld_buffer_size); + + for (i = 0; i < len; i++) + eld[i] = intel_de_read(i915, G4X_HDMIW_HDMIEDID); +} + static void g4x_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) @@ -886,19 +909,52 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, intel_lpe_audio_notify(i915, pipe, port, NULL, 0, false); } +static void intel_acomp_get_config(struct intel_encoder *encoder, + struct intel_crtc_state *crtc_state) +{ + struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); + struct intel_audio_state *audio_state; + enum pipe pipe = crtc->pipe; + + mutex_lock(&i915->display.audio.mutex); + + audio_state = &i915->display.audio.state[pipe]; + + if (audio_state->encoder) + memcpy(crtc_state->eld, audio_state->eld, sizeof(audio_state->eld)); + + mutex_unlock(&i915->display.audio.mutex); +} + +void intel_audio_codec_get_config(struct intel_encoder *encoder, + struct intel_crtc_state *crtc_state) +{ + struct drm_i915_private *i915 = to_i915(encoder->base.dev); + + if (!crtc_state->has_audio) + return; + + if (i915->display.funcs.audio) + i915->display.funcs.audio->audio_codec_get_config(encoder, crtc_state); +} + static const struct intel_audio_funcs g4x_audio_funcs = { .audio_codec_enable = g4x_audio_codec_enable, .audio_codec_disable = g4x_audio_codec_disable, + .audio_c
[Intel-gfx] [PATCH v3 07/13] drm/i915/sdvo: Precompute the ELD
From: Ville Syrjälä Use the precomputed crtc_state->eld for audio setup on SDVO just like we do with native HDMI. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Jani Nikula Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_sdvo.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 21805c15d5eb..c0d7d5272eb8 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -39,6 +39,7 @@ #include "i915_drv.h" #include "i915_reg.h" #include "intel_atomic.h" +#include "intel_audio.h" #include "intel_connector.h" #include "intel_crtc.h" #include "intel_de.h" @@ -1378,7 +1379,9 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, pipe_config->has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo, conn_state); - pipe_config->has_audio = intel_sdvo_has_audio(encoder, pipe_config, conn_state); + pipe_config->has_audio = + intel_sdvo_has_audio(encoder, pipe_config, conn_state) && + intel_audio_compute_config(encoder, pipe_config, conn_state); pipe_config->limited_color_range = intel_sdvo_limited_color_range(encoder, pipe_config, @@ -1753,12 +1756,7 @@ static void intel_sdvo_enable_audio(struct intel_sdvo *intel_sdvo, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; - struct drm_connector *connector = conn_state->connector; - u8 *eld = connector->eld; - - eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2; + const u8 *eld = crtc_state->eld; intel_sdvo_set_audio_state(intel_sdvo, 0); -- 2.39.1
[Intel-gfx] [PATCH v3 08/13] drm/i915/sdvo: Only use "presence detect" for has_audio readout
From: Ville Syrjälä Align the SDVO audio code with the native HDMI/DP audio and use just the "presence detect" bit for the has_audio readout. The "ELD valid" bit will be used for ELD readout soon. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_sdvo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index c0d7d5272eb8..68e5c7be2135 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -1732,9 +1732,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_AUDIO_STAT, &val, 1)) { - u8 mask = SDVO_AUDIO_ELD_VALID | SDVO_AUDIO_PRESENCE_DETECT; - - if ((val & mask) == mask) + if (val & SDVO_AUDIO_PRESENCE_DETECT) pipe_config->has_audio = true; } -- 2.39.1
[Intel-gfx] [PATCH v3 09/13] drm/i915/sdvo: Do ELD hardware readout
From: Ville Syrjälä Read out the ELD from the hw so the state checker can verify it. v2: Check the "ELD valid" bit separately v3: Fix ELD tx rate handling during readout Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Jani Nikula #v1 Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_sdvo.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 68e5c7be2135..c469ec3e6042 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -1069,7 +1069,8 @@ static ssize_t intel_sdvo_read_infoframe(struct intel_sdvo *intel_sdvo, &tx_rate, 1)) return -ENXIO; - if (tx_rate == SDVO_HBUF_TX_DISABLED) + /* TX_DISABLED doesn't mean disabled for ELD */ + if (if_index != SDVO_HBUF_INDEX_ELD && tx_rate == SDVO_HBUF_TX_DISABLED) return 0; if (!intel_sdvo_get_hbuf_size(intel_sdvo, &hbuf_size)) @@ -1186,6 +1187,28 @@ static void intel_sdvo_get_avi_infoframe(struct intel_sdvo *intel_sdvo, frame->any.type, HDMI_INFOFRAME_TYPE_AVI); } +static void intel_sdvo_get_eld(struct intel_sdvo *intel_sdvo, + struct intel_crtc_state *crtc_state) +{ + struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); + ssize_t len; + u8 val; + + if (!crtc_state->has_audio) + return; + + if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_AUDIO_STAT, &val, 1)) + return; + + if ((val & SDVO_AUDIO_ELD_VALID) == 0) + return; + + len = intel_sdvo_read_infoframe(intel_sdvo, SDVO_HBUF_INDEX_ELD, + crtc_state->eld, sizeof(crtc_state->eld)); + if (len < 0) + drm_dbg_kms(&i915->drm, "failed to read ELD\n"); +} + static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo, const struct drm_connector_state *conn_state) { @@ -1743,6 +1766,8 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, } intel_sdvo_get_avi_infoframe(intel_sdvo, pipe_config); + + intel_sdvo_get_eld(intel_sdvo, pipe_config); } static void intel_sdvo_disable_audio(struct intel_sdvo *intel_sdvo) -- 2.39.1
[Intel-gfx] [PATCH v3 10/13] drm/i915/audio: Hook up ELD into the state checker
From: Ville Syrjälä Have the state checker validate the ELD. For now we'll just dump it out as a hex buffer on a mismatch, maybe someone will get inspired to decode it properly at some point... Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Jani Nikula Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 43 1 file changed, 43 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index e37cca6b18c6..717ca3d7890d 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -5383,6 +5383,12 @@ intel_compare_dp_vsc_sdp(const struct drm_dp_vsc_sdp *a, return memcmp(a, b, sizeof(*a)) == 0; } +static bool +intel_compare_buffer(const u8 *a, const u8 *b, size_t len) +{ + return memcmp(a, b, len) == 0; +} + static void pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv, bool fastset, const char *name, @@ -5433,6 +5439,30 @@ pipe_config_dp_vsc_sdp_mismatch(struct drm_i915_private *dev_priv, } } +static void +pipe_config_buffer_mismatch(struct drm_i915_private *dev_priv, + bool fastset, const char *name, + const u8 *a, const u8 *b, size_t len) +{ + if (fastset) { + if (!drm_debug_enabled(DRM_UT_KMS)) + return; + + drm_dbg_kms(&dev_priv->drm, + "fastset mismatch in %s buffer\n", name); + print_hex_dump(KERN_DEBUG, "expected: ", DUMP_PREFIX_NONE, + 16, 0, a, len, false); + print_hex_dump(KERN_DEBUG, "found: ", DUMP_PREFIX_NONE, + 16, 0, b, len, false); + } else { + drm_err(&dev_priv->drm, "mismatch in %s buffer\n", name); + print_hex_dump(KERN_ERR, "expected: ", DUMP_PREFIX_NONE, + 16, 0, a, len, false); + print_hex_dump(KERN_ERR, "found: ", DUMP_PREFIX_NONE, + 16, 0, b, len, false); + } +} + static void __printf(4, 5) pipe_config_mismatch(bool fastset, const struct intel_crtc *crtc, const char *name, const char *format, ...) @@ -5631,6 +5661,18 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, } \ } while (0) +#define PIPE_CONF_CHECK_BUFFER(name, len) do { \ + BUILD_BUG_ON(sizeof(current_config->name) != (len)); \ + BUILD_BUG_ON(sizeof(pipe_config->name) != (len)); \ + if (!intel_compare_buffer(current_config->name, pipe_config->name, (len))) { \ + pipe_config_buffer_mismatch(dev_priv, fastset, __stringify(name), \ + current_config->name, \ + pipe_config->name, \ + (len)); \ + ret = false; \ + } \ +} while (0) + #define PIPE_CONF_CHECK_COLOR_LUT(lut, is_pre_csc_lut) do { \ if (current_config->gamma_mode == pipe_config->gamma_mode && \ !intel_color_lut_equal(current_config, \ @@ -5702,6 +5744,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, PIPE_CONF_CHECK_BOOL(fec_enable); PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio); + PIPE_CONF_CHECK_BUFFER(eld, MAX_ELD_BYTES); PIPE_CONF_CHECK_X(gmch_pfit.control); /* pfit ratios are autocomputed by the hw on gen4+ */ -- 2.39.1
[Intel-gfx] [PATCH v3 11/13] drm/i915/audio: Include ELD in the state dump
From: Ville Syrjälä Include the ELD has a hex blob in the crtc state dump. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Jani Nikula Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- .../drm/i915/display/intel_crtc_state_dump.c| 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c index e3273fe8ddac..2422d6ef5777 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c @@ -3,6 +3,8 @@ * Copyright © 2022 Intel Corporation */ +#include + #include "i915_drv.h" #include "intel_crtc_state_dump.h" #include "intel_display_types.h" @@ -56,6 +58,17 @@ intel_dump_dp_vsc_sdp(struct drm_i915_private *i915, drm_dp_vsc_sdp_log(KERN_DEBUG, i915->drm.dev, vsc); } +static void +intel_dump_buffer(struct drm_i915_private *i915, + const char *prefix, const u8 *buf, size_t len) +{ + if (!drm_debug_enabled(DRM_UT_KMS)) + return; + + print_hex_dump(KERN_DEBUG, prefix, DUMP_PREFIX_NONE, + 16, 0, buf, len, false); +} + #define OUTPUT_TYPE(x) [INTEL_OUTPUT_ ## x] = #x static const char * const output_type_str[] = { @@ -236,6 +249,10 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config, intel_hdmi_infoframe_enable(DP_SDP_VSC)) intel_dump_dp_vsc_sdp(i915, &pipe_config->infoframes.vsc); + if (pipe_config->has_audio) + intel_dump_buffer(i915, "ELD: ", pipe_config->eld, + drm_eld_size(pipe_config->eld)); + drm_dbg_kms(&i915->drm, "vrr: %s, vmin: %d, vmax: %d, pipeline full: %d, guardband: %d flipline: %d, vmin vblank: %d, vmax vblank: %d\n", str_yes_no(pipe_config->vrr.enable), pipe_config->vrr.vmin, pipe_config->vrr.vmax, -- 2.39.1
[Intel-gfx] [PATCH v3 12/13] drm/i915/audio: s/ilk/ibx/
From: Ville Syrjälä Rename the ilk stuff to ibx, as the audio logic lives in the PCH. The only exception are VLV/CHV but their audio hardware was stolen from ibx so the name still fits. Also most of the register defines also use the IBX namespace. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_audio.c | 28 +++--- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index f7b460a9c76e..99a3ed84dac9 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -658,13 +658,13 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder, mutex_unlock(&i915->display.audio.mutex); } -struct ilk_audio_regs { +struct ibx_audio_regs { i915_reg_t hdmiw_hdmiedid, aud_config, aud_cntl_st, aud_cntrl_st2; }; -static void ilk_audio_regs_init(struct drm_i915_private *i915, +static void ibx_audio_regs_init(struct drm_i915_private *i915, enum pipe pipe, - struct ilk_audio_regs *regs) + struct ibx_audio_regs *regs) { if (HAS_PCH_IBX(i915)) { regs->hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID(pipe); @@ -684,7 +684,7 @@ static void ilk_audio_regs_init(struct drm_i915_private *i915, } } -static void ilk_audio_codec_disable(struct intel_encoder *encoder, +static void ibx_audio_codec_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { @@ -692,12 +692,12 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder, struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); enum port port = encoder->port; enum pipe pipe = crtc->pipe; - struct ilk_audio_regs regs; + struct ibx_audio_regs regs; if (drm_WARN_ON(&i915->drm, port == PORT_A)) return; - ilk_audio_regs_init(i915, pipe, ®s); + ibx_audio_regs_init(i915, pipe, ®s); mutex_lock(&i915->display.audio.mutex); @@ -720,7 +720,7 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder, intel_crtc_wait_for_next_vblank(crtc); } -static void ilk_audio_codec_enable(struct intel_encoder *encoder, +static void ibx_audio_codec_enable(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { @@ -728,14 +728,14 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder, struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); enum port port = encoder->port; enum pipe pipe = crtc->pipe; - struct ilk_audio_regs regs; + struct ibx_audio_regs regs; if (drm_WARN_ON(&i915->drm, port == PORT_A)) return; intel_crtc_wait_for_next_vblank(crtc); - ilk_audio_regs_init(i915, pipe, ®s); + ibx_audio_regs_init(i915, pipe, ®s); mutex_lock(&i915->display.audio.mutex); @@ -945,9 +945,9 @@ static const struct intel_audio_funcs g4x_audio_funcs = { .audio_codec_get_config = g4x_audio_codec_get_config, }; -static const struct intel_audio_funcs ilk_audio_funcs = { - .audio_codec_enable = ilk_audio_codec_enable, - .audio_codec_disable = ilk_audio_codec_disable, +static const struct intel_audio_funcs ibx_audio_funcs = { + .audio_codec_enable = ibx_audio_codec_enable, + .audio_codec_disable = ibx_audio_codec_disable, .audio_codec_get_config = intel_acomp_get_config, }; @@ -966,11 +966,11 @@ void intel_audio_hooks_init(struct drm_i915_private *i915) if (IS_G4X(i915)) i915->display.funcs.audio = &g4x_audio_funcs; else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) - i915->display.funcs.audio = &ilk_audio_funcs; + i915->display.funcs.audio = &ibx_audio_funcs; else if (IS_HASWELL(i915) || DISPLAY_VER(i915) >= 8) i915->display.funcs.audio = &hsw_audio_funcs; else if (HAS_PCH_SPLIT(i915)) - i915->display.funcs.audio = &ilk_audio_funcs; + i915->display.funcs.audio = &ibx_audio_funcs; } struct aud_ts_cdclk_m_n { -- 2.39.1
[Intel-gfx] [PATCH v3 13/13] drm/i915/audio: Clean up the PCH type checks
From: Ville Syrjälä Use explicit PCH type checks to make it more clear which platforms use which codepaths. Also reorder the branches in ibx_audio_regs_init() a bit to be more in chronological order. Cc: Chaitanya Kumar Borah Cc: Takashi Iwai Reviewed-by: Kai Vehmanen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_audio.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 99a3ed84dac9..a9335c856644 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -666,21 +666,21 @@ static void ibx_audio_regs_init(struct drm_i915_private *i915, enum pipe pipe, struct ibx_audio_regs *regs) { - if (HAS_PCH_IBX(i915)) { - regs->hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID(pipe); - regs->aud_config = IBX_AUD_CFG(pipe); - regs->aud_cntl_st = IBX_AUD_CNTL_ST(pipe); - regs->aud_cntrl_st2 = IBX_AUD_CNTL_ST2; - } else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) { + if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) { regs->hdmiw_hdmiedid = VLV_HDMIW_HDMIEDID(pipe); regs->aud_config = VLV_AUD_CFG(pipe); regs->aud_cntl_st = VLV_AUD_CNTL_ST(pipe); regs->aud_cntrl_st2 = VLV_AUD_CNTL_ST2; - } else { + } else if (HAS_PCH_CPT(i915)) { regs->hdmiw_hdmiedid = CPT_HDMIW_HDMIEDID(pipe); regs->aud_config = CPT_AUD_CFG(pipe); regs->aud_cntl_st = CPT_AUD_CNTL_ST(pipe); regs->aud_cntrl_st2 = CPT_AUD_CNTRL_ST2; + } else if (HAS_PCH_IBX(i915)) { + regs->hdmiw_hdmiedid = IBX_HDMIW_HDMIEDID(pipe); + regs->aud_config = IBX_AUD_CFG(pipe); + regs->aud_cntl_st = IBX_AUD_CNTL_ST(pipe); + regs->aud_cntrl_st2 = IBX_AUD_CNTL_ST2; } } @@ -965,12 +965,11 @@ void intel_audio_hooks_init(struct drm_i915_private *i915) { if (IS_G4X(i915)) i915->display.funcs.audio = &g4x_audio_funcs; - else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) + else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915) || +HAS_PCH_CPT(i915) || HAS_PCH_IBX(i915)) i915->display.funcs.audio = &ibx_audio_funcs; else if (IS_HASWELL(i915) || DISPLAY_VER(i915) >= 8) i915->display.funcs.audio = &hsw_audio_funcs; - else if (HAS_PCH_SPLIT(i915)) - i915->display.funcs.audio = &ibx_audio_funcs; } struct aud_ts_cdclk_m_n { -- 2.39.1
Re: [Intel-gfx] [PATCH 3/3] drm/connector: move ELD and video/audio latencies to display info
Obviously, I need to still work on this. *looks for brown paper bag* On Tue, 24 Jan 2023, kernel test robot wrote: > Hi Jani, > > I love your patch! Yet something to improve: > > [auto build test ERROR on drm-tip/drm-tip] > > url: > https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-connector-move-HDR-sink-metadata-to-display-info/20230124-174322 > base: git://anongit.freedesktop.org/drm/drm-tip drm-tip > patch link: > https://lore.kernel.org/r/20230124094154.2282778-3-jani.nikula%40intel.com > patch subject: [Intel-gfx] [PATCH 3/3] drm/connector: move ELD and > video/audio latencies to display info > config: arm-defconfig > (https://download.01.org/0day-ci/archive/20230124/202301242049.ekzx7rzz-...@intel.com/config) > compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 > reproduce (this is a W=1 build): > wget > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O > ~/bin/make.cross > chmod +x ~/bin/make.cross > # > https://github.com/intel-lab-lkp/linux/commit/1e92b5478cfc1b0df6615365217e9548b0d5 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review > Jani-Nikula/drm-connector-move-HDR-sink-metadata-to-display-info/20230124-174322 > git checkout 1e92b5478cfc1b0df6615365217e9548b0d5 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 > O=build_dir ARCH=arm olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 > O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > > All errors (new ones prefixed by >>): > >drivers/gpu/drm/tegra/hdmi.c: In function 'tegra_hdmi_write_eld': >>> drivers/gpu/drm/tegra/hdmi.c:620:60: error: 'struct drm_connector' has no >>> member named 'eld' > 620 | size_t length = drm_eld_size(hdmi->output.connector.eld), > i; > |^ >drivers/gpu/drm/tegra/hdmi.c:624:72: error: 'struct drm_connector' has no > member named 'eld' > 624 | tegra_hdmi_writel(hdmi, i << 8 | > hdmi->output.connector.eld[i], > | > ^ > -- >drivers/gpu/drm/tegra/sor.c: In function 'tegra_sor_write_eld': >>> drivers/gpu/drm/tegra/sor.c:1951:59: error: 'struct drm_connector' has no >>> member named 'eld' > 1951 | size_t length = drm_eld_size(sor->output.connector.eld), i; > | ^ >drivers/gpu/drm/tegra/sor.c:1954:69: error: 'struct drm_connector' has no > member named 'eld' > 1954 | tegra_sor_writel(sor, i << 8 | > sor->output.connector.eld[i], > | > ^ > > > vim +620 drivers/gpu/drm/tegra/hdmi.c > > edec4af4c3d6d2 Thierry Reding 2012-11-15 617 > 5234549b93aa2a Thierry Reding 2015-08-07 618 static void > tegra_hdmi_write_eld(struct tegra_hdmi *hdmi) > 5234549b93aa2a Thierry Reding 2015-08-07 619 { > 5234549b93aa2a Thierry Reding 2015-08-07 @620 size_t length = > drm_eld_size(hdmi->output.connector.eld), i; > 5234549b93aa2a Thierry Reding 2015-08-07 621 u32 value; > edec4af4c3d6d2 Thierry Reding 2012-11-15 622 > 5234549b93aa2a Thierry Reding 2015-08-07 623 for (i = 0; i < length; > i++) > 5234549b93aa2a Thierry Reding 2015-08-07 624 > tegra_hdmi_writel(hdmi, i << 8 | hdmi->output.connector.eld[i], > 5234549b93aa2a Thierry Reding 2015-08-07 625 > HDMI_NV_PDISP_SOR_AUDIO_HDA_ELD_BUFWR); > edec4af4c3d6d2 Thierry Reding 2012-11-15 626 > 5234549b93aa2a Thierry Reding 2015-08-07 627 /* > 5234549b93aa2a Thierry Reding 2015-08-07 628 * The HDA codec will > always report an ELD buffer size of 96 bytes and > 5234549b93aa2a Thierry Reding 2015-08-07 629 * the HDA codec driver > will check that each byte read from the buffer > 5234549b93aa2a Thierry Reding 2015-08-07 630 * is valid. Therefore > every byte must be written, even if no 96 bytes > 5234549b93aa2a Thierry Reding 2015-08-07 631 * were parsed from > EDID. > 5234549b93aa2a Thierry Reding 2015-08-07 632
[Intel-gfx] [PATCH] drm/i915: Make sure dsm_size has correct granularity
DSM granularity is 1MB so make sure we stick to that. Cc: Matthew Auld Suggested-by: Lucas De Marchi Signed-off-by: Nirmoy Das --- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c index 90a967374b1a..0c027263f09e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c @@ -909,7 +909,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type, dsm_base = intel_uncore_read64(uncore, GEN12_DSMBASE) & GEN12_BDSM_MASK; if (WARN_ON(lmem_size < dsm_base)) return ERR_PTR(-ENODEV); - dsm_size = lmem_size - dsm_base; + dsm_size = ALIGN_DOWN(lmem_size - dsm_base, 1 * SZ_1M); } io_size = dsm_size; -- 2.39.0
Re: [Intel-gfx] [PATCH v3 00/13] drm/i915: ELD precompute and readout
On Tue, 24 Jan 2023, Ville Syrjala wrote: > From: Ville Syrjälä > > Rebase of the ELD precompute/readout series, > for CI mainly. No other changes since v2. Seems to be all Reviewed-by already, but quickly eyeballed through it again. Ack. > > Ville Syrjälä (13): > drm/i915/audio: Don't program the hardware ELD buffer on ilk+ > drm/i915/audio: Don't program the hardware ELD buffer on hsw+ > drm/i915/audio: Introduce a struct for the acomp audio state > drm/i915/audio: Precompute the ELD > drm/i915/audio: Don't enable audio with bogus ELD > drm/i915/audio: Hardware ELD readout > drm/i915/sdvo: Precompute the ELD > drm/i915/sdvo: Only use "presence detect" for has_audio readout > drm/i915/sdvo: Do ELD hardware readout > drm/i915/audio: Hook up ELD into the state checker > drm/i915/audio: Include ELD in the state dump > drm/i915/audio: s/ilk/ibx/ > drm/i915/audio: Clean up the PCH type checks > > drivers/gpu/drm/i915/display/g4x_dp.c | 2 + > drivers/gpu/drm/i915/display/g4x_hdmi.c | 2 + > drivers/gpu/drm/i915/display/intel_audio.c| 317 ++ > drivers/gpu/drm/i915/display/intel_audio.h| 7 + > .../drm/i915/display/intel_crtc_state_dump.c | 17 + > drivers/gpu/drm/i915/display/intel_ddi.c | 2 + > drivers/gpu/drm/i915/display/intel_display.c | 43 +++ > .../gpu/drm/i915/display/intel_display_core.h | 9 +- > .../drm/i915/display/intel_display_types.h| 4 +- > drivers/gpu/drm/i915/display/intel_dp.c | 4 +- > drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +- > drivers/gpu/drm/i915/display/intel_sdvo.c | 43 ++- > 12 files changed, 288 insertions(+), 166 deletions(-) -- Jani Nikula, Intel Open Source Graphics Center
[Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [1/3] drm/edid: reverse display info preserve/clear logic, defaulting to clear
== Series Details == Series: series starting with [1/3] drm/edid: reverse display info preserve/clear logic, defaulting to clear URL : https://patchwork.freedesktop.org/series/113256/ State : success == Summary == CI Bug Log - changes from CI_DRM_12627_full -> Patchwork_113256v1_full Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/index.html Participating hosts (13 -> 11) -- Missing(2): pig-skl-6260u pig-kbl-iris Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_113256v1_full: ### IGT changes ### Suppressed The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@kms_rotation_crc@sprite-rotation-270: - {shard-rkl}:[SKIP][1] ([i915#1845] / [i915#4098]) -> [INCOMPLETE][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-5/igt@kms_rotation_...@sprite-rotation-270.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-rkl-6/igt@kms_rotation_...@sprite-rotation-270.html * igt@perf_pmu@module-unload: - {shard-tglu-10}:NOTRUN -> [DMESG-WARN][3] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-tglu-10/igt@perf_...@module-unload.html Known issues Here are the changes found in Patchwork_113256v1_full that come from known issues: ### IGT changes ### Issues hit * igt@gem_exec_fair@basic-deadline: - shard-glk: [PASS][4] -> [FAIL][5] ([i915#2846]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-glk4/igt@gem_exec_f...@basic-deadline.html [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk4/igt@gem_exec_f...@basic-deadline.html * igt@gem_exec_fair@basic-none-share@rcs0: - shard-glk: [PASS][6] -> [FAIL][7] ([i915#2842]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-glk9/igt@gem_exec_fair@basic-none-sh...@rcs0.html [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk7/igt@gem_exec_fair@basic-none-sh...@rcs0.html * igt@gem_exec_fair@basic-pace@rcs0: - shard-glk: NOTRUN -> [FAIL][8] ([i915#2842]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk9/igt@gem_exec_fair@basic-p...@rcs0.html * igt@gem_lmem_swapping@smem-oom: - shard-glk: NOTRUN -> [SKIP][9] ([fdo#109271] / [i915#4613]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk9/igt@gem_lmem_swapp...@smem-oom.html * igt@kms_big_fb@4-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip: - shard-glk: NOTRUN -> [SKIP][10] ([fdo#109271]) +39 similar issues [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk9/igt@kms_big...@4-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html * igt@kms_ccs@pipe-a-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc: - shard-glk: NOTRUN -> [SKIP][11] ([fdo#109271] / [i915#3886]) +4 similar issues [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk9/igt@kms_ccs@pipe-a-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc.html * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2: - shard-glk: [PASS][12] -> [FAIL][13] ([i915#79]) [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-glk1/igt@kms_flip@2x-flip-vs-expired-vblank-interrupti...@ac-hdmi-a1-hdmi-a2.html [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk5/igt@kms_flip@2x-flip-vs-expired-vblank-interrupti...@ac-hdmi-a1-hdmi-a2.html Possible fixes * igt@drm_fdinfo@idle@rcs0: - {shard-rkl}:[FAIL][14] ([i915#7742]) -> [PASS][15] [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-4/igt@drm_fdinfo@i...@rcs0.html [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-rkl-3/igt@drm_fdinfo@i...@rcs0.html * igt@gem_ctx_exec@basic-nohangcheck: - {shard-rkl}:[FAIL][16] ([i915#6268]) -> [PASS][17] [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-2/igt@gem_ctx_e...@basic-nohangcheck.html [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-rkl-5/igt@gem_ctx_e...@basic-nohangcheck.html * igt@gem_exec_fair@basic-pace-share@rcs0: - shard-glk: [FAIL][18] ([i915#2842]) -> [PASS][19] [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-glk6/igt@gem_exec_fair@basic-pace-sh...@rcs0.html [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113256v1/shard-glk9/igt@gem_exec_fair@basic-pace-sh...@rcs0.html * igt@gem_exec_reloc@basic-wc-read-noreloc: - {shard-rkl}:[SKIP][20] ([i915#3281]) -> [PASS][21
Re: [Intel-gfx] [PATCH v6 2/6] drm/i915/pxp: add device link between i915 and mei_pxp
On Mon, Jan 23, 2023 at 09:31:46PM -0800, Alan Previn wrote: > From: Alexander Usyskin > > Add device link with i915 as consumer and mei_pxp as supplier > to ensure proper ordering of power flows. > > V2: condition on absence of heci_pxp to filter out DG > > Signed-off-by: Alexander Usyskin > --- > drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 11 +++ > drivers/gpu/drm/i915/pxp/intel_pxp_types.h | 6 ++ > 2 files changed, 17 insertions(+) > > diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c > b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c > index 73aa8015f828..cd5b86216506 100644 > --- a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c > +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c > @@ -127,6 +127,12 @@ static int i915_pxp_tee_component_bind(struct device > *i915_kdev, > intel_wakeref_t wakeref; > int ret = 0; > > + if (!HAS_HECI_PXP(i915)) { > + pxp->component_dev_link = device_link_add(i915_kdev, tee_kdev, > DL_FLAG_STATELESS); > + if (drm_WARN_ON(&i915->drm, !pxp->component_dev_link)) > + return -ENODEV; > + } > + > mutex_lock(&pxp->tee_mutex); > pxp->pxp_component = data; > pxp->pxp_component->tee_dev = tee_kdev; > @@ -169,6 +175,11 @@ static void i915_pxp_tee_component_unbind(struct device > *i915_kdev, > mutex_lock(&pxp->tee_mutex); > pxp->pxp_component = NULL; > mutex_unlock(&pxp->tee_mutex); > + > + if (pxp->component_dev_link) { > + device_link_remove(i915_kdev, tee_kdev); > + pxp->component_dev_link = NULL; > + } use the 'del' version instead of the 'remove' one. if (pxp->dev_link) device_link_del(pxp->dev_link); > } > > static const struct component_ops i915_pxp_tee_component_ops = { > diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_types.h > b/drivers/gpu/drm/i915/pxp/intel_pxp_types.h > index 7dc5f08d1583..efd2f3915abe 100644 > --- a/drivers/gpu/drm/i915/pxp/intel_pxp_types.h > +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_types.h > @@ -32,6 +32,12 @@ struct intel_pxp { >* which are protected by &tee_mutex. >*/ > struct i915_pxp_component *pxp_component; > + > + /** > + * @component_dev_link: device link of the pxp-component enforcing i915 > as the > + * consumer. This is needed for legacy platform (TGL/ADL) full-feature > usage. No need to add platform information here. What about something shorter: /* @dev_link: Enforce module relationship for power management ordering. */ > + */ > + struct device_link *component_dev_link; What about struct device_link *dev_link; 'component' is already part of the pxp struct. > /** >* @pxp_component_added: track if the pxp component has been added. >* Set and cleared in tee init and fini functions respectively. > -- > 2.39.0 >
Re: [Intel-gfx] [PATCH v6 5/6] drm/i915/pxp: Trigger the global teardown for before suspending
On Mon, Jan 23, 2023 at 09:31:49PM -0800, Alan Previn wrote: > A driver bug was recently discovered where the security firmware was > receiving internal HW signals indicating that session key expirations > had occurred. Architecturally, the firmware was expecting a response > from the GuC to acknowledge the event with the firmware side. > However the OS was in a suspended state and GuC had been reset. > > Internal specifications actually required the driver to ensure > that all active sessions be properly cleaned up in such cases where > the system is suspended and the GuC potentially unable to respond. > > This patch adds the global teardown code in i915's suspend_prepare > code path. > > Signed-off-by: Alan Previn > Reviewed-by: Juston Li it should probably contain some revision history above so the reviewer can know what changed from the time he reviewed and now. it looks we have another function that I don't remember... Juston, could you please confirm your review stands in this version? if so feel free to add my ack with that. > --- > drivers/gpu/drm/i915/pxp/intel_pxp.c | 65 +--- > drivers/gpu/drm/i915/pxp/intel_pxp.h | 1 + > drivers/gpu/drm/i915/pxp/intel_pxp_pm.c | 2 +- > drivers/gpu/drm/i915/pxp/intel_pxp_session.c | 6 +- > drivers/gpu/drm/i915/pxp/intel_pxp_session.h | 5 ++ > 5 files changed, 66 insertions(+), 13 deletions(-) > > diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c > b/drivers/gpu/drm/i915/pxp/intel_pxp.c > index cfc9af8b3d21..9d4c7724e98e 100644 > --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c > +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c > @@ -270,6 +270,60 @@ static bool pxp_component_bound(struct intel_pxp *pxp) > return bound; > } > > +static int __pxp_global_teardown_final(struct intel_pxp *pxp) > +{ > + if (!pxp->arb_is_valid) > + return 0; > + /* > + * To ensure synchronous and coherent session teardown completion > + * in response to suspend or shutdown triggers, don't use a worker. > + */ > + intel_pxp_mark_termination_in_progress(pxp); > + intel_pxp_terminate(pxp, false); > + > + if (!wait_for_completion_timeout(&pxp->termination, > msecs_to_jiffies(250))) > + return -ETIMEDOUT; > + > + return 0; > +} > + > +static int __pxp_global_teardown_restart(struct intel_pxp *pxp) > +{ > + if (pxp->arb_is_valid) > + return 0; > + /* > + * The arb-session is currently inactive and we are doing a reset and > restart > + * due to a runtime event. Use the worker that was designed for this. > + */ > + pxp_queue_termination(pxp); > + > + if (!wait_for_completion_timeout(&pxp->termination, > msecs_to_jiffies(250))) > + return -ETIMEDOUT; > + > + return 0; > +} > + > +void intel_pxp_end(struct intel_pxp *pxp) > +{ > + struct drm_i915_private *i915 = pxp->ctrl_gt->i915; > + intel_wakeref_t wakeref; > + > + if (!intel_pxp_is_enabled(pxp)) > + return; > + > + wakeref = intel_runtime_pm_get(&i915->runtime_pm); > + > + mutex_lock(&pxp->arb_mutex); > + > + if (__pxp_global_teardown_final(pxp)) > + drm_dbg(&i915->drm, "PXP end timed out\n"); > + > + mutex_unlock(&pxp->arb_mutex); > + > + intel_pxp_fini_hw(pxp); > + intel_runtime_pm_put(&i915->runtime_pm, wakeref); > +} > + > /* > * the arb session is restarted from the irq work when we receive the > * termination completion interrupt > @@ -286,16 +340,9 @@ int intel_pxp_start(struct intel_pxp *pxp) > > mutex_lock(&pxp->arb_mutex); > > - if (pxp->arb_is_valid) > - goto unlock; > - > - pxp_queue_termination(pxp); > - > - if (!wait_for_completion_timeout(&pxp->termination, > - msecs_to_jiffies(250))) { > - ret = -ETIMEDOUT; > + ret = __pxp_global_teardown_restart(pxp); > + if (ret) > goto unlock; > - } > > /* make sure the compiler doesn't optimize the double access */ > barrier(); > diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.h > b/drivers/gpu/drm/i915/pxp/intel_pxp.h > index 9658d3005222..3ded0890cd27 100644 > --- a/drivers/gpu/drm/i915/pxp/intel_pxp.h > +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.h > @@ -27,6 +27,7 @@ void intel_pxp_mark_termination_in_progress(struct > intel_pxp *pxp); > void intel_pxp_tee_end_arb_fw_session(struct intel_pxp *pxp, u32 > arb_session_id); > > int intel_pxp_start(struct intel_pxp *pxp); > +void intel_pxp_end(struct intel_pxp *pxp); > > int intel_pxp_key_check(struct intel_pxp *pxp, > struct drm_i915_gem_object *obj, > diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c > b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c > index 892d39cc61c1..e427464aa131 100644 > --- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c > +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c > @@ -16,7 +16,7 @@ void intel_pxp_suspend_prepare(struct intel_pxp
[Intel-gfx] ✓ Fi.CI.IGT: success for Enable HDCP2.x via GSC CS (rev8)
== Series Details == Series: Enable HDCP2.x via GSC CS (rev8) URL : https://patchwork.freedesktop.org/series/111876/ State : success == Summary == CI Bug Log - changes from CI_DRM_12627_full -> Patchwork_111876v8_full Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/index.html Participating hosts (13 -> 11) -- Missing(2): pig-skl-6260u pig-kbl-iris Known issues Here are the changes found in Patchwork_111876v8_full that come from known issues: ### IGT changes ### Issues hit * igt@gem_exec_fair@basic-none-share@rcs0: - shard-glk: [PASS][1] -> [FAIL][2] ([i915#2842]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-glk9/igt@gem_exec_fair@basic-none-sh...@rcs0.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-glk3/igt@gem_exec_fair@basic-none-sh...@rcs0.html * igt@gem_exec_fair@basic-pace@vcs0: - shard-glk: NOTRUN -> [FAIL][3] ([i915#2842]) +1 similar issue [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-glk5/igt@gem_exec_fair@basic-p...@vcs0.html * igt@gem_lmem_swapping@smem-oom: - shard-glk: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#4613]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-glk5/igt@gem_lmem_swapp...@smem-oom.html * igt@kms_big_fb@4-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip: - shard-glk: NOTRUN -> [SKIP][5] ([fdo#109271]) +39 similar issues [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-glk5/igt@kms_big...@4-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html * igt@kms_ccs@pipe-a-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc: - shard-glk: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#3886]) +4 similar issues [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-glk5/igt@kms_ccs@pipe-a-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc.html Possible fixes * igt@drm_fdinfo@most-busy-idle-check-all@rcs0: - {shard-rkl}:[FAIL][7] ([i915#7742]) -> [PASS][8] [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-1/igt@drm_fdinfo@most-busy-idle-check-...@rcs0.html [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-rkl-2/igt@drm_fdinfo@most-busy-idle-check-...@rcs0.html * igt@fbdev@info: - {shard-rkl}:[SKIP][9] ([i915#2582]) -> [PASS][10] +1 similar issue [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-3/igt@fb...@info.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-rkl-6/igt@fb...@info.html * igt@gem_exec_fair@basic-none-share@rcs0: - {shard-rkl}:[FAIL][11] ([i915#2842]) -> [PASS][12] [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-5/igt@gem_exec_fair@basic-none-sh...@rcs0.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-rkl-5/igt@gem_exec_fair@basic-none-sh...@rcs0.html * igt@gem_exec_reloc@basic-gtt-cpu-noreloc: - {shard-rkl}:[SKIP][13] ([i915#3281]) -> [PASS][14] +2 similar issues [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-1/igt@gem_exec_re...@basic-gtt-cpu-noreloc.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-rkl-5/igt@gem_exec_re...@basic-gtt-cpu-noreloc.html * igt@gem_pread@bench: - {shard-rkl}:[SKIP][15] ([i915#3282]) -> [PASS][16] +1 similar issue [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-1/igt@gem_pr...@bench.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-rkl-5/igt@gem_pr...@bench.html * igt@i915_pm_rpm@modeset-lpsp-stress: - {shard-rkl}:[SKIP][17] ([i915#1397]) -> [PASS][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-2/igt@i915_pm_...@modeset-lpsp-stress.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-rkl-6/igt@i915_pm_...@modeset-lpsp-stress.html * igt@i915_pm_rpm@modeset-lpsp-stress-no-wait: - {shard-dg1}:[SKIP][19] ([i915#1397]) -> [PASS][20] [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-dg1-13/igt@i915_pm_...@modeset-lpsp-stress-no-wait.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-dg1-14/igt@i915_pm_...@modeset-lpsp-stress-no-wait.html * igt@i915_suspend@fence-restore-tiled2untiled: - {shard-rkl}:[FAIL][21] ([fdo#103375]) -> [PASS][22] [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12627/shard-rkl-3/igt@i915_susp...@fence-restore-tiled2untiled.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111876v8/shard-rkl-6/igt@i915_susp...@fence-restore-tiled2untiled.html * igt@kms_at
Re: [Intel-gfx] [PULL] drm-intel-gt-next
On Wed, Jan 18, 2023 at 11:24:44AM +, Tvrtko Ursulin wrote: > Hi Dave, Daniel, > > Here goes the first pull request for 6.3. > > What sticks out most is the amount of fixes, majority of which if not all > would have already landed via gt/next fixes pull requests though, so I > will only mention them here briefly. > > Most impactful ones are probably in the area of DG2 TLB invalidation, > followed by eviction, both platform agnostic (userspace crashes due > eviction failures after object locking changes) and a couple DG2 ones > (visual glitches due CCS aux data not always handled). > > Then we have a bunch of crashes and simiar issues fixed which would have > been triggerable under more like edge conditions. On older platforms, > RC6p gets disabled on Sandybridge to avoid GPU hangs and visual glitches. > > Finally there is a bunch of log noise getting disabled, mostly over- > zealouos log level use or misleadingly logging failures which are > otherwise handled. > > In terms of new features there isn't that much. We have some new > workarounds which can affect performance and an improvement to suspend- > resume times especially significant on modern slow CPU systems like some > Chromebooks. > > Outside of immediate visibility to end users, early enablement for > Meteorlake and Ponte Vecchio is carrying on. Former especially has had > support for loading the GSC firmware, OA and initial GT workarounds added. > > And of course as always there are some random cleanups, selftest tweaks > and misc refactorings, which feels less than the usual amount in this > round. > > Regards, > > Tvrtko > > drm-intel-gt-next-2023-01-18: > Driver Changes: > > Fixes/improvements/new stuff: > > - Fix workarounds on Gen2-3 (Tvrtko Ursulin) > - Fix HuC delayed load memory leaks (Daniele Ceraolo Spurio) > - Fix a BUG caused by impendance mismatch in dma_fence_wait_timeout and GuC > (Janusz Krzysztofik) > - Add DG2 workarounds Wa_18018764978 and Wa_18019271663 (Matt Atwood) > - Apply recommended L3 hashing mask tuning parameters (Gen12+) (Matt Roper) > - Improve suspend / resume times with VT-d scanout workaround active (Andi > Shyti, Chris Wilson) > - Silence misleading "mailbox access failed" warning in snb_pcode_read > (Ashutosh Dixit) > - Fix null pointer dereference on HSW perf/OA (Umesh Nerlige Ramappa) > - Avoid trampling the ring during buffer migration (and selftests) (Chris > Wilson, Matthew Auld) > - Fix DG2 visual corruption on small BAR systems by not forgetting to copy > CCS aux state (Matthew Auld) > - More fixing of DG2 visual corruption by not forgetting to copy CCS aux > state of backup objects (Matthew Auld) > - Fix TLB invalidation for Gen12.50 video and compute engines (Andrzej Hajda) > - Limit Wa_22012654132 to just specific steppings (Matt Roper) > - Fix userspace crashes due eviction not working under lock contention after > the object locking conversion (Matthew Auld) > - Avoid double free is user deploys a corrupt GuC firmware (John Harrison) > - Fix 32-bit builds by using "%zu" to format size_t (Nirmoy Das) > - Fix a possible BUG in TTM async unbind due not reserving enough fence slots > (Nirmoy Das) > - Fix potential use after free by not exposing the GEM context id to > userspace too early (Rob Clark) > - Show clamped PL1 limit to the user (hwmon) (Ashutosh Dixit) > - Workaround unreliable reset on Jasperlake (Chris Wilson) > - Cover rest of SVG unit MCR registers (Gustavo Sousa) > - Avoid PXP log spam on platforms which do not support the feature (Alan > Previn) > - Re-disable RC6p on Sandy Bridge to avoid GPU hangs and visual glitches > (Sasa Dragic) > > Future platform enablement: > > - Manage uncore->lock while waiting on MCR register (Matt Roper) > - Enable Idle Messaging for GSC CS (Vinay Belgaumkar) > - Only initialize GSC in tile 0 (José Roberto de Souza) > - Media GT and Render GT share common GGTT (Aravind Iddamsetty) > - Add dedicated MCR lock (Matt Roper) > - Implement recommended caching policy (PVC) (Wayne Boyer) > - Add hardware-level lock for steering (Matt Roper) > - Check full IP version when applying hw steering semaphore (Matt Roper) > - Enable GuC GGTT invalidation from the start (Daniele Ceraolo Spurio) > - MTL GSC firmware support (Daniele Ceraolo Spurio, Jonathan Cavitt) > - MTL OA support (Umesh Nerlige Ramappa) > - MTL initial gt workarounds (Matt Roper) > > Driver refactors: > > - Hold forcewake and MCR lock over PPAT setup (Matt Roper) > - Acquire fw before loop in intel_uncore_read64_2x32 (Umesh Nerlige Ramappa) > - GuC filename cleanups and use submission API version number (John Harrison) > - Promote pxp subsystem to top-level of i915 (Alan Previn) > - Finish proofing the code agains object size overflows (Chris Wilson, > Gwan-gyeong Mun) > - Start adding module oriented dmesg output (John Harrison) > > Miscellaneous: > > - Correct kerneldoc for intel_gt_mcr_wait_for_reg() (Matt Roper) > - Bump up sample period for busy stats selftest (Umes
Re: [Intel-gfx] [PATCH] drm/i915/gt: Add selftests for TLB invalidation
Hi Tvrtko, Thx for looking at it. On 17.01.2023 11:51, Tvrtko Ursulin wrote: Hi, Thanks for sending this on! Lets see below.. On 16/01/2023 15:59, Andrzej Hajda wrote: From: Chris Wilson Check that we invalidate the TLB cache, the updated physical addresses are immediately visible to the HW, and there is no retention of the old physical address for concurrent HW access. Signed-off-by: Chris Wilson [ahajda: adjust to upstream driver] Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/i915/gt/intel_gpu_commands.h | 1 + drivers/gpu/drm/i915/gt/intel_gt.c | 4 + drivers/gpu/drm/i915/gt/selftest_tlb.c | 405 ++ .../drm/i915/selftests/i915_live_selftests.h | 1 + 4 files changed, 411 insertions(+) create mode 100644 drivers/gpu/drm/i915/gt/selftest_tlb.c diff --git a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h index 2af1ae3831df98..e10507fa71ce63 100644 --- a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h +++ b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h @@ -394,6 +394,7 @@ #define MI_LOAD_URB_MEM MI_INSTR(0x2C, 0) #define MI_STORE_URB_MEM MI_INSTR(0x2D, 0) #define MI_CONDITIONAL_BATCH_BUFFER_END MI_INSTR(0x36, 0) +#define MI_DO_COMPARE REG_BIT(21) #define STATE_BASE_ADDRESS \ ((0x3 << 29) | (0x0 << 27) | (0x1 << 24) | (0x1 << 16)) diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c index 75a7cb33cb..e6358373eb9c92 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.c +++ b/drivers/gpu/drm/i915/gt/intel_gt.c @@ -1196,3 +1196,7 @@ void intel_gt_invalidate_tlb(struct intel_gt *gt, u32 seqno) mutex_unlock(>->tlb.invalidate_lock); } } + +#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) +#include "selftest_tlb.c" +#endif diff --git a/drivers/gpu/drm/i915/gt/selftest_tlb.c b/drivers/gpu/drm/i915/gt/selftest_tlb.c new file mode 100644 index 00..a5082a70f06a77 --- /dev/null +++ b/drivers/gpu/drm/i915/gt/selftest_tlb.c @@ -0,0 +1,405 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright © 2022 Intel Corporation + */ + +#include "i915_selftest.h" + +#include "gem/i915_gem_internal.h" +#include "gem/i915_gem_region.h" + +#include "gen8_engine_cs.h" +#include "i915_gem_ww.h" +#include "intel_engine_regs.h" +#include "intel_gpu_commands.h" +#include "intel_context.h" +#include "intel_gt.h" +#include "intel_ring.h" + +#include "selftests/igt_flush_test.h" +#include "selftests/i915_random.h" + +static void clear_dw(struct i915_vma *vma, u64 addr, u32 val) +{ + GEM_BUG_ON(addr < i915_vma_offset(vma)); + GEM_BUG_ON(addr >= i915_vma_offset(vma) + i915_vma_size(vma)); + memset32(page_mask_bits(vma->obj->mm.mapping) + + (addr - i915_vma_offset(vma)), val, 1); +} + +static int +pte_tlbinv(struct intel_context *ce, + struct i915_vma *va, + struct i915_vma *vb, + u64 align, + void (*tlbinv)(struct i915_address_space *vm, u64 addr, u64 length), + u64 length, + struct rnd_state *prng) +{ + const int use_64b = GRAPHICS_VER(ce->vm->i915) >= 8; + struct drm_i915_gem_object *batch; + struct i915_request *rq; + struct i915_vma *vma; + int retries; + u64 addr; + int err; + u32 *cs; + + batch = i915_gem_object_create_internal(ce->vm->i915, 4096); + if (IS_ERR(batch)) + return PTR_ERR(batch); + + vma = i915_vma_instance(batch, ce->vm, NULL); + if (IS_ERR(vma)) { + err = PTR_ERR(vma); + goto out; + } + + err = i915_vma_pin(vma, 0, 0, PIN_USER); + if (err) + goto out; + + retries = 5; + do { + addr = igt_random_offset(prng, + i915_vma_offset(vma), Why start is set to i915_vma_offset(vma) ? I guess it can be probably better to start after vma (since vma is allocated at the beginning of vm). + /* upper limit for MI_BB_START */ + min(ce->vm->total, BIT_ULL(48)), + va->size, 4); + + err = i915_vma_pin(va, 0, 0, (addr & -align) | PIN_OFFSET_FIXED | PIN_USER); + } while (err == -ENOSPC && --retries); + if (err) { + err = 0; + goto out; + } This loop should basically never fail since the VM is pristine and local, right? It can only clash with the the batch buffer so I am wondering if it would be better not to eat the error condition. Or evicting previous engine runs does not work? But then five retries wouldn't be enough.. My tests shows the bb (vma) is usually pinned either to offset 0, ether to 4096, so the pristinity is disputable. Anyway I will try to pin in the area after end of vma plus align just once. + GEM_BUG_ON(i915_vma_offset(va) != (addr & -align)); + vb->node = va->node; /* overwrites the _same_ PTE */ + + if (align == SZ_64K) { + u64 end = addr + va->size; + + /* + * SZ_64K pages on dg1 require that the whole PT be marked +
Re: [Intel-gfx] Assertion failure in i915 intel_display.c#assert_plane() after resume from hibernation
On Tue, 24 Jan 2023, Salvatore Bonaccorso wrote: > Hi > > A user in Debian, cc'ed reporte the following issue when resuming from > hibernation, tested as well on recent 6.1.7 kernel, context see > https://bugs.debian.org/971068 Full dmesg from boot with drm.debug=0xe module parameter might be helpful. You may need to add log_buf_len=4M or similar to grab it all, it's verbose. BR, Jani. > >> Can repro on the sid kernel, uname -a of >> Linux nabtop 6.1.0-2-686-pae #1 SMP PREEMPT_DYNAMIC Debian 6.1.7-1 >> (2023-01-18) i686 GNU/Linux >> >> Log below. Backtrace is only trivially different. >> >> Best, >> наб >> >> -- >8 -- >> Jan 22 14:06:46 nabtop kernel: OOM killer disabled. >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0x-0x0fff] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0x0009f000-0x000f] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0xb5aa1000-0xb5aa6fff] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0xb5bba000-0xb5c0efff] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0xb5d08000-0xb5f0efff] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0xb5f18000-0xb5f1efff] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0xb5f65000-0xb5f9efff] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0xb5fe1000-0xb5ffefff] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Marking nosave pages: [mem >> 0xb600-0x] >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Basic memory bitmaps created >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Preallocating image memory >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Allocated 183519 pages for >> snapshot >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Allocated 734076 kbytes in >> 0.70 seconds (1048.68 MB/s) >> Jan 22 14:06:46 nabtop kernel: Freezing remaining freezable tasks ... >> (elapsed 0.001 seconds) done. >> Jan 22 14:06:46 nabtop kernel: wifi1: deauthenticating from >> de:0d:17:ad:80:55 by local choice (Reason: 3=DEAUTH_LEAVING) >> Jan 22 14:06:46 nabtop kernel: ACPI: EC: interrupt blocked >> Jan 22 14:06:46 nabtop kernel: ACPI: PM: Preparing to enter system sleep >> state S4 >> Jan 22 14:06:46 nabtop kernel: ACPI: EC: event blocked >> Jan 22 14:06:46 nabtop kernel: ACPI: EC: EC stopped >> Jan 22 14:06:46 nabtop kernel: ACPI: PM: Saving platform NVS memory >> Jan 22 14:06:46 nabtop kernel: Disabling non-boot CPUs ... >> Jan 22 14:06:46 nabtop kernel: smpboot: CPU 1 is now offline >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Creating image: >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Need to copy 175700 pages >> Jan 22 14:06:46 nabtop kernel: PM: hibernation: Normal pages needed: 57765 + >> 1024, available pages: 167322 >> Jan 22 14:06:46 nabtop kernel: ACPI: PM: Restoring platform NVS memory >> Jan 22 14:06:46 nabtop kernel: ACPI: EC: EC started >> Jan 22 14:06:46 nabtop kernel: Enabling non-boot CPUs ... >> Jan 22 14:06:46 nabtop kernel: x86: Booting SMP configuration: >> Jan 22 14:06:46 nabtop kernel: smpboot: Booting Node 0 Processor 1 APIC 0x1 >> Jan 22 14:06:46 nabtop kernel: CPU1 is up >> Jan 22 14:06:46 nabtop kernel: ACPI: PM: Waking up from system sleep state S4 >> Jan 22 14:06:46 nabtop kernel: ACPI: EC: interrupt unblocked >> Jan 22 14:06:46 nabtop kernel: ACPI: EC: event unblocked >> Jan 22 14:06:46 nabtop kernel: usb usb1: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: usb usb2: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: usb usb4: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: usb usb3: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: usb usb6: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: usb usb7: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: usb usb8: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: usb usb5: root hub lost power or was reset >> Jan 22 14:06:46 nabtop kernel: sd 0:0:0:0: [sda] Starting disk >> Jan 22 14:06:46 nabtop kernel: iwlwifi :08:00.0: Radio type=0x1-0x2-0x0 >> Jan 22 14:06:46 nabtop kernel: iwlwifi :08:00.0: Radio type=0x1-0x2-0x0 >> Jan 22 14:06:46 nabtop kernel: [ cut here ] >> Jan 22 14:06:46 nabtop kernel: primary B assertion failure (expected off, >> current on) >> Jan 22 14:06:46 nabtop kernel: WARNING: CPU: 0 PID: 1038 at >> drivers/gpu/drm/i915/display/intel_display.c:476 assert_plane+0x9f/0xb0 >> [i915] >> Jan 22 14:06:46 nabtop kernel: Modules linked in: ghash_generic gf128mul gcm >> ccm algif_aead des_generic libdes ecb algif_skcipher bnep cmac md4 >> algif_hash af_alg binfmt_misc btusb btrtl btbcm btintel btmtk bluetooth >> jitterentropy_rng sha512_generic ctr drbg joydev ansi_cprng ecdh_generic ecc >
[Intel-gfx] v6.1 stable backport request
Stable team, please backport these two commits to v6.1: 2bd0db4b3f0b ("drm/i915: Allow panel fixed modes to have differing sync polarities") 55cfeecc2197 ("drm/i915: Allow alternate fixed modes always for eDP") Reference for posterity: https://gitlab.freedesktop.org/drm/intel/-/issues/7841 Thanks, Jani. -- Jani Nikula, Intel Open Source Graphics Center
[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v3,1/2] drm/probe_helper: extract two helper functions
== Series Details == Series: series starting with [v3,1/2] drm/probe_helper: extract two helper functions URL : https://patchwork.freedesktop.org/series/113264/ State : success == Summary == CI Bug Log - changes from CI_DRM_12628 -> Patchwork_113264v1 Summary --- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/index.html Participating hosts (38 -> 38) -- Additional (2): fi-bsw-kefka bat-rpls-2 Missing(2): fi-rkl-11600 fi-snb-2520m Possible new issues --- Here are the unknown changes that may have been introduced in Patchwork_113264v1: ### IGT changes ### Suppressed The following results come from untrusted machines, tests, or statuses. They do not affect the overall result. * igt@dmabuf@all-tests@dma_fence_chain: - {fi-tgl-dsi}: NOTRUN -> [INCOMPLETE][1] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-tgl-dsi/igt@dmabuf@all-tests@dma_fence_chain.html * igt@i915_selftest@live@gt_pm: - {fi-tgl-dsi}: NOTRUN -> [DMESG-FAIL][2] [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-tgl-dsi/igt@i915_selftest@live@gt_pm.html * igt@runner@aborted: - {fi-tgl-dsi}: [FAIL][3] ([i915#4312]) -> [FAIL][4] [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12628/fi-tgl-dsi/igt@run...@aborted.html [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-tgl-dsi/igt@run...@aborted.html Known issues Here are the changes found in Patchwork_113264v1 that come from known issues: ### IGT changes ### Issues hit * igt@i915_selftest@live@execlists: - fi-bsw-n3050: [PASS][5] -> [INCOMPLETE][6] ([i915#6972] / [i915#7911]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12628/fi-bsw-n3050/igt@i915_selftest@l...@execlists.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-bsw-n3050/igt@i915_selftest@l...@execlists.html * igt@prime_vgem@basic-fence-flip: - fi-bsw-kefka: NOTRUN -> [SKIP][7] ([fdo#109271]) +26 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-bsw-kefka/igt@prime_v...@basic-fence-flip.html * igt@runner@aborted: - fi-bsw-n3050: NOTRUN -> [FAIL][8] ([fdo#109271] / [i915#4312]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-bsw-n3050/igt@run...@aborted.html Possible fixes * igt@fbdev@write: - fi-blb-e6850: [SKIP][9] ([fdo#109271]) -> [PASS][10] +4 similar issues [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12628/fi-blb-e6850/igt@fb...@write.html [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-blb-e6850/igt@fb...@write.html * igt@i915_module_load@load: - fi-ctg-p8600: [DMESG-WARN][11] ([i915#6020]) -> [PASS][12] [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12628/fi-ctg-p8600/igt@i915_module_l...@load.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-ctg-p8600/igt@i915_module_l...@load.html * igt@i915_selftest@live@gt_lrc: - {fi-tgl-dsi}: [INCOMPLETE][13] -> [PASS][14] [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12628/fi-tgl-dsi/igt@i915_selftest@live@gt_lrc.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113264v1/fi-tgl-dsi/igt@i915_selftest@live@gt_lrc.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285 [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295 [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072 [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845 [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849 [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582 [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282 [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555 [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637 [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708 [i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258 [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312 [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613 [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983 [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354 [i915#6020]: https://gitlab.freedesktop.org/drm/intel/issues/6020 [i915#6257]: https://gitlab.freedesktop.org/drm/intel/issues/6257 [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621 [i915#6972]: h
Re: [Intel-gfx] [PATCH] drm/i915/xehpsdv/selftests: Flush all tiles on test exit
Hi Nirmoy, On Tue, Jan 24, 2023 at 03:22:12PM +0100, Nirmoy Das wrote: > From: Tvrtko Ursulin > > We want to idle all tiles when exiting selftests. > > Signed-off-by: Tvrtko Ursulin > Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti ... > --- > .../gpu/drm/i915/selftests/igt_flush_test.c | 28 +++ > 1 file changed, 17 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/i915/selftests/igt_flush_test.c > b/drivers/gpu/drm/i915/selftests/igt_flush_test.c > index b484e12df417..29110abb4fe0 100644 > --- a/drivers/gpu/drm/i915/selftests/igt_flush_test.c > +++ b/drivers/gpu/drm/i915/selftests/igt_flush_test.c > @@ -14,21 +14,27 @@ > > int igt_flush_test(struct drm_i915_private *i915) > { > - struct intel_gt *gt = to_gt(i915); > - int ret = intel_gt_is_wedged(gt) ? -EIO : 0; > + struct intel_gt *gt; > + unsigned int i; > + int ret = 0; > > - cond_resched(); > + for_each_gt(gt, i915, i) { > + if (intel_gt_is_wedged(gt)) > + ret = -EIO; I'm just wondering if it makes sense to check if the gt is wedged. Andi > - if (intel_gt_wait_for_idle(gt, HZ * 3) == -ETIME) { > - pr_err("%pS timed out, cancelling all further testing.\n", > -__builtin_return_address(0)); > + cond_resched(); > > - GEM_TRACE("%pS timed out.\n", > - __builtin_return_address(0)); > - GEM_TRACE_DUMP(); > + if (intel_gt_wait_for_idle(gt, HZ * 3) == -ETIME) { > + pr_err("%pS timed out, cancelling all further > testing.\n", > +__builtin_return_address(0)); > > - intel_gt_set_wedged(gt); > - ret = -EIO; > + GEM_TRACE("%pS timed out.\n", > + __builtin_return_address(0)); > + GEM_TRACE_DUMP(); > + > + intel_gt_set_wedged(gt); > + ret = -EIO; > + } > } > > return ret; > -- > 2.39.0
Re: [Intel-gfx] [PATCH 02/16] drm/i915/dp: Avoid forcing DSC BPC for MST case
On Fri, 20 Jan 2023, Ankit Nautiyal wrote: > For MST the bpc is hardcoded to 8, and pipe bpp to 24. > So avoid forcing DSC bpc for MST case. It's likely better to warn and ignore the debug flag than to bail out. > > Signed-off-by: Ankit Nautiyal > --- > drivers/gpu/drm/i915/display/intel_dp.c | 11 +-- > drivers/gpu/drm/i915/display/intel_dp_mst.c | 8 > 2 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c > b/drivers/gpu/drm/i915/display/intel_dp.c > index 93aebd3683a4..3d828ea0894d 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -1500,14 +1500,13 @@ int intel_dp_dsc_compute_config(struct intel_dp > *intel_dp, > if (!intel_dp_supports_dsc(intel_dp, pipe_config)) > return -EINVAL; > > - if (compute_pipe_bpp) > + if (intel_dp->force_dsc_bpc && compute_pipe_bpp) { > + pipe_bpp = intel_dp->force_dsc_bpc * 3; > + drm_dbg_kms(&dev_priv->drm, "Input DSC BPP forced to %d\n", > pipe_bpp); > + } else if (compute_pipe_bpp) { > pipe_bpp = intel_dp_dsc_compute_bpp(intel_dp, > conn_state->max_requested_bpc); > - else > + } else { > pipe_bpp = pipe_config->pipe_bpp; > - > - if (intel_dp->force_dsc_bpc) { > - pipe_bpp = intel_dp->force_dsc_bpc * 3; > - drm_dbg_kms(&dev_priv->drm, "Input DSC BPP forced to %d", > pipe_bpp); > } > > /* Min Input BPC for ICL+ is 8 */ > diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c > b/drivers/gpu/drm/i915/display/intel_dp_mst.c > index 8b0e4defa3f1..9be04c60cced 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c > +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c > @@ -325,6 +325,14 @@ static int intel_dp_mst_compute_config(struct > intel_encoder *encoder, > /* enable compression if the mode doesn't fit available BW */ > drm_dbg_kms(&dev_priv->drm, "Force DSC en = %d\n", > intel_dp->force_dsc_en); > if (ret || intel_dp->force_dsc_en) { > + if (intel_dp->force_dsc_bpc) { > + /* > + * FIXME: As bpc is hardcoed to 8 bpc as mentioned > above, > + * Avoid force BPC for now. > + */ > + drm_dbg_kms(&dev_priv->drm, "Cannot Force BPC for > MST\n"); > + return -EINVAL; > + } > /* >* Try to get at least some timeslots and then see, if >* we can fit there with DSC. -- Jani Nikula, Intel Open Source Graphics Center
Re: [Intel-gfx] ✓ Fi.CI.BAT: success for Use unversioned blob path for ADLP DMC
On Mon, Jan 23, 2023 at 08:19:59PM +, Patchwork wrote: > == Series Details == > > Series: Use unversioned blob path for ADLP DMC > URL : https://patchwork.freedesktop.org/series/113238/ > State : success > > == Summary == > > CI Bug Log - changes from CI_DRM_12624 -> Patchwork_113238v1 > > > Summary > --- > > **SUCCESS** > > No regressions found. > > External URL: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/index.html CI is clean, however, looking at the logs for igt@i915_module_load@load on ADLP (e.g. [1]), it looks like the adlp_dmc.bin firmware blob is missing, so the tests ended up using ADLP DMC v2.16 instead of v2.18. (On the bright side, at least that confirmst that the fallback mechanism works :-)) I thought this PR[2], sent to this list, would make the blobs available to CI. Did I do something wrong there? [1]: "Results for igt@i915_module_load@load on bat-adlp-6" (https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/bat-adlp-6/igt@i915_module_l...@load.html) [2]: "[Intel-gfx] [CI] PR for ADLP DMC 2.18 and MTL DMC 2.11" (https://lists.freedesktop.org/archives/intel-gfx/2023-January/316102.html) -- Gustavo Sousa > > Participating hosts (38 -> 38) > -- > > Additional (2): fi-kbl-soraka fi-pnv-d510 > Missing(2): fi-rkl-11600 fi-snb-2520m > > Known issues > > > Here are the changes found in Patchwork_113238v1 that come from known > issues: > > ### IGT changes ### > > Issues hit > > * igt@gem_huc_copy@huc-copy: > - fi-kbl-soraka: NOTRUN -> [SKIP][1] ([fdo#109271] / [i915#2190]) >[1]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-kbl-soraka/igt@gem_huc_c...@huc-copy.html > > * igt@gem_lmem_swapping@basic: > - fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#4613]) +3 > similar issues >[2]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-kbl-soraka/igt@gem_lmem_swapp...@basic.html > > * igt@i915_selftest@live@gt_pm: > - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][3] ([i915#1886]) >[3]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html > > * igt@i915_selftest@live@guc_multi_lrc: > - fi-kbl-soraka: NOTRUN -> [INCOMPLETE][4] ([i915#7640]) >[4]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-kbl-soraka/igt@i915_selftest@live@guc_multi_lrc.html > > * igt@i915_selftest@live@hangcheck: > - fi-rkl-guc: [PASS][5] -> [INCOMPLETE][6] ([i915#4983]) >[5]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12624/fi-rkl-guc/igt@i915_selftest@l...@hangcheck.html >[6]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-rkl-guc/igt@i915_selftest@l...@hangcheck.html > > * igt@kms_chamelium_frames@hdmi-crc-fast: > - fi-kbl-soraka: NOTRUN -> [SKIP][7] ([fdo#109271]) +15 similar > issues >[7]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-kbl-soraka/igt@kms_chamelium_fra...@hdmi-crc-fast.html > > * igt@kms_psr@primary_page_flip: > - fi-pnv-d510:NOTRUN -> [SKIP][8] ([fdo#109271]) +44 similar > issues >[8]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-pnv-d510/igt@kms_psr@primary_page_flip.html > > > Possible fixes > > * igt@i915_selftest@live@gt_mocs: > - {bat-rpls-1}: [DMESG-FAIL][9] ([i915#7059]) -> [PASS][10] >[9]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12624/bat-rpls-1/igt@i915_selftest@live@gt_mocs.html >[10]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/bat-rpls-1/igt@i915_selftest@live@gt_mocs.html > > * igt@i915_selftest@live@requests: > - {bat-rpls-2}: [INCOMPLETE][11] ([i915#6257]) -> [PASS][12] >[11]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12624/bat-rpls-2/igt@i915_selftest@l...@requests.html >[12]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/bat-rpls-2/igt@i915_selftest@l...@requests.html > - {bat-rpls-1}: [INCOMPLETE][13] ([i915#4983]) -> [PASS][14] >[13]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12624/bat-rpls-1/igt@i915_selftest@l...@requests.html >[14]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/bat-rpls-1/igt@i915_selftest@l...@requests.html > > * igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions: > - fi-bsw-kefka: [FAIL][15] ([i915#6298]) -> [PASS][16] >[15]: > https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12624/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cur...@atomic-transitions.html >[16]: > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113238v1/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cur...@atomic-transitions.html > > > {name}: This element is suppressed. This means it is ig
Re: [Intel-gfx] [PULL] drm-misc-next
On Thu, Jan 19, 2023 at 09:47:15AM +0100, Thomas Zimmermann wrote: > Hi Dave and Daniel, > > this is the weekly PR for drm-misc-next. This big change is that the > old drivers for userspace modesetting have been removed. Nouveau has > also lost support for these old ioctls and is therefore now requiring > libdrm 2.4.33. > > Best regards > Thomas > > drm-misc-next-2023-01-19: > drm-misc-next for v6.3: > > UAPI Changes: > > Cross-subsystem Changes: > > Core Changes: > > * Cleanup unneeded include statements wrt , >and > > * Remove unused helper DRM_DEBUG_KMS_RATELIMITED() > > * fbdev: Remove obsolete aperture field from struct fb_device, plus >driver cleanups; Remove unused flag FBINFO_MISC_FIRMWARE > > * MIPI-DSI: Fix brightness, plus rsp. driver updates > > * scheduler: Deprecate drm_sched_resubmit_jobs() > > * ttm: Fix MIPS build; Remove ttm_bo_wait(); Documentation fixes > > Driver Changes: > > * Remove obsolete drivers for userspace modesetting i810, mga, r128, >savage, sis, tdfx, via > > * bridge: Support CDNS DSI J721E, plus DT bindings; lt9611: Various >fixes and improvements; sil902x: Various fixes; Fixes > > * nouveau: Removed support for legacy ioctls; Replace zero-size array; >Cleanups > > * panel: Fixes > > * radeon: Use new DRM logging helpers > The following changes since commit 6e41acd2e5353c5362e0d5c2f5ba495c54ff555e: > > drm/vkms: reintroduce prepare_fb and cleanup_fb functions (2023-01-12 > 09:46:19 -0100) > > are available in the Git repository at: > > git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2023-01-19 Pulled, thanks a lot. -Daniel > > for you to fetch changes up to bd43a9844bc6f78e00fdc91db47f6969d10c5ac5: > > drm: bridge: ldb: Warn if LDB clock does not match requested link frequency > (2023-01-19 08:50:50 +0100) > > > drm-misc-next for $kernel-version: > > UAPI Changes: > > Cross-subsystem Changes: > > Core Changes: > > * Cleanup unneeded include statements wrt , >and > > * Remove unused helper DRM_DEBUG_KMS_RATELIMITED() > > * fbdev: Remove obsolete aperture field from struct fb_device, plus >driver cleanups; Remove unused flag FBINFO_MISC_FIRMWARE > > * MIPI-DSI: Fix brightness, plus rsp. driver updates > > * scheduler: Deprecate drm_sched_resubmit_jobs() > > * ttm: Fix MIPS build; Remove ttm_bo_wait(); Documentation fixes > > Driver Changes: > > * Remove obsolete drivers for userspace modesetting i810, mga, r128, >savage, sis, tdfx, via > > * bridge: Support CDNS DSI J721E, plus DT bindings; lt9611: Various >fixes and improvements; sil902x: Various fixes; Fixes > > * nouveau: Removed support for legacy ioctls; Replace zero-size array; >Cleanups > > * panel: Fixes > > * radeon: Use new DRM logging helpers > > > Alexander Stein (2): > drm/bridge: sii902x: Use dev_err_probe > drm: bridge: ldb: Warn if LDB clock does not match requested link > frequency > > Arnd Bergmann (1): > drm: panel: visionox: add backlight dependency > > Biju Das (1): > dt-bindings: display: bridge: renesas,rzg2l-mipi-dsi: Document RZ/V2L > support > > Cai Huoqing (10): > drm: Remove the obsolete driver-i810 > drm: Remove the obsolete driver-mga > drm: Remove the obsolete driver-r128 > drm: Remove the obsolete driver-savage > drm: Remove the obsolete driver-sis > drm: Remove the obsolete driver-tdfx > drm: Remove the obsolete driver-via > drm: Add comments to Kconfig > drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, > sis, via) > MAINTAINERS: Remove some obsolete drivers info(tdfx, mga, i810, savage, > r128, sis) > > Christian König (5): > drm/ttm: fix some minor kerneldoc issues > drm/scheduler: cleanup define > drm/scheduler: deprecate drm_sched_resubmit_jobs > drm/nouveau: stop using ttm_bo_wait > drm/ttm/vmwgfx: move ttm_bo_wait into VMWGFX > > Daniel Mentz (1): > drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness > > Dmitry Baryshkov (13): > drm/bridge: lt9611: fix sleep mode setup > drm/bridge: lt9611: fix HPD reenablement > drm/bridge: lt9611: fix polarity programming > drm/bridge: lt9611: fix programming of video modes > drm/bridge: lt9611: fix clock calculation > drm/bridge: lt9611: pass a pointer to the of node > drm/bridge: lt9611: rework the mode_set function > drm/bridge: lt9611: attach to the next bridge > drm/bridge: lt9611: fix sync polarity for DVI output > drm/bridge: lt9611: simplify video timings programming > drm/bridge: lt9611: rework infoframes handling > drm/bridge: lt9611: stop filtering modes via the table > drm/bridge: lt9611: properly program the dual host mode > > Kees Cook (1): >