Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB930C83000 for ; Tue, 28 Apr 2020 18:11:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6C78206A1 for ; Tue, 28 Apr 2020 18:11:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6C78206A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B78889DC5; Tue, 28 Apr 2020 18:11:49 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 310AE89DC5 for ; Tue, 28 Apr 2020 18:11:48 +0000 (UTC) IronPort-SDR: vcv+mSb3qGwVMKjJjTCDNcX61ECgh6WqSodCpwcg1YhokSQZtTyDY+6oOi6WFAQziisI+5RlgU 6MWfnq1jUKTA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 11:11:47 -0700 IronPort-SDR: +l/FPHivrGEjgUMHr5nsyu+XU6cop1FeZByyvZE5uRoEiQngoERIMX68FjOGCmntHh4NlvP07O xMmfDEUIDEWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="336707517" Received: from pbooyens-mobl1.ger.corp.intel.com (HELO [10.252.37.143]) ([10.252.37.143]) by orsmga001.jf.intel.com with ESMTP; 28 Apr 2020 11:11:46 -0700 To: Chris Wilson , intel-gfx@lists.freedesktop.org References: <20200428100816.951014-1-lionel.g.landwerlin@intel.com> <20200428100816.951014-4-lionel.g.landwerlin@intel.com> <158806942253.24122.7411647690599477455@build.alporthouse.com> From: Lionel Landwerlin Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Message-ID: <759399e0-f757-5fa6-d4f8-4eed2e152729@intel.com> Date: Tue, 28 Apr 2020 21:11:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <158806942253.24122.7411647690599477455@build.alporthouse.com> Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH v7 3/4] drm/i915/perf: prepare driver to receive multiple ctx handles X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 28/04/2020 13:23, Chris Wilson wrote: > Quoting Lionel Landwerlin (2020-04-28 11:08:15) >> +static int ctx_id_equal(const void *key, const void *elem) >> +{ >> + const struct i915_perf_context_detail *details = elem; >> + >> + return ((int)details->id) - *((int *)key); >> +} >> + >> +static inline bool ctx_id_match(struct i915_perf_stream *stream, >> + u32 masked_ctx_id) >> +{ >> + return bsearch(&masked_ctx_id, > You might as well just (void *)(uintptr_t)masked_ctx_id and > > static int ctx_id_cmp(const void *key, const void *elem) > { > const struct i915_perf_context_detail *details = elem; > > return details->id - (uinptr_t)key; > } Oops, forgot to add that change. I have it locally and it works fine, will resend tomorrow. -Lionel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx