From patchwork Thu Nov 1 08:35:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 10663681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FD9E157A for ; Thu, 1 Nov 2018 08:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 762C72B8D9 for ; Thu, 1 Nov 2018 08:35:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AB542B8F4; Thu, 1 Nov 2018 08:35:34 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 148102B8D9 for ; Thu, 1 Nov 2018 08:35:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E4A96E438; Thu, 1 Nov 2018 08:35:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4CE286E42E for ; Thu, 1 Nov 2018 08:35:26 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2018 01:35:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,451,1534834800"; d="scan'208";a="270524640" Received: from dgarg1-mobl.amr.corp.intel.com (HELO ldmartin-desk.jf.intel.com) ([10.254.51.253]) by orsmga005.jf.intel.com with ESMTP; 01 Nov 2018 01:35:25 -0700 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Date: Thu, 1 Nov 2018 01:35:12 -0700 Message-Id: <20181101083517.20193-1-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.19.1.1.g56c4683e68 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 0/5] Make GEN macros more similar X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rodrigo Vivi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Jani, Rodrigo, Tvrtko (an whoever jumps in): continuing our conversation here with the real patches so we can debate what's better looking to the implementation. I generated these patches with the following options: - Let IS_GEN() receive 1 or 2 args (besides dev_priv) and use that to compare a single gen in the first case or a range. The idea is that IS_GEN(dev_priv, 4) can be seen as a shortcut to IS_GEN(dev_priv, 4, 4) - Replace IS_GEN with the new macro - Check some cases in which we could be checking a range rather than manual comparisons Last 2 patches is an attempt to convert cases in which we can't use IS_GEN and we resort to INTEL_GEN(dev_priv) to know if it's equal, greater than (gt), greater or equal (ge), less than (lt) or less or equal (le). Actually I have mixed feelings on converting them and maybe we should just let them as is. Let me know what you think. thanks Lucas De Marchi Lucas De Marchi (5): drm/i915: let IS_GEN receive 1 or 2 arguments drm/i915: replace IS_GEN with IS_GEN(..., N) drm/i915: merge gen checks to use range drm/i915: add helper IS_GEN_* macros RFC: drm/i915: convert a few cases to the helper IS_GEN_* macros drivers/gpu/drm/i915/gvt/vgpu.c | 4 +- drivers/gpu/drm/i915/i915_cmd_parser.c | 2 +- drivers/gpu/drm/i915/i915_debugfs.c | 42 ++++---- drivers/gpu/drm/i915/i915_drv.c | 18 ++-- drivers/gpu/drm/i915/i915_drv.h | 23 ++-- drivers/gpu/drm/i915/i915_gem.c | 12 +-- drivers/gpu/drm/i915/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 +- drivers/gpu/drm/i915/i915_gem_fence_reg.c | 10 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 7 +- drivers/gpu/drm/i915/i915_gem_tiling.c | 4 +- drivers/gpu/drm/i915/i915_gpu_error.c | 18 ++-- drivers/gpu/drm/i915/i915_irq.c | 30 +++--- drivers/gpu/drm/i915/i915_perf.c | 4 +- drivers/gpu/drm/i915/i915_reg.h | 4 +- drivers/gpu/drm/i915/i915_suspend.c | 12 +-- drivers/gpu/drm/i915/intel_atomic.c | 2 +- drivers/gpu/drm/i915/intel_audio.c | 2 +- drivers/gpu/drm/i915/intel_cdclk.c | 12 +-- drivers/gpu/drm/i915/intel_crt.c | 6 +- drivers/gpu/drm/i915/intel_ddi.c | 2 +- drivers/gpu/drm/i915/intel_device_info.c | 16 +-- drivers/gpu/drm/i915/intel_display.c | 116 ++++++++++----------- drivers/gpu/drm/i915/intel_dp.c | 32 +++--- drivers/gpu/drm/i915/intel_engine_cs.c | 4 +- drivers/gpu/drm/i915/intel_fbc.c | 24 ++--- drivers/gpu/drm/i915/intel_fifo_underrun.c | 6 +- drivers/gpu/drm/i915/intel_guc_fw.c | 2 +- drivers/gpu/drm/i915/intel_hangcheck.c | 2 +- drivers/gpu/drm/i915/intel_i2c.c | 2 +- drivers/gpu/drm/i915/intel_lrc.c | 6 +- drivers/gpu/drm/i915/intel_lvds.c | 4 +- drivers/gpu/drm/i915/intel_mocs.c | 4 +- drivers/gpu/drm/i915/intel_overlay.c | 10 +- drivers/gpu/drm/i915/intel_panel.c | 8 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 8 +- drivers/gpu/drm/i915/intel_pm.c | 86 +++++++-------- drivers/gpu/drm/i915/intel_psr.c | 10 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 28 ++--- drivers/gpu/drm/i915/intel_ringbuffer.h | 4 +- drivers/gpu/drm/i915/intel_runtime_pm.c | 2 +- drivers/gpu/drm/i915/intel_sprite.c | 14 +-- drivers/gpu/drm/i915/intel_uc.c | 2 +- drivers/gpu/drm/i915/intel_uncore.c | 22 ++-- drivers/gpu/drm/i915/intel_wopcm.c | 4 +- 46 files changed, 328 insertions(+), 316 deletions(-) --- 2.19.1.1.g56c4683e68