intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Add bigjoiner force enable option to debugfs
Date: Thu, 18 Jan 2024 13:53:41 +0200	[thread overview]
Message-ID: <87h6jaq2m2.fsf@intel.com> (raw)
In-Reply-To: <20240118110205.15787-1-stanislav.lisovskiy@intel.com>

On Thu, 18 Jan 2024, Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> wrote:
> For validation purposes, it might be useful to be able to
> force Bigjoiner mode, even if current dotclock/resolution
> do not require that.
> Lets add such to option to debugfs.
>
> v2: - Apparently intel_dp_need_bigjoiner can't be used, when
>       debugfs entry is created so lets just check manually
>       the DISPLAY_VER.
>
> v3: - Switch to intel_connector from drm_connector(Jani Nikula)
>     - Remove redundant modeset lock(Jani Nikula)
>     - Use kstrtobool_from_user for boolean value(Jani Nikula)
>
> v4: - Apply the changes to proper function(Jani Nikula)
>
> v5: - Removed unnecessary check from i915_bigjoiner_enable_show
>       (Ville Syrjälä)
>     - Added eDP connector check to intel_connector_debugfs_add
>       (Ville Syrjälä)
>     - Removed debug message in order to prevent dmesg flooding
>       (Ville Syrjälä)
>
> v6: - Assume now always that m->private is intel_connector
>     - Fixed other similar conflicts
>
> v7: - Move bigjoiner force option to intel_connector(Ville Syrjälä)
>     - Use DEFINE_SHOW_STORE_ATTRIBUTE instead of defining fops
>       manually.(Ville Syrjälä)
>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
>  .../drm/i915/display/intel_display_debugfs.c  | 47 +++++++++++++++++++
>  .../drm/i915/display/intel_display_types.h    |  2 +
>  drivers/gpu/drm/i915/display/intel_dp.c       |  4 +-
>  3 files changed, 52 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index d951edb366871..ff0c7dfae89a3 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -1413,6 +1413,20 @@ out:	drm_modeset_unlock(&i915->drm.mode_config.connection_mutex);
>  	return ret;
>  }
>  
> +static int i915_bigjoiner_enable_show(struct seq_file *m, void *data)
> +{
> +	struct intel_connector *connector = m->private;
> +	struct drm_crtc *crtc;
> +
> +	crtc = connector->base.state->crtc;
> +	if (connector->base.status != connector_status_connected || !crtc)
> +		return -ENODEV;
> +
> +	seq_printf(m, "Bigjoiner enable: %d\n", connector->force_bigjoiner_enable);
> +
> +	return 0;
> +}
> +
>  static ssize_t i915_dsc_output_format_write(struct file *file,
>  					    const char __user *ubuf,
>  					    size_t len, loff_t *offp)
> @@ -1434,6 +1448,30 @@ static ssize_t i915_dsc_output_format_write(struct file *file,
>  	return len;
>  }
>  
> +static ssize_t i915_bigjoiner_enable_write(struct file *file,
> +						const char __user *ubuf,
> +						size_t len, loff_t *offp)
> +{
> +	struct seq_file *m = file->private_data;
> +	struct intel_connector *connector = m->private;
> +	struct drm_crtc *crtc;
> +	bool bigjoiner_en = 0;
> +	int ret;
> +
> +	crtc = connector->base.state->crtc;
> +	if (connector->base.status != connector_status_connected || !crtc)
> +		return -ENODEV;
> +
> +	ret = kstrtobool_from_user(ubuf, len, &bigjoiner_en);
> +	if (ret < 0)
> +		return ret;
> +
> +	connector->force_bigjoiner_enable = bigjoiner_en;
> +	*offp += len;
> +
> +	return len;
> +}
> +
>  static int i915_dsc_output_format_open(struct inode *inode,
>  				       struct file *file)
>  {
> @@ -1527,6 +1565,8 @@ static const struct file_operations i915_dsc_fractional_bpp_fops = {
>  	.write = i915_dsc_fractional_bpp_write
>  };
>  
> +DEFINE_SHOW_STORE_ATTRIBUTE(i915_bigjoiner_enable);
> +
>  /*
>   * Returns the Current CRTC's bpc.
>   * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc
> @@ -1608,6 +1648,13 @@ void intel_connector_debugfs_add(struct intel_connector *connector)
>  				    connector, &i915_dsc_fractional_bpp_fops);
>  	}
>  
> +	if (DISPLAY_VER(i915) >= 11 &&
> +	    (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
> +	     connector_type == DRM_MODE_CONNECTOR_eDP)) {
> +		debugfs_create_file("i915_bigjoiner_force_enable", 0644, root,
> +				    &connector->base, &i915_bigjoiner_enable_fops);

I've replied to an earlier version of this patch telling you to pass
struct intel_connector * to debugfs_create_file() when your show/write
hooks expect that. This only works because offset of base member is 0,
and the private pointer is void *.

BR,
Jani.

> +	}
> +
>  	if (connector_type == DRM_MODE_CONNECTOR_DSI ||
>  	    connector_type == DRM_MODE_CONNECTOR_eDP ||
>  	    connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index ae2e8cff9d691..db38f2b8178a8 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -626,6 +626,8 @@ struct intel_connector {
>  
>  	struct intel_dp *mst_port;
>  
> +	bool force_bigjoiner_enable;
> +
>  	struct {
>  		struct drm_dp_aux *dsc_decompression_aux;
>  		u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE];
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index ab415f41924d7..d70890ca2b47d 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1205,11 +1205,13 @@ bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp,
>  			     int hdisplay, int clock)
>  {
>  	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> +	struct intel_connector *connector = intel_dp->attached_connector;
>  
>  	if (!intel_dp_can_bigjoiner(intel_dp))
>  		return false;
>  
> -	return clock > i915->max_dotclk_freq || hdisplay > 5120;
> +	return clock > i915->max_dotclk_freq || hdisplay > 5120 ||
> +	       connector->force_bigjoiner_enable;
>  }
>  
>  static enum drm_mode_status

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-01-18 11:53 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-08 12:07 [PATCH 0/3] Bigjoiner refactoring Stanislav Lisovskiy
2024-01-08 12:07 ` [PATCH 1/3] drm/i915: Add bigjoiner force enable option to debugfs Stanislav Lisovskiy
2024-01-12 16:25   ` Ville Syrjälä
2024-01-15  8:57     ` Lisovskiy, Stanislav
2024-01-17  1:12       ` Manasi Navare
2024-01-18 11:02   ` Stanislav Lisovskiy
2024-01-18 11:53     ` Jani Nikula [this message]
2024-01-18 11:59       ` Lisovskiy, Stanislav
2024-01-29  8:28     ` Stanislav Lisovskiy
2024-01-08 12:07 ` [PATCH 2/3] drm/i915/bigjoiner: Refactor bigjoiner state readout Stanislav Lisovskiy
2024-01-12 16:42   ` Ville Syrjälä
2024-01-15  9:24     ` Lisovskiy, Stanislav
2024-01-08 12:07 ` [PATCH 3/3] Start separating pipe vs transcoder set logic for bigjoiner during modeset Stanislav Lisovskiy
2024-01-12 16:47   ` Ville Syrjälä
2024-01-15  9:27     ` Lisovskiy, Stanislav
2024-01-29 12:57     ` Lisovskiy, Stanislav
2024-02-02 10:02   ` Stanislav Lisovskiy
2024-02-07 16:27     ` Ville Syrjälä
2024-02-13 10:35     ` Stanislav Lisovskiy
2024-01-08 13:02 ` ✗ Fi.CI.CHECKPATCH: warning for Bigjoiner refactoring (rev2) Patchwork
2024-01-08 13:02 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-01-08 13:11 ` ✓ Fi.CI.BAT: success " Patchwork
2024-01-08 14:46 ` ✓ Fi.CI.IGT: " Patchwork
2024-01-18 20:41 ` ✗ Fi.CI.CHECKPATCH: warning for Bigjoiner refactoring (rev3) Patchwork
2024-01-18 20:41 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-01-18 20:55 ` ✓ Fi.CI.BAT: success " Patchwork
2024-01-19  9:16 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-01-29 12:26 ` ✓ Fi.CI.BAT: success for Bigjoiner refactoring (rev4) Patchwork
2024-01-29 12:26 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2024-01-29 12:26 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-01-30  0:59 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-02 18:00 ` ✗ Fi.CI.CHECKPATCH: warning for Bigjoiner refactoring (rev5) Patchwork
2024-02-02 18:29 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-02-13 13:18 ` ✗ Fi.CI.CHECKPATCH: warning for Bigjoiner refactoring (rev6) Patchwork
2024-02-13 13:38 ` ✗ Fi.CI.BAT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-01-08  8:58 [PATCH 0/3] Bigjoiner refactoring Stanislav Lisovskiy
2024-01-08  8:58 ` [PATCH 1/3] drm/i915: Add bigjoiner force enable option to debugfs Stanislav Lisovskiy
2024-01-08 10:14   ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6jaq2m2.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stanislav.lisovskiy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).