From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 893FAC433E1 for ; Tue, 9 Jun 2020 17:59:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C40C20820 for ; Tue, 9 Jun 2020 17:59:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C40C20820 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CA046E313; Tue, 9 Jun 2020 17:59:28 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 46BA96E313 for ; Tue, 9 Jun 2020 17:59:27 +0000 (UTC) IronPort-SDR: AeX8NJWmAQzQF1NcCq46YzyVnEiShRo/0I72ugMWA2siKrol0R4ihalCbqZbwLlvDlpEspP1qA wUtp2bsXyPAg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 10:59:26 -0700 IronPort-SDR: FOams4jqVfrawTxazQRjyMyowimCI54os95cu4/QNqP8y3Ko8ggAtx9bVmkAQXkKfJ+2hOvPoR H0yBtgo/7fpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,492,1583222400"; d="scan'208";a="274684993" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga006.jf.intel.com with SMTP; 09 Jun 2020 10:59:24 -0700 Received: by stinkbox (sSMTP sendmail emulation); Tue, 09 Jun 2020 20:59:23 +0300 Date: Tue, 9 Jun 2020 20:59:23 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Imre Deak Message-ID: <20200609175923.GU6112@intel.com> References: <20200608181023.11503-1-imre.deak@intel.com> <20200609150525.GP6112@intel.com> <20200609174035.GG22647@ideak-desk.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200609174035.GG22647@ideak-desk.fi.intel.com> X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix the i915_dsc_fec_support debugfs file for DP MST connectors X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Jun 09, 2020 at 08:40:35PM +0300, Imre Deak wrote: > On Tue, Jun 09, 2020 at 06:05:25PM +0300, Ville Syrj=E4l=E4 wrote: > > On Mon, Jun 08, 2020 at 09:10:23PM +0300, Imre Deak wrote: > > > DSC is not supported on DP MST streams so just return -EINVAL when > > > reading/writing the i915_dsc_fec_support debugfs file for such > > > connectors. > > > = > > > This also fixes an OOPS, caused by the encoder->digport cast, which is > > > not valid for MST encoders. > > > = > > > Signed-off-by: Imre Deak > > > --- > > > .../drm/i915/display/intel_display_debugfs.c | 36 +++++++++++++++--= -- > > > 1 file changed, 29 insertions(+), 7 deletions(-) > > > = > > > diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/d= rivers/gpu/drm/i915/display/intel_display_debugfs.c > > > index 2b640d8ab9d2..ebca8e488d03 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c > > > +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c > > > @@ -2094,6 +2094,8 @@ static int i915_dsc_fec_support_show(struct seq= _file *m, void *data) > > > drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE); > > > = > > > do { > > > + struct intel_encoder *encoder; > > > + > > > try_again =3D false; > > > ret =3D drm_modeset_lock(&dev->mode_config.connection_mutex, > > > &ctx); > > > @@ -2120,8 +2122,17 @@ static int i915_dsc_fec_support_show(struct se= q_file *m, void *data) > > > } else if (ret) { > > > break; > > > } > > > - intel_dp =3D intel_attached_dp(to_intel_connector(connector)); > > > + > > > + encoder =3D intel_attached_encoder(to_intel_connector(connector)); > > > + /* TODO: Add DSC support for MST streams */ > > > + if (encoder->type =3D=3D INTEL_OUTPUT_DP_MST) { > > > + ret =3D -EINVAL; > > > + break; > > > + } > > > + > > > + intel_dp =3D &enc_to_dig_port(encoder)->dp; > > > crtc_state =3D to_intel_crtc_state(crtc->state); > > > + > > > seq_printf(m, "DSC_Enabled: %s\n", > > > yesno(crtc_state->dsc.compression_enable)); > > > seq_printf(m, "DSC_Sink_Support: %s\n", > > > @@ -2147,9 +2158,8 @@ static ssize_t i915_dsc_fec_support_write(struc= t file *file, > > > int ret; > > > struct drm_connector *connector =3D > > > ((struct seq_file *)file->private_data)->private; > > > - struct intel_encoder *encoder =3D intel_attached_encoder(to_intel_c= onnector(connector)); > > > - struct drm_i915_private *i915 =3D to_i915(encoder->base.dev); > > > - struct intel_dp *intel_dp =3D enc_to_intel_dp(encoder); > > > + struct drm_i915_private *i915 =3D to_i915(connector->dev); > > > + struct intel_encoder *encoder; > > > = > > > if (len =3D=3D 0) > > > return 0; > > > @@ -2163,10 +2173,22 @@ static ssize_t i915_dsc_fec_support_write(str= uct file *file, > > > = > > > drm_dbg(&i915->drm, "Got %s for DSC Enable\n", > > > (dsc_enable) ? "true" : "false"); > > > - intel_dp->force_dsc_en =3D dsc_enable; > > > = > > > - *offp +=3D len; > > > - return len; > > > + drm_modeset_lock(&i915->drm.mode_config.connection_mutex, NULL); > > > + > > > + encoder =3D intel_attached_encoder(to_intel_connector(connector)); > > > + /* TODO: Add DSC support for MST streams */ > > > + if (encoder->type =3D=3D INTEL_OUTPUT_DP_MST) { > > = > > The attached encoder can be NULL for MST. > = > Yes, I also sent v2 with that fixed. > = > > Can't we just not add this debugfs file for MST connectors? > = > Won't we have per MST connector DSC at one point? In that case we'd need > something like this anyway. The problem is that it doesn't work until the encoder has been attached. So the behaviour of the interface would be rather inconsistent when applied to MST connectors. No idea what current tests are doing with this stuff so can't say whether it would be a problem in practice. > If this is never needed then yes, better not > to add it. I can't use connector_type which is the same for MST and SST > connectors so is it ok to differentiate based on a > intel_attached_encoder() =3D=3D NULL check? IIRC some other places use connector.mst_port to tell the two apart. > = > > = > > > + ret =3D -EINVAL; > > > + } else { > > > + enc_to_intel_dp(encoder)->force_dsc_en =3D dsc_enable; > > > + *offp +=3D len; > > > + ret =3D len; > > > + } > > > + > > > + drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); > > > + > > > + return ret; > > > } > > > = > > > static int i915_dsc_fec_support_open(struct inode *inode, > > > -- = > > > 2.23.1 > > > = > > > _______________________________________________ > > > Intel-gfx mailing list > > > Intel-gfx@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx > > = > > -- = > > Ville Syrj=E4l=E4 > > Intel -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx