[igt-dev] [PATCH i-g-t] lib/i915/perf: return NULL when platform is not supported

Petri Latvala petri.latvala at intel.com
Tue Feb 25 11:32:01 UTC 2020


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 at intel.com>
> 
> 
> This deserves a
> 
> Fixes: 5f7e4ae6a91e ("tests/perf: reuse the new i915-perf library")


And a

Reviewed-by: Petri Latvala <petri.latvala at 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list