From patchwork Wed Jul 4 18:59:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10507509 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 22B4B600F5 for ; Wed, 4 Jul 2018 18:59:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DA0A28DEF for ; Wed, 4 Jul 2018 18:59:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BA5928DBB; Wed, 4 Jul 2018 18:59:25 +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 C538428DD7 for ; Wed, 4 Jul 2018 18:59:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36C706EB77; Wed, 4 Jul 2018 18:59:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF7476EB77 for ; Wed, 4 Jul 2018 18:59:22 +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 orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2018 11:59:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,308,1526367600"; d="scan'208";a="69671064" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 04 Jul 2018 11:59:20 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 04 Jul 2018 21:59:19 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Wed, 4 Jul 2018 21:59:14 +0300 Message-Id: <20180704185919.30946-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.16.4 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 1/6] sna: Add SAMPLER_OFFSET() compile time asserts for gen6/7 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä gen8/9 has some compile time asserts to verify the SAMPLER_OFFSET() bits don't exceed their quota of the flags. Add similar asserts for gen6/7. Signed-off-by: Ville Syrjälä --- src/sna/gen6_render.c | 1 + src/sna/gen7_render.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 0a53ef562540..1558750325f0 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -3725,6 +3725,7 @@ static bool gen6_render_setup(struct sna *sna, int devid) } } + COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff); ss = sna_static_stream_map(&general, 2 * sizeof(*ss) * (2 + diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 0a3bda768100..671f60e07679 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -3958,6 +3958,7 @@ static bool gen7_render_setup(struct sna *sna, int devid) assert(state->wm_kernel[m][0]|state->wm_kernel[m][1]|state->wm_kernel[m][2]); } + COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff); ss = sna_static_stream_map(&general, 2 * sizeof(*ss) * (2 +