Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "Joshi, Kunal1" <kunal1.joshi@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "Murthy, Arun R" <arun.r.murthy@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 4/5] lib/igt_psr: added function to check active dp pr
Date: Wed, 25 Oct 2023 07:07:51 +0000	[thread overview]
Message-ID: <b85ee350dacef5b171936046872f441bbe817bd8.camel@intel.com> (raw)
In-Reply-To: <CY8PR11MB6889B7F1125EB54237D3DEC9DADEA@CY8PR11MB6889.namprd11.prod.outlook.com>

On Wed, 2023-10-25 at 06:16 +0000, Joshi, Kunal1 wrote:
> Hello Jouni,
> 
> -----Original Message-----
> From: Hogander, Jouni <jouni.hogander@intel.com> 
> Sent: Friday, October 20, 2023 5:46 PM
> To: Joshi, Kunal1 <kunal1.joshi@intel.com>;
> igt-dev@lists.freedesktop.org
> Cc: Murthy, Arun R <arun.r.murthy@intel.com>; Manna, Animesh
> <animesh.manna@intel.com>
> Subject: Re: [PATCH i-g-t 4/5] lib/igt_psr: added function to check
> active dp pr
> 
> On Fri, 2023-10-20 at 11:35 +0530, Kunal Joshi wrote:
> > Added function to check if pr is active on a output.
> > assuming SRDENT is the state to compare when pr is active
> > 
> > Cc: Jouni Högander <jouni.hogander@intel.com>
> > Cc: Animesh Manna <animesh.manna@intel.com>
> > Cc: Arun R Murthy <arun.r.murthy@intel.com>
> > Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> > ---
> >  lib/igt_psr.c | 23 +++++++++++++++++++++++
> >  lib/igt_psr.h |  2 +-
> >  2 files changed, 24 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/igt_psr.c b/lib/igt_psr.c index
> > 4c912a064..683379db6 
> > 100644
> > --- a/lib/igt_psr.c
> > +++ b/lib/igt_psr.c
> > @@ -390,3 +390,26 @@ bool output_supports_pr(int debugfs_fd, 
> > igt_output_t *output)
> >  
> >          return strstr(buf, "Panel Replay = yes");
> >  }
> > +
> > +bool dp_pr_active_check(int debugfs_fd, igt_output_t *output) {
> > +        char debugfs_file[128] = {0};
> > +        char buf[PSR_STATUS_MAX_LEN];
> > +        const char *state = "SRDENT";
> > +        int ret;
> > +
> > +        if (!strstr(output->name,"DP"))
> > +                return false;
> > +
> > +        sprintf(debugfs_file, "%s/i915_sink_status", output-
> > >name);
> > +
> > +        ret = igt_debugfs_simple_read(debugfs_fd, debugfs_file,
> > +                                     buf, sizeof(buf));
> > +        if (ret < 0) {
> > +                igt_info("Could not read i915_edp_psr_status:
> > %s\n",
> > +                         strerror(-ret));
> > +                return false;
> > +        }
> > +        igt_skip_on(strstr(buf, "PSR sink not reliable: yes"));
> > +        return strstr(buf, state);
> > +}
> 
> > Why did you choose to write new instead of modifying existing c ?
> > 
> > BR
> For DP pr we are using different debugfs directory to read,
> so thought of creating new function for clear separation,
> 
> But can modify psr_sink_support if you think that will be better way.

I think that would be better approach. Also eases your modifications in
kms_psr.c

BR,

Jouni Högander

> 
> Jouni Högander
> > diff --git a/lib/igt_psr.h b/lib/igt_psr.h index
> > 8e36fcf2f..dc603ffc3 
> > 100644
> > --- a/lib/igt_psr.h
> > +++ b/lib/igt_psr.h
> > @@ -56,5 +56,5 @@ bool i915_psr2_selective_fetch_check(int drm_fd);
> >  bool i915_psr2_sel_fetch_to_psr1(int drm_fd);
> >  void i915_psr2_sel_fetch_restore(int drm_fd);
> >  bool output_supports_pr(int debugfs_fd, igt_output_t *output);
> > -
> > +bool dp_pr_active_check(int debugfs_fd, igt_output_t *output);
> >  #endif
> 
> Thanks and Regards
> Kunal Joshi
> 


  reply	other threads:[~2023-10-25  7:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20  6:04 [igt-dev] [PATCH i-g-t 0/5] extend kms_psr test to validate pr Kunal Joshi
2023-10-20  6:04 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_psr: added enum for panel replay Kunal Joshi
2023-10-20  6:05 ` [igt-dev] [PATCH i-g-t 2/5] lib/igt_psr: modified function for pr compaitability Kunal Joshi
2023-10-20  6:05 ` [igt-dev] [PATCH i-g-t 3/5] lib/igt_psr: added function to check output supports pr Kunal Joshi
2023-10-20 12:13   ` Hogander, Jouni
2023-10-25  6:01     ` Joshi, Kunal1
2023-10-25  7:05       ` Hogander, Jouni
2023-10-25  7:12         ` Joshi, Kunal1
2023-10-20  6:05 ` [igt-dev] [PATCH i-g-t 4/5] lib/igt_psr: added function to check active dp pr Kunal Joshi
2023-10-20 12:15   ` Hogander, Jouni
2023-10-25  6:16     ` Joshi, Kunal1
2023-10-25  7:07       ` Hogander, Jouni [this message]
2023-10-25  7:13         ` Joshi, Kunal1
2023-10-20  6:05 ` [igt-dev] [PATCH i-g-t 5/5] tests/intel/kms_psr: made test compaitable with pr Kunal Joshi
2023-10-23  6:54   ` Hogander, Jouni
2023-10-25  6:19     ` Joshi, Kunal1
2023-10-25  6:49     ` Joshi, Kunal1
2023-10-23 22:39 ` [igt-dev] ✗ Fi.CI.BAT: failure for extend kms_psr test to validate pr Patchwork
2023-10-23 23:37 ` [igt-dev] ✗ CI.xeBAT: " Patchwork

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=b85ee350dacef5b171936046872f441bbe817bd8.camel@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunal1.joshi@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