public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] lib/i915/perf: return NULL when platform is not supported
Date: Tue, 25 Feb 2020 13:32:01 +0200	[thread overview]
Message-ID: <20200225113201.GF3839@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <946a3b80-a9f5-99c6-cad5-946f8cf909d7@intel.com>

On Tue, Feb 25, 2020 at 01:26:16PM +0200, Lionel Landwerlin wrote:
> On 25/02/2020 13:22, Lionel Landwerlin wrote:
> > Instead of asserting.
> > 
> > Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> 
> 
> This deserves a
> 
> Fixes: 5f7e4ae6a91e ("tests/perf: reuse the new i915-perf library")


And a

Reviewed-by: Petri Latvala <petri.latvala@intel.com>



> 
> 
> > ---
> > lib/i915/perf.c | 15 +++++++++++----
> > 1 file changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/lib/i915/perf.c b/lib/i915/perf.c
> > index 5b5b7f90..a5dd3eab 100644
> > --- a/lib/i915/perf.c
> > +++ b/lib/i915/perf.c
> > @@ -116,6 +116,13 @@ eu_available(const struct
> > drm_i915_query_topology_info *topo,
> > eu / 8] >> (eu % 8)) & 1;
> > }
> > +static struct intel_perf *
> > +unsupported_i915_perf_platform(struct intel_perf *perf)
> > +{
> > + intel_perf_free(perf);
> > + return NULL;
> > +}
> > +
> > struct intel_perf *
> > intel_perf_for_devinfo(uint32_t device_id,
> > uint32_t revision,
> > @@ -193,7 +200,7 @@ intel_perf_for_devinfo(uint32_t device_id,
> > intel_perf_load_metrics_sklgt4(perf);
> > break;
> > default:
> > - assert(0); /* unreachable */
> > + return unsupported_i915_perf_platform(perf);
> > }
> > } else if (devinfo->is_broxton) {
> > perf->devinfo.eu_threads_count = 6;
> > @@ -207,7 +214,7 @@ intel_perf_for_devinfo(uint32_t device_id,
> > intel_perf_load_metrics_kblgt3(perf);
> > break;
> > default:
> > - assert(0); /* unreachable */
> > + return unsupported_i915_perf_platform(perf);
> > }
> > } else if (devinfo->is_geminilake) {
> > perf->devinfo.eu_threads_count = 6;
> > @@ -221,7 +228,7 @@ intel_perf_for_devinfo(uint32_t device_id,
> > intel_perf_load_metrics_cflgt3(perf);
> > break;
> > default:
> > - assert(0); /* unreachable */
> > + return unsupported_i915_perf_platform(perf);
> > }
> > } else if (devinfo->is_cannonlake) {
> > intel_perf_load_metrics_cnl(perf);
> > @@ -232,7 +239,7 @@ intel_perf_for_devinfo(uint32_t device_id,
> > } else if (devinfo->is_tigerlake) {
> > intel_perf_load_metrics_tgl(perf);
> > } else {
> > - assert(0); /* unreachable */
> > + return unsupported_i915_perf_platform(perf);
> > }
> > return perf;
> 
> 
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-02-25 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 11:22 [igt-dev] [PATCH i-g-t] lib/i915/perf: return NULL when platform is not supported Lionel Landwerlin
2020-02-25 11:26 ` Lionel Landwerlin
2020-02-25 11:32   ` Petri Latvala [this message]
2020-02-25 12:26 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-02-26 15:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20200225113201.GF3839@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lionel.g.landwerlin@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