From patchwork Fri Dec 8 16:29:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 10102935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C224F60360 for ; Fri, 8 Dec 2017 16:29:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B932028E25 for ; Fri, 8 Dec 2017 16:29:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE28428E29; Fri, 8 Dec 2017 16:29:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 467DF28E25 for ; Fri, 8 Dec 2017 16:29:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04FA26E942; Fri, 8 Dec 2017 16:29:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id E1FBF6E93F for ; Fri, 8 Dec 2017 16:29:34 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2017 08:29:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,378,1508828400"; d="scan'208";a="11743155" Received: from delly.ld.intel.com ([10.103.238.204]) by fmsmga001.fm.intel.com with ESMTP; 08 Dec 2017 08:29:33 -0800 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Dec 2017 16:29:20 +0000 Message-Id: <20171208162924.30241-4-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171208162924.30241-1-lionel.g.landwerlin@intel.com> References: <20171208162924.30241-1-lionel.g.landwerlin@intel.com> Subject: [Intel-gfx] [PATCH i-g-t v4 3/7] tests/perf: drop copied i915 defines/structs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Now that we have drm uapi headers in tree, we can drop this stuff. Signed-off-by: Lionel Landwerlin --- tests/perf.c | 114 ++++------------------------------------------------------- 1 file changed, 7 insertions(+), 107 deletions(-) diff --git a/tests/perf.c b/tests/perf.c index a161c45d..08ac106a 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -81,106 +81,6 @@ IGT_TEST_DESCRIPTION("Test the i915 perf metrics streaming interface"); #define PIPE_CONTROL_PPGTT_WRITE (0 << 2) #define PIPE_CONTROL_GLOBAL_GTT_WRITE (1 << 2) -/* Temporarily copy i915-perf uapi here to avoid a dependency on libdrm's - * i915_drm.h copy being updated with the i915-perf interface before this - * test can land in i-g-t. - * - * TODO: remove this once the interface lands in libdrm - */ -#ifndef DRM_I915_PERF_OPEN -#define DRM_I915_PERF_OPEN 0x36 -#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param) - -enum drm_i915_oa_format { - I915_OA_FORMAT_A13 = 1, /* HSW only */ - I915_OA_FORMAT_A29, /* HSW only */ - I915_OA_FORMAT_A13_B8_C8, /* HSW only */ - I915_OA_FORMAT_B4_C8, /* HSW only */ - I915_OA_FORMAT_A45_B8_C8, /* HSW only */ - I915_OA_FORMAT_B4_C8_A16, /* HSW only */ - I915_OA_FORMAT_C4_B8, /* HSW+ */ - - /* Gen8+ */ - I915_OA_FORMAT_A12, - I915_OA_FORMAT_A12_B8_C8, - I915_OA_FORMAT_A32u40_A4u32_B8_C8, - - I915_OA_FORMAT_MAX /* non-ABI */ -}; - -enum drm_i915_perf_property_id { - DRM_I915_PERF_PROP_CTX_HANDLE = 1, - DRM_I915_PERF_PROP_SAMPLE_OA, - DRM_I915_PERF_PROP_OA_METRICS_SET, - DRM_I915_PERF_PROP_OA_FORMAT, - DRM_I915_PERF_PROP_OA_EXPONENT, - - DRM_I915_PERF_PROP_MAX /* non-ABI */ -}; - -struct drm_i915_perf_open_param { - __u32 flags; -#define I915_PERF_FLAG_FD_CLOEXEC (1<<0) -#define I915_PERF_FLAG_FD_NONBLOCK (1<<1) -#define I915_PERF_FLAG_DISABLED (1<<2) - - __u32 num_properties; - __u64 properties_ptr; -}; - -#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0) -#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1) - -struct drm_i915_perf_record_header { - __u32 type; - __u16 pad; - __u16 size; -}; - -enum drm_i915_perf_record_type { - DRM_I915_PERF_RECORD_SAMPLE = 1, - DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2, - DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3, - - DRM_I915_PERF_RECORD_MAX /* non-ABI */ -}; -#endif /* !DRM_I915_PERF_OPEN */ - -/* There is no ifdef we can use for those formats :( */ -enum { - local_I915_OA_FORMAT_A12 = I915_OA_FORMAT_C4_B8 + 1, - local_I915_OA_FORMAT_A12_B8_C8 = I915_OA_FORMAT_C4_B8 + 2, - local_I915_OA_FORMAT_A32u40_A4u32_B8_C8 = I915_OA_FORMAT_C4_B8 + 3, -}; - -#define local_I915_OA_FORMAT_MAX (local_I915_OA_FORMAT_A32u40_A4u32_B8_C8 + 1) - -#ifndef DRM_IOCTL_I915_PERF_ADD_CONFIG - -#define DRM_I915_PERF_ADD_CONFIG 0x37 -#define DRM_I915_PERF_REMOVE_CONFIG 0x38 - -#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config) -#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64) - -/** - * Structure to upload perf dynamic configuration into the kernel. - */ -struct drm_i915_perf_oa_config { - /** String formatted like "%08x-%04x-%04x-%04x-%012x" */ - char uuid[36]; - - __u32 n_mux_regs; - __u32 n_boolean_regs; - __u32 n_flex_regs; - - __u64 mux_regs_ptr; - __u64 boolean_regs_ptr; - __u64 flex_regs_ptr; -}; - -#endif /* !DRM_IOCTL_I915_PERF_ADD_CONFIG */ - struct accumulator { #define MAX_RAW_OA_COUNTERS 62 enum drm_i915_oa_format format; @@ -203,7 +103,7 @@ struct oa_format { int n_c; }; -static struct oa_format hsw_oa_formats[local_I915_OA_FORMAT_MAX] = { +static struct oa_format hsw_oa_formats[I915_OA_FORMAT_MAX] = { [I915_OA_FORMAT_A13] = { /* HSW only */ "A13", .size = 64, .a_off = 12, .n_a = 13, }, @@ -235,16 +135,16 @@ static struct oa_format hsw_oa_formats[local_I915_OA_FORMAT_MAX] = { .b_off = 28, .n_b = 8 }, }; -static struct oa_format gen8_oa_formats[local_I915_OA_FORMAT_MAX] = { - [local_I915_OA_FORMAT_A12] = { +static struct oa_format gen8_oa_formats[I915_OA_FORMAT_MAX] = { + [I915_OA_FORMAT_A12] = { "A12", .size = 64, .a_off = 12, .n_a = 12, .first_a = 7, }, - [local_I915_OA_FORMAT_A12_B8_C8] = { + [I915_OA_FORMAT_A12_B8_C8] = { "A12_B8_C8", .size = 128, .a_off = 12, .n_a = 12, .b_off = 64, .n_b = 8, .c_off = 96, .n_c = 8, .first_a = 7, }, - [local_I915_OA_FORMAT_A32u40_A4u32_B8_C8] = { + [I915_OA_FORMAT_A32u40_A4u32_B8_C8] = { "A32u40_A4u32_B8_C8", .size = 256, .a40_high_off = 160, .a40_low_off = 16, .n_a40 = 32, .a_off = 144, .n_a = 4, .first_a = 32, @@ -368,7 +268,7 @@ __perf_open(int fd, struct drm_i915_perf_open_param *param, bool prevent_pm) static int lookup_format(int i915_perf_fmt_id) { - igt_assert(i915_perf_fmt_id < local_I915_OA_FORMAT_MAX); + igt_assert(i915_perf_fmt_id < I915_OA_FORMAT_MAX); igt_assert(get_oa_format(i915_perf_fmt_id).name); return i915_perf_fmt_id; @@ -1104,7 +1004,7 @@ init_sys_info(void) drm_i915_getparam_t gp; test_set_name = "TestOa"; - test_oa_format = local_I915_OA_FORMAT_A32u40_A4u32_B8_C8; + test_oa_format = I915_OA_FORMAT_A32u40_A4u32_B8_C8; undefined_a_counters = gen8_undefined_a_counters; read_report_ticks = gen8_read_report_ticks; sanity_check_reports = gen8_sanity_check_test_oa_reports;