From: Jani Nikula <jani.nikula@intel.com>
To: Vandita Kulkarni <vandita.kulkarni@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [v7 2/3] drm/i915/display/dsc: Add Per connector debugfs node for DSC BPP enable
Date: Thu, 08 Jul 2021 16:10:32 +0300 [thread overview]
Message-ID: <87pmvt54tz.fsf@intel.com> (raw)
In-Reply-To: <20210708102549.27821-3-vandita.kulkarni@intel.com>
On Thu, 08 Jul 2021, Vandita Kulkarni <vandita.kulkarni@intel.com> wrote:
> From: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
>
> [What]:
> This patch creates a per connector debugfs node to expose
> the Input and Compressed BPP.
>
> The same node can be used from userspace to force
> DSC to a certain BPP(all accepted values).
>
> [Why]:
> Useful to verify all supported/requested compression bpp's
> through IGT
>
> v2: Remove unnecessary logic (Jani)
> v3: Drop pipe bpp in debugfs node (Vandita)
> v4: Minor cleanups (Vandita)
> v5: Fix NULL pointer dereference
> v6: Fix dim tool checkpatch errors
> Release the lock before return (Vandita)
> v7: Rename to file to dsc_bpp, remove unwanted
> dsc bpp range check from v6, permissions (Jani)
>
> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
> Cc: Navare Manasi D <manasi.d.navare@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Signed-off-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
If this works, I think it's good enough for now. I think there's more
overall cleanup to be done in the file, but should not block this one.
BR,
Jani.
> ---
> .../drm/i915/display/intel_display_debugfs.c | 76 ++++++++++++++++++-
> .../drm/i915/display/intel_display_types.h | 1 +
> 2 files changed, 76 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 942c4419e0cb..351ada944b1e 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -2389,6 +2389,73 @@ static const struct file_operations i915_dsc_fec_support_fops = {
> .write = i915_dsc_fec_support_write
> };
>
> +static int i915_dsc_bpp_show(struct seq_file *m, void *data)
> +{
> + struct drm_connector *connector = m->private;
> + struct drm_device *dev = connector->dev;
> + struct drm_crtc *crtc;
> + struct intel_crtc_state *crtc_state;
> + struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector));
> + int ret;
> +
> + if (!encoder)
> + return -ENODEV;
> +
> + ret = drm_modeset_lock_single_interruptible(&dev->mode_config.connection_mutex);
> + if (ret)
> + return ret;
> +
> + crtc = connector->state->crtc;
> + if (connector->status != connector_status_connected || !crtc) {
> + ret = -ENODEV;
> + goto out;
> + }
> +
> + crtc_state = to_intel_crtc_state(crtc->state);
> + seq_printf(m, "Compressed_BPP: %d\n", crtc_state->dsc.compressed_bpp);
> +
> +out: drm_modeset_unlock(&dev->mode_config.connection_mutex);
> +
> + return ret;
> +}
> +
> +static ssize_t i915_dsc_bpp_write(struct file *file,
> + const char __user *ubuf,
> + size_t len, loff_t *offp)
> +{
> + struct drm_connector *connector =
> + ((struct seq_file *)file->private_data)->private;
> + struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector));
> + struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> + int dsc_bpp = 0;
> + int ret;
> +
> + ret = kstrtoint_from_user(ubuf, len, 0, &dsc_bpp);
> + if (ret < 0)
> + return ret;
> +
> + intel_dp->force_dsc_bpp = dsc_bpp;
> + *offp += len;
> +
> + return len;
> +}
> +
> +static int i915_dsc_bpp_open(struct inode *inode,
> + struct file *file)
> +{
> + return single_open(file, i915_dsc_bpp_show,
> + inode->i_private);
> +}
> +
> +static const struct file_operations i915_dsc_bpp_fops = {
> + .owner = THIS_MODULE,
> + .open = i915_dsc_bpp_open,
> + .read = seq_read,
> + .llseek = seq_lseek,
> + .release = single_release,
> + .write = i915_dsc_bpp_write
> +};
> +
> /**
> * intel_connector_debugfs_add - add i915 specific connector debugfs files
> * @connector: pointer to a registered drm_connector
> @@ -2427,10 +2494,17 @@ int intel_connector_debugfs_add(struct drm_connector *connector)
> connector, &i915_hdcp_sink_capability_fops);
> }
>
> - if ((DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) && ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort && !to_intel_connector(connector)->mst_port) || connector->connector_type == DRM_MODE_CONNECTOR_eDP))
> + if ((DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) &&
> + ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
> + !to_intel_connector(connector)->mst_port) ||
> + connector->connector_type == DRM_MODE_CONNECTOR_eDP)) {
> debugfs_create_file("i915_dsc_fec_support", 0644, root,
> connector, &i915_dsc_fec_support_fops);
>
> + debugfs_create_file("i915_dsc_bpp", 0644, root,
> + connector, &i915_dsc_bpp_fops);
> + }
> +
> /* Legacy panels doesn't lpsp on any platform */
> if ((DISPLAY_VER(dev_priv) >= 9 || IS_HASWELL(dev_priv) ||
> IS_BROADWELL(dev_priv)) &&
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index d94f361b548b..19d8d3eefbc2 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1612,6 +1612,7 @@ struct intel_dp {
>
> /* Display stream compression testing */
> bool force_dsc_en;
> + int force_dsc_bpp;
>
> bool hobl_failed;
> bool hobl_active;
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-07-08 13:10 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 10:25 [Intel-gfx] [v7 0/3] Set BPP in the kernel Vandita Kulkarni
2021-07-08 10:25 ` [Intel-gfx] [v7 1/3] drm/i915/display: Add write permissions for fec support Vandita Kulkarni
2021-07-08 13:05 ` Jani Nikula
2021-07-08 10:25 ` [Intel-gfx] [v7 2/3] drm/i915/display/dsc: Add Per connector debugfs node for DSC BPP enable Vandita Kulkarni
2021-07-08 13:10 ` Jani Nikula [this message]
2021-07-08 13:13 ` Jani Nikula
2021-07-08 10:25 ` [Intel-gfx] [v7 3/3] drm/i915/display/dsc: Force dsc BPP Vandita Kulkarni
2021-07-08 13:09 ` Jani Nikula
2021-07-08 13:13 ` Jani Nikula
2021-07-08 13:24 ` Kulkarni, Vandita
2021-07-08 16:23 ` Jani Nikula
2021-07-08 16:40 ` Kulkarni, Vandita
2021-07-08 14:01 ` [Intel-gfx] [v2] " Vandita Kulkarni
2021-07-14 9:57 ` Sharma, Swati2
2021-07-08 10:28 ` [Intel-gfx] [v7 0/3] Set BPP in the kernel Kulkarni, Vandita
2021-07-08 14:09 ` Kulkarni, Vandita
2021-07-08 21:56 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Set BPP in the kernel (rev2) Patchwork
2021-07-08 22:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-09 11:42 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-07-16 11:52 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Set BPP in the kernel (rev4) Patchwork
2021-07-16 11:53 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-07-16 12:19 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-16 14:08 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2021-07-19 9:50 [Intel-gfx] [v7 0/3] Set BPP in the kernel Vandita Kulkarni
2021-07-19 9:50 ` [Intel-gfx] [v7 2/3] drm/i915/display/dsc: Add Per connector debugfs node for DSC BPP enable Vandita Kulkarni
2021-07-20 6:49 [Intel-gfx] [v7 0/3] Enable setting custom DSC BPP Vandita Kulkarni
2021-07-20 6:49 ` [Intel-gfx] [v7 2/3] drm/i915/display/dsc: Add Per connector debugfs node for DSC BPP enable Vandita Kulkarni
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=87pmvt54tz.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=vandita.kulkarni@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