From patchwork Thu Sep 19 16:30:53 2019 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: 11152881 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D57FB13BD for ; Thu, 19 Sep 2019 16:31:20 +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 BE1AA218AF for ; Thu, 19 Sep 2019 16:31:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE1AA218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 3DBA86F528; Thu, 19 Sep 2019 16:31:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A2536F528 for ; Thu, 19 Sep 2019 16:31:19 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="181527201" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 19 Sep 2019 09:31:16 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:16 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:30:53 +0300 Message-Id: <20190919163113.17402-2-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 01/21] sna: Use -Wno-clobbered 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" From: Ville Syrjälä ../src/sna/sna_composite.c:567:11: warning: variable ‘sx’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] int16_t sx = src_x + tx - (dst->pDrawable->x + dst_x); ^~ etc. I had a quick look at a few of the cases and they seemed fine to me, so feels like gcc just being dense. Signed-off-by: Ville Syrjälä --- src/sna/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sna/meson.build b/src/sna/meson.build index 5631d4d8047f..4af181f37b29 100644 --- a/src/sna/meson.build +++ b/src/sna/meson.build @@ -135,5 +135,6 @@ sna = static_library('sna', '-Wno-unused-parameter', '-Wno-sign-compare', '-Wno-type-limits', + '-Wno-clobbered', ], install : false) From patchwork Thu Sep 19 16:30:54 2019 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: 11152883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1937C1599 for ; Thu, 19 Sep 2019 16:31:24 +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 01934218AF for ; Thu, 19 Sep 2019 16:31:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01934218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 8D7E06F533; Thu, 19 Sep 2019 16:31:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A96A6F533 for ; Thu, 19 Sep 2019 16:31:22 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="178106036" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga007.jf.intel.com with SMTP; 19 Sep 2019 09:31:19 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:19 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:30:54 +0300 Message-Id: <20190919163113.17402-3-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 02/21] sna: Shut up more compiler warns 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" From: Ville Syrjälä Suppress more compiler warnings. Signed-off-by: Ville Syrjälä --- src/sna/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sna/meson.build b/src/sna/meson.build index 4af181f37b29..b1276ab3aa6e 100644 --- a/src/sna/meson.build +++ b/src/sna/meson.build @@ -131,8 +131,11 @@ sna = static_library('sna', c_args : [ '-Wno-missing-field-initializers', '-Wno-unused-but-set-variable', + '-Wno-expansion-to-defined', '-Wno-shift-negative-value', '-Wno-unused-parameter', + '-Wno-unused-function', + '-Wno-unused-variable', '-Wno-sign-compare', '-Wno-type-limits', '-Wno-clobbered', From patchwork Thu Sep 19 16:30:55 2019 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: 11152885 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0FE41599 for ; Thu, 19 Sep 2019 16:31:26 +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 C94F8218AF for ; Thu, 19 Sep 2019 16:31:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C94F8218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 41AFC6F534; Thu, 19 Sep 2019 16:31:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE8046F534 for ; Thu, 19 Sep 2019 16:31:24 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="186853590" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga008.fm.intel.com with SMTP; 19 Sep 2019 09:31:22 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:22 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:30:55 +0300 Message-Id: <20190919163113.17402-4-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 03/21] sna: undef FontSetPrivate() before redefining it 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" From: Ville Syrjälä Avoid the compiler gettings upset about us redefining FontSetPrivate(). Signed-off-by: Ville Syrjälä --- src/sna/sna_accel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 7fd00b9af679..934c8f662bea 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -121,6 +121,7 @@ #if XFONT2_CLIENT_FUNCS_VERSION >= 1 #define AllocateFontPrivateIndex() xfont2_allocate_font_private_index() +#undef FontSetPrivate #define FontSetPrivate(font, idx, data) xfont2_font_set_private(font, idx, data) #endif From patchwork Thu Sep 19 16:30:56 2019 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: 11152887 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A01113BD for ; Thu, 19 Sep 2019 16:31:29 +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 721B8218AF for ; Thu, 19 Sep 2019 16:31:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 721B8218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 E91B26F53B; Thu, 19 Sep 2019 16:31:28 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 822E96F53B for ; Thu, 19 Sep 2019 16:31:27 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="194432207" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by FMSMGA003.fm.intel.com with SMTP; 19 Sep 2019 09:31:25 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:24 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:30:56 +0300 Message-Id: <20190919163113.17402-5-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 04/21] sna: Replace fall through comments with standard form 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" From: Ville Syrjälä gcc doesn't like extra stuff in the fall through comments. Replace them with the standard form. Signed-off-by: Ville Syrjälä --- src/sna/gen4_render.c | 6 +++--- src/sna/gen5_render.c | 6 +++--- src/sna/gen6_render.c | 6 +++--- src/sna/gen7_render.c | 6 +++--- src/sna/gen8_render.c | 6 +++--- src/sna/gen9_render.c | 6 +++--- src/sna/sna_dri2.c | 4 ++-- src/sna/sna_render.h | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index ae26debf049a..5a4f968d0268 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -2019,7 +2019,7 @@ gen4_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: if (mask == NULL && sna_blt_composite__convert(sna, @@ -2071,7 +2071,7 @@ gen4_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->mask, 0)) goto cleanup_src; - /* fall through to fixup */ + /* fall through */ case 1: gen4_composite_channel_convert(&tmp->mask); break; @@ -2328,7 +2328,7 @@ gen4_render_composite_spans(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->base.src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: gen4_composite_channel_convert(&tmp->base.src); break; diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 3d9d35f113aa..3b1f25aacb39 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1972,7 +1972,7 @@ gen5_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: if (mask == NULL && sna_blt_composite__convert(sna, @@ -2023,7 +2023,7 @@ gen5_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->mask, 0)) goto cleanup_src; - /* fall through to fixup */ + /* fall through */ case 1: gen5_composite_channel_convert(&tmp->mask); break; @@ -2268,7 +2268,7 @@ gen5_render_composite_spans(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->base.src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: gen5_composite_channel_convert(&tmp->base.src); break; diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 9eefcbda3e26..1a64d5b915e3 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -2346,7 +2346,7 @@ gen6_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: /* Did we just switch rings to prepare the source? */ if (mask == NULL && @@ -2399,7 +2399,7 @@ gen6_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->mask, 0)) goto cleanup_src; - /* fall through to fixup */ + /* fall through */ case 1: gen6_composite_channel_convert(&tmp->mask); break; @@ -2653,7 +2653,7 @@ gen6_render_composite_spans(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->base.src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: gen6_composite_channel_convert(&tmp->base.src); break; diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index a33ba902d665..f58f39d457dc 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2576,7 +2576,7 @@ gen7_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: /* Did we just switch rings to prepare the source? */ if (mask == NULL && @@ -2629,7 +2629,7 @@ gen7_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->mask, 0)) goto cleanup_src; - /* fall through to fixup */ + /* fall through */ case 1: gen7_composite_channel_convert(&tmp->mask); break; @@ -2863,7 +2863,7 @@ gen7_render_composite_spans(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->base.src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: gen7_composite_channel_convert(&tmp->base.src); break; diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c index 5d09c2cca94f..0955f90e0c37 100644 --- a/src/sna/gen8_render.c +++ b/src/sna/gen8_render.c @@ -2405,7 +2405,7 @@ gen8_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: /* Did we just switch rings to prepare the source? */ if (mask == NULL && @@ -2461,7 +2461,7 @@ gen8_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->mask, 0)) goto cleanup_src; - /* fall through to fixup */ + /* fall through */ case 1: if (!gen8_composite_channel_convert(&tmp->mask)) goto cleanup_mask; @@ -2696,7 +2696,7 @@ gen8_render_composite_spans(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->base.src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: if (!gen8_composite_channel_convert(&tmp->base.src)) goto cleanup_src; diff --git a/src/sna/gen9_render.c b/src/sna/gen9_render.c index 469084990264..06c1f9a32145 100644 --- a/src/sna/gen9_render.c +++ b/src/sna/gen9_render.c @@ -2483,7 +2483,7 @@ gen9_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: /* Did we just switch rings to prepare the source? */ if (mask == NULL && @@ -2539,7 +2539,7 @@ gen9_render_composite(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->mask, 0)) goto cleanup_src; - /* fall through to fixup */ + /* fall through */ case 1: if (!gen9_composite_channel_convert(&tmp->mask)) goto cleanup_mask; @@ -2774,7 +2774,7 @@ gen9_render_composite_spans(struct sna *sna, case 0: if (!gen4_channel_init_solid(sna, &tmp->base.src, 0)) goto cleanup_dst; - /* fall through to fixup */ + /* fall through */ case 1: if (!gen9_composite_channel_convert(&tmp->base.src)) goto cleanup_src; diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 6426a38626af..daa71dc6db30 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -2601,7 +2601,7 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event) sna_dri2_flip(info)) return; - /* else fall through to blit */ + /* fall through */ case SWAP: assert(info->signal); if (can_xchg(info->sna, draw, info->front, info->back)) { @@ -2623,7 +2623,7 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event) DBG(("%s -- requeue failed, errno=%d\n", __FUNCTION__, errno)); assert(info->pending.bo == NULL); assert(info->keepalive == 1); - /* fall through to SwapComplete */ + /* fall through */ case SWAP_COMPLETE: DBG(("%s: %d complete, frame=%d tv=%d.%06d\n", __FUNCTION__, info->type, diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h index 891fc905fad2..7599803211fc 100644 --- a/src/sna/sna_render.h +++ b/src/sna/sna_render.h @@ -823,7 +823,7 @@ sna_get_pixel_from_rgba(uint32_t * pixel, switch (format) { case PICT_x8r8g8b8: alpha = 0xffff; - /* fall through to re-use a8r8g8b8 expansion */ + /* fall through */ case PICT_a8r8g8b8: *pixel = ((alpha >> 8 << 24) | (red >> 8 << 16) | From patchwork Thu Sep 19 16:30:57 2019 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: 11152889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1DE813BD for ; Thu, 19 Sep 2019 16:31:32 +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 89FC7218AF for ; Thu, 19 Sep 2019 16:31:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89FC7218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 293CB6F53C; Thu, 19 Sep 2019 16:31:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C1CC6F53C for ; Thu, 19 Sep 2019 16:31:30 +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 fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="202314665" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 19 Sep 2019 09:31:28 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:27 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:30:57 +0300 Message-Id: <20190919163113.17402-6-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 05/21] sna: Annotate more fall throughs 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" From: Ville Syrjälä Sprinkle fall through comments where needed. Signed-off-by: Ville Syrjälä --- src/intel_module.c | 1 + src/sna/blt.c | 2 ++ src/sna/gen2_render.c | 21 +++++++++++++++++---- src/sna/gen3_render.c | 24 ++++++++++++++++++------ src/sna/sna_accel.c | 3 +++ src/sna/sna_damage.h | 1 + src/sna/sna_display.c | 7 ++++--- src/sna/sna_dri2.c | 2 ++ src/sna/sna_driver.c | 1 + src/sna/sna_render.c | 4 ++-- src/uxa/intel_dri.c | 1 + 11 files changed, 52 insertions(+), 15 deletions(-) diff --git a/src/intel_module.c b/src/intel_module.c index a8c9768ee9f8..171b20d83d33 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -692,6 +692,7 @@ static Bool intel_pci_probe(DriverPtr driver, case PCI_CHIP_I815: if (!hosted()) break; + /* fall through */ default: return FALSE; } diff --git a/src/sna/blt.c b/src/sna/blt.c index cb90437ad5ad..afc719f6dc8c 100644 --- a/src/sna/blt.c +++ b/src/sna/blt.c @@ -1404,6 +1404,7 @@ memcpy_xor(const void *src, void *dst, int bpp, width /= 2; or |= or << 8; } + /* fall through */ case 2: if (width & 1) { do { @@ -1421,6 +1422,7 @@ memcpy_xor(const void *src, void *dst, int bpp, width /= 2; or |= or << 16; } + /* fall through */ case 4: w = width; if (w * 4 == dst_stride && dst_stride == src_stride) { diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index e03c44015701..80f684543149 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -116,10 +116,17 @@ gen2_buf_tiling(uint32_t tiling) { uint32_t v = 0; switch (tiling) { - default: assert(0); - case I915_TILING_Y: v |= BUF_3D_TILE_WALK_Y; - case I915_TILING_X: v |= BUF_3D_TILED_SURFACE; - case I915_TILING_NONE: break; + default: + assert(0); + /* fall through */ + case I915_TILING_Y: + v |= BUF_3D_TILE_WALK_Y; + /* fall through */ + case I915_TILING_X: + v |= BUF_3D_TILED_SURFACE; + /* fall through */ + case I915_TILING_NONE: + break; } return v; } @@ -131,6 +138,7 @@ gen2_get_dst_format(uint32_t format) switch (format) { default: assert(0); + /* fall through */ case PICT_a8r8g8b8: case PICT_x8r8g8b8: return COLR_BUF_ARGB8888 | BIAS; @@ -219,10 +227,13 @@ gen2_sampler_tiling_bits(uint32_t tiling) switch (tiling) { default: assert(0); + /* fall through */ case I915_TILING_Y: bits |= TM0S1_TILE_WALK; + /* fall through */ case I915_TILING_X: bits |= TM0S1_TILED_SURFACE; + /* fall through */ case I915_TILING_NONE: break; } @@ -277,6 +288,7 @@ gen2_emit_texture(struct sna *sna, switch (channel->repeat) { default: assert(0); + /* fall through */ case RepeatNone: wrap_mode_u = TEXCOORDMODE_CLAMP_BORDER; break; @@ -298,6 +310,7 @@ gen2_emit_texture(struct sna *sna, switch (channel->filter) { default: assert(0); + /* fall through */ case PictFilterNearest: filter = (FILTER_NEAREST << TM0S3_MAG_FILTER_SHIFT | FILTER_NEAREST << TM0S3_MIN_FILTER_SHIFT | diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 166635eba055..e0a7d158015a 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -131,9 +131,14 @@ static inline uint32_t gen3_buf_tiling(uint32_t tiling) { uint32_t v = 0; switch (tiling) { - case I915_TILING_Y: v |= BUF_3D_TILE_WALK_Y; - case I915_TILING_X: v |= BUF_3D_TILED_SURFACE; - case I915_TILING_NONE: break; + case I915_TILING_Y: + v |= BUF_3D_TILE_WALK_Y; + /* fall through */ + case I915_TILING_X: + v |= BUF_3D_TILED_SURFACE; + /* fall through */ + case I915_TILING_NONE: + break; } return v; } @@ -400,6 +405,7 @@ static uint32_t gen3_filter(uint32_t filter) switch (filter) { default: assert(0); + /* fall through */ case PictFilterNearest: return (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MIN_FILTER_SHIFT | @@ -1884,9 +1890,14 @@ static uint32_t gen3_ms_tiling(uint32_t tiling) { uint32_t v = 0; switch (tiling) { - case I915_TILING_Y: v |= MS3_TILE_WALK; - case I915_TILING_X: v |= MS3_TILED_SURFACE; - case I915_TILING_NONE: break; + case I915_TILING_Y: + v |= MS3_TILE_WALK; + /* fall through */ + case I915_TILING_X: + v |= MS3_TILED_SURFACE; + /* fall through */ + case I915_TILING_NONE: + break; } return v; } @@ -4981,6 +4992,7 @@ gen3_render_composite_spans(struct sna *sna, switch (tmp->base.src.u.gen3.type) { case SHADER_NONE: assert(0); + /* fall through */ case SHADER_ZERO: if (no_offset) { tmp->prim_emit = gen3_emit_composite_spans_primitive_zero_no_offset; diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 934c8f662bea..8266e86d8fea 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4955,6 +4955,7 @@ try_upload__inplace(PixmapPtr pixmap, RegionRec *region, case I915_TILING_X: if (!sna->kgem.memcpy_to_tiled_x) break; + /* fall through */ default: if (try_upload__tiled_x(pixmap, region, x, y, w, h, bits, stride)) goto done; @@ -8719,6 +8720,7 @@ sna_copy_plane_blt(DrawablePtr source, DrawablePtr drawable, GCPtr gc, } default: assert(0); + /* fall through */ case 8: { uint8_t *src = src_pixmap->devPrivate.ptr; @@ -10123,6 +10125,7 @@ spans_fallback: switch (gc->lineStyle) { default: assert(0); + /* fall through */ case LineSolid: if (gc->lineWidth == 0) { DBG(("%s: miZeroLine\n", __FUNCTION__)); diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h index d5c727eeee34..abdc786863a9 100644 --- a/src/sna/sna_damage.h +++ b/src/sna/sna_damage.h @@ -152,6 +152,7 @@ static inline bool sna_damage_is_all(struct sna_damage **_damage, return false; default: assert(0); + /* fall through */ case DAMAGE_ADD: if (damage->extents.x2 < width || damage->extents.x1 > 0) return false; diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index d6210cc7bbc8..1e62cc40473f 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -8309,7 +8309,7 @@ static bool sna_emit_wait_for_scanline_hsw(struct sna *sna, sna->kgem.nbatch += 17; switch (pipe) { - default: assert(0); + default: assert(0); /* fall through */ case 0: event = 1 << 0; break; case 1: event = 1 << 8; break; case 2: event = 1 << 14; break; @@ -8325,7 +8325,7 @@ static bool sna_emit_wait_for_scanline_hsw(struct sna *sna, /* The documentation says that the LOAD_SCAN_LINES command * always comes in pairs. Don't ask me why. */ switch (pipe) { - default: assert(0); + default: assert(0); /* fall through */ case 0: event = 0 << 19; break; case 1: event = 1 << 19; break; case 2: event = 4 << 19; break; @@ -8334,7 +8334,7 @@ static bool sna_emit_wait_for_scanline_hsw(struct sna *sna, b[9] = b[7] = (y1 << 16) | (y2-1); switch (pipe) { - default: assert(0); + default: assert(0); /* fall through */ case 0: event = 1 << 0; break; case 1: event = 1 << 8; break; case 2: event = 1 << 14; break; @@ -8374,6 +8374,7 @@ static bool sna_emit_wait_for_scanline_ivb(struct sna *sna, switch (pipe) { default: assert(0); + /* fall through */ case 0: event = 1 << (full_height ? 3 : 0); break; diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index daa71dc6db30..5fd4d54b6d70 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -680,6 +680,7 @@ sna_dri2_create_buffer(DrawablePtr draw, (sna->flags & (SNA_LINEAR_FB | SNA_NO_WAIT | SNA_NO_FLIP)) == 0) flags |= CREATE_SCANOUT; } + /* fall through */ case DRI2BufferBackRight: case DRI2BufferFrontRight: case DRI2BufferFakeFrontLeft: @@ -2944,6 +2945,7 @@ static void sna_dri2_flip_event(struct sna_dri2_event *flip) DBG(("%s: triple buffer swap complete, unblocking client\n", __FUNCTION__)); frame_swap_complete(flip, DRI2_FLIP_COMPLETE); } + /* fall through */ case FLIP_COMPLETE: assert(!flip->signal); if (sna->dri2.flip_pending) { diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 754b2d4f130d..4f8895f1eda2 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -603,6 +603,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int probe) if ((sna->flags & SNA_IS_HOSTED) || fb_supports_depth(fd, scrn->depth)) break; + /* fall through */ default: xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported by the Intel driver and this chipset.\n", diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 1787ffae4874..904d44004d44 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -58,7 +58,7 @@ sna_format_for_depth(int depth) case 8: return PICT_a8; case 15: return PICT_x1r5g5b5; case 16: return PICT_r5g6b5; - default: assert(0); + default: assert(0); /* fall through */ case 24: return PICT_x8r8g8b8; #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,6,99,900,0) case 30: return PICT_x2r10g10b10; @@ -77,7 +77,7 @@ sna_render_format_for_depth(int depth) case 15: return PIXMAN_a1r5g5b5; case 16: return PIXMAN_r5g6b5; case 30: return PIXMAN_a2r10g10b10; - default: assert(0); + default: assert(0); /* fall through */ case 24: case 32: return PIXMAN_a8r8g8b8; } diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c index 524826d24082..e707b74f091f 100644 --- a/src/uxa/intel_dri.c +++ b/src/uxa/intel_dri.c @@ -302,6 +302,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, hint |= INTEL_CREATE_PIXMAP_TILING_Y; break; } + /* fall through */ case DRI2BufferAccum: case DRI2BufferBackLeft: case DRI2BufferBackRight: From patchwork Thu Sep 19 16:30:58 2019 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: 11152891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE1531599 for ; Thu, 19 Sep 2019 16:31:35 +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 A6271218AF for ; Thu, 19 Sep 2019 16:31:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6271218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 1EDBF6F681; Thu, 19 Sep 2019 16:31:35 +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 BC5436F53D for ; Thu, 19 Sep 2019 16:31:33 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="199451847" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 19 Sep 2019 09:31:31 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:30 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:30:58 +0300 Message-Id: <20190919163113.17402-7-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 06/21] sna: Add sna_br13_color_depth() 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" From: Ville Syrjälä Refactor the BR13 color depth setup to common helper. This eliminates a bunch of implicit fall through warns. Signed-off-by: Ville Syrjälä --- src/sna/kgem.c | 10 +++------ src/sna/sna.h | 19 ++++++++++++++++ src/sna/sna_blt.c | 56 ++++++++++------------------------------------- src/sna/sna_io.c | 30 ++++++++----------------- 4 files changed, 43 insertions(+), 72 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index d396f1b40dbc..9c0708a635fb 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -8148,13 +8148,9 @@ kgem_replace_bo(struct kgem *kgem, } br13 |= 0xcc << 16; - switch (bpp) { - default: - case 32: br00 |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; - br13 |= 1 << 25; /* RGB8888 */ - case 16: br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + br13 |= sna_br13_color_depth(bpp); + if (bpp == 32) + br00 |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; b = kgem->batch + kgem->nbatch; if (kgem->gen >= 0100) { diff --git a/src/sna/sna.h b/src/sna/sna.h index cf2a7a519f29..f2bc189624a5 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -1397,4 +1397,23 @@ static inline void add_shm_flush(struct sna *sna, struct sna_pixmap *priv) sna->needs_shm_flush = true; } +static inline uint32_t sna_br13_color_depth(int bpp) +{ + uint32_t br13 = 0; + + switch (bpp) { + default: + assert(0); + /* fall through */ + case 32: + br13 |= 1 << 25; /* RGB8888 */ + /* fall through */ + case 16: + br13 |= 1 << 24; /* RGB565 */ + /* fall through */ + case 8: + return br13; + } +} + #endif /* _SNA_H */ diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index 61e2b0feaf35..005224363b9c 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -154,12 +154,7 @@ static bool sna_blt_fill_init(struct sna *sna, } blt->br13 |= 1<<31 | (fill_ROP[alu] << 16); - switch (bpp) { - default: assert(0); - case 32: blt->br13 |= 1 << 25; /* RGB8888 */ - case 16: blt->br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + blt->br13 |= sna_br13_color_depth(bpp); blt->pixel = pixel; blt->bpp = bpp; @@ -372,12 +367,7 @@ static bool sna_blt_copy_init(struct sna *sna, blt->overwrites = alu == GXcopy || alu == GXclear || alu == GXset; blt->br13 = (copy_ROP[alu] << 16) | blt->pitch[1]; - switch (bpp) { - default: assert(0); - case 32: blt->br13 |= 1 << 25; /* RGB8888 */ - case 16: blt->br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + blt->br13 |= sna_br13_color_depth(bpp); kgem_set_mode(kgem, KGEM_BLT, dst); if (!kgem_check_many_bo_fenced(kgem, src, dst, NULL)) { @@ -425,13 +415,10 @@ static bool sna_blt_alpha_fixup_init(struct sna *sna, blt->overwrites = 1; blt->br13 = (0xfc << 16) | blt->pitch[1]; - switch (bpp) { - default: assert(0); - case 32: blt->cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; - blt->br13 |= 1 << 25; /* RGB8888 */ - case 16: blt->br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + blt->br13 |= sna_br13_color_depth(bpp); + if (bpp == 32) + blt->cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; + blt->pixel = alpha; kgem_set_mode(kgem, KGEM_BLT, dst); @@ -3356,13 +3343,9 @@ static bool sna_blt_fill_box(struct sna *sna, uint8_t alu, assert(br13 <= MAXSHORT); br13 |= fill_ROP[alu] << 16; - switch (bpp) { - default: assert(0); - case 32: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; - br13 |= 1 << 25; /* RGB8888 */ - case 16: br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + br13 |= sna_br13_color_depth(bpp); + if (bpp == 32) + cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; /* All too frequently one blt completely overwrites the previous */ overwrites = alu == GXcopy || alu == GXclear || alu == GXset; @@ -3517,12 +3500,7 @@ bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu, assert(br13 <= MAXSHORT); br13 |= 1<<31 | fill_ROP[alu] << 16; - switch (bpp) { - default: assert(0); - case 32: br13 |= 1 << 25; /* RGB8888 */ - case 16: br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + br13 |= sna_br13_color_depth(bpp); kgem_set_mode(kgem, KGEM_BLT, bo); if (!kgem_check_batch(kgem, 14) || @@ -3739,12 +3717,7 @@ bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu, assert(br13 <= MAXSHORT); br13 |= copy_ROP[alu] << 16; - switch (bpp) { - default: assert(0); - case 32: br13 |= 1 << 25; /* RGB8888 */ - case 16: br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + br13 |= sna_br13_color_depth(bpp); /* Compare first box against a previous fill */ if ((alu == GXcopy || alu == GXclear || alu == GXset) && @@ -4086,12 +4059,7 @@ bool sna_blt_copy_boxes__with_alpha(struct sna *sna, uint8_t alu, assert(br13 <= MAXSHORT); br13 |= copy_ROP[alu] << 16; - switch (bpp) { - default: assert(0); - case 32: br13 |= 1 << 25; /* RGB8888 */ - case 16: br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + br13 |= sna_br13_color_depth(bpp); kgem_set_mode(kgem, KGEM_BLT, dst_bo); if (!kgem_check_many_bo_fenced(kgem, dst_bo, src_bo, NULL)) { diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index d32bd583fc42..d03280edb7a7 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -465,13 +465,9 @@ fallback: } br13 = 0xcc << 16; - switch (cpp) { - default: - case 4: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; - br13 |= 1 << 25; /* RGB8888 */ - case 2: br13 |= 1 << 24; /* RGB565 */ - case 1: break; - } + br13 |= sna_br13_color_depth(cpp * 4); + if (cpp == 4) + cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; kgem_set_mode(kgem, KGEM_BLT, dst_bo); if (!kgem_check_batch(kgem, 10) || @@ -1042,13 +1038,9 @@ tile: br13 >>= 2; } br13 |= 0xcc << 16; - switch (dst->drawable.bitsPerPixel) { - default: - case 32: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; - br13 |= 1 << 25; /* RGB8888 */ - case 16: br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + br13 |= sna_br13_color_depth(dst->drawable.bitsPerPixel); + if (dst->drawable.bitsPerPixel == 32) + cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; kgem_set_mode(kgem, KGEM_BLT, dst_bo); if (!kgem_check_batch(kgem, 10) || @@ -1548,13 +1540,9 @@ tile: br13 >>= 2; } br13 |= 0xcc << 16; - switch (dst->drawable.bitsPerPixel) { - default: - case 32: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; - br13 |= 1 << 25; /* RGB8888 */ - case 16: br13 |= 1 << 24; /* RGB565 */ - case 8: break; - } + br13 |= sna_br13_color_depth(dst->drawable.bitsPerPixel); + if (dst->drawable.bitsPerPixel == 32) + cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB; kgem_set_mode(kgem, KGEM_BLT, dst_bo); if (!kgem_check_batch(kgem, 10) || From patchwork Thu Sep 19 16:30:59 2019 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: 11152893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 335C31599 for ; Thu, 19 Sep 2019 16:31:39 +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 1C05E21924 for ; Thu, 19 Sep 2019 16:31:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C05E21924 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 766D16F53D; Thu, 19 Sep 2019 16:31:38 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 715E26F53D for ; Thu, 19 Sep 2019 16:31:36 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="188138319" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga007.fm.intel.com with SMTP; 19 Sep 2019 09:31:33 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:33 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:30:59 +0300 Message-Id: <20190919163113.17402-8-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 07/21] sna/fb: Eliminate implicit fallthrough 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" From: Ville Syrjälä Duplicate a bit of code in FbDoLeftMaskByteRRop() switch statement to avoid the fall through. And while at it sort the cases based on the left byte and length. Makes the pattern matcher in my brain much happier. Signed-off-by: Ville Syrjälä --- src/sna/fb/fb.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h index 904317478e8a..ee5da97b458c 100644 --- a/src/sna/fb/fb.h +++ b/src/sna/fb/fb.h @@ -185,11 +185,13 @@ typedef int FbStride; FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ + case sizeof (FbBits) - 3: \ + FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ + FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \ + break; \ case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ - case sizeof (FbBits) - 3: \ - FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ case sizeof (FbBits) - 2: \ FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \ break; \ From patchwork Thu Sep 19 16:31:00 2019 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: 11152895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FBDD13BD for ; Thu, 19 Sep 2019 16:31:42 +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 57FB8218AF for ; Thu, 19 Sep 2019 16:31:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57FB8218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 E61D96F682; Thu, 19 Sep 2019 16:31:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED9ED6F75D for ; Thu, 19 Sep 2019 16:31:38 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="271275091" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga001.jf.intel.com with SMTP; 19 Sep 2019 09:31:36 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:36 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:00 +0300 Message-Id: <20190919163113.17402-9-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 08/21] uxa: Use named initializers 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" From: Ville Syrjälä Silence the compiler warning about missing initializers by using named initializers. Signed-off-by: Ville Syrjälä --- src/uxa/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c index 809cda1dd56b..ba4b8d87412c 100644 --- a/src/uxa/intel_display.c +++ b/src/uxa/intel_display.c @@ -1818,7 +1818,7 @@ error_out: } static const xf86CrtcConfigFuncsRec intel_xf86crtc_config_funcs = { - intel_xf86crtc_resize + .resize = intel_xf86crtc_resize, }; /* From patchwork Thu Sep 19 16:31:01 2019 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: 11152897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8D5C1599 for ; Thu, 19 Sep 2019 16:31:45 +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 A0F3D218AF for ; Thu, 19 Sep 2019 16:31:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0F3D218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 26AE56F792; Thu, 19 Sep 2019 16:31:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8EDA36F792 for ; Thu, 19 Sep 2019 16:31:42 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="192097158" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga006.jf.intel.com with SMTP; 19 Sep 2019 09:31:39 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:39 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:01 +0300 Message-Id: <20190919163113.17402-10-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 09/21] Avoid missing initializer warning 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" From: Ville Syrjälä Use an empty {} as the terminator in intel_device_match[] to avoid the warning about missing initlizers. Signed-off-by: Ville Syrjälä --- src/intel_module.c | 2 +- src/meson.build | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/intel_module.c b/src/intel_module.c index 171b20d83d33..a71c2e40b774 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -388,7 +388,7 @@ static const struct pci_id_match intel_device_match[] = { INTEL_VGA_DEVICE(PCI_MATCH_ANY, &intel_generic_info), #endif - { 0, 0, 0 }, + {}, }; void diff --git a/src/meson.build b/src/meson.build index 0a46e233a94c..1125c65b73be 100644 --- a/src/meson.build +++ b/src/meson.build @@ -150,7 +150,6 @@ shared_module('intel_drv', '-DMAJOR_IN_SYSMACROS', '-Wno-unused-parameter', '-Wno-sign-compare', - '-Wno-missing-field-initializers', ], name_prefix : '', install_dir : join_paths(moduledir, 'drivers'), From patchwork Thu Sep 19 16:31:02 2019 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: 11152899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 226241599 for ; Thu, 19 Sep 2019 16:31: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 0ABC5218AF for ; Thu, 19 Sep 2019 16:31:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0ABC5218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 799606F7CA; Thu, 19 Sep 2019 16:31:48 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id C19666F7CF for ; Thu, 19 Sep 2019 16:31:47 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="217356839" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 19 Sep 2019 09:31:42 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:42 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:02 +0300 Message-Id: <20190919163113.17402-11-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 10/21] sna: Use named initializers 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" From: Ville Syrjälä Avoid -Wno-missing-field-initializers by using named initializers. Signed-off-by: Ville Syrjälä --- src/sna/meson.build | 1 - src/sna/sna_composite.c | 2 +- src/sna/sna_display.c | 6 +++--- src/sna/sna_display_fake.c | 2 +- src/sna/sna_video_overlay.c | 6 +++++- src/sna/sna_video_sprite.c | 8 +++++++- src/sna/sna_video_textured.c | 5 ++++- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/sna/meson.build b/src/sna/meson.build index b1276ab3aa6e..9e4b69f45e55 100644 --- a/src/sna/meson.build +++ b/src/sna/meson.build @@ -129,7 +129,6 @@ sna = static_library('sna', link_with : [ brw, fb, ], include_directories : inc, c_args : [ - '-Wno-missing-field-initializers', '-Wno-unused-but-set-variable', '-Wno-expansion-to-defined', '-Wno-shift-negative-value', diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index 1da8c29155b4..3a8e86845069 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -1074,7 +1074,7 @@ sna_composite_rectangles(CARD8 op, } } else { for (i = 0; i < num_boxes; i++) { - RegionRec tmp = { boxes[i] }; + RegionRec tmp = { .extents = boxes[i], }; if (pixman_region_intersect(&tmp, &tmp, dst->pCompositeClip)) { int n = 0; diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 1e62cc40473f..5c522011e056 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -7316,7 +7316,7 @@ next_crtc: } static const xf86CrtcConfigFuncsRec sna_mode_funcs = { - sna_mode_resize + .resize = sna_mode_resize, }; static void set_size_range(struct sna *sna) @@ -7784,7 +7784,7 @@ static bool has_flip__async(struct sna *sna) struct local_get_cap { uint64_t name; uint64_t value; - } cap = { DRM_CAP_ASYNC_PAGE_FLIP }; + } cap = { .name = DRM_CAP_ASYNC_PAGE_FLIP, }; if (sna->flags & SNA_NO_FLIP) return false; @@ -9682,7 +9682,7 @@ fixup_flip: __FUNCTION__, __sna_crtc_id(crtc), crtc->flip_bo->handle, crtc->flip_bo->active_scanout, crtc->flip_serial)); { - struct drm_i915_gem_busy busy = { flip_bo->handle }; + struct drm_i915_gem_busy busy = { .handle = flip_bo->handle, }; if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy) == 0) { if (busy.busy) { int mode = KGEM_RENDER; diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c index fa26bda138d7..401e9a066534 100644 --- a/src/sna/sna_display_fake.c +++ b/src/sna/sna_display_fake.c @@ -221,7 +221,7 @@ sna_mode_resize(ScrnInfoPtr scrn, int width, int height) } static const xf86CrtcConfigFuncsRec sna_mode_funcs = { - sna_mode_resize + .resize = sna_mode_resize, }; static bool add_fake_output(struct sna *sna, bool late) diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c index 9bc5ce40dc94..7c7bb4833662 100644 --- a/src/sna/sna_video_overlay.c +++ b/src/sna/sna_video_overlay.c @@ -56,7 +56,11 @@ static Atom xvGamma0, xvGamma1, xvGamma2, xvGamma3, xvGamma4, xvGamma5; #define IMAGE_MAX_WIDTH_LEGACY 1024 #define IMAGE_MAX_HEIGHT_LEGACY 1088 -static XvFormatRec Formats[] = { {15}, {16}, {24} }; +static XvFormatRec Formats[] = { + { .depth = 15, }, + { .depth = 16, }, + { .depth = 24, }, +}; static const XvAttributeRec Attributes[] = { {XvSettable | XvGettable, 0, (1 << 24) - 1, (char *)"XV_COLORKEY"}, diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c index da676ad658fc..711a2fb261c0 100644 --- a/src/sna/sna_video_sprite.c +++ b/src/sna/sna_video_sprite.c @@ -72,7 +72,13 @@ struct local_mode_set_plane { static Atom xvColorKey, xvAlwaysOnTop, xvSyncToVblank, xvColorspace; -static XvFormatRec formats[] = { {8}, {15}, {16}, {24}, {30} }; +static XvFormatRec formats[] = { + { .depth = 8, }, + { .depth = 15, }, + { .depth = 16, }, + { .depth = 24, }, + { .depth = 30, }, +}; static const XvImageRec images[] = { XVIMAGE_YUY2, XVIMAGE_UYVY, XVMC_RGB888 }; static const XvImageRec images_rgb565[] = { XVIMAGE_YUY2, XVIMAGE_UYVY, diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index 06da36d03c03..6e30461d43be 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -39,7 +39,10 @@ static Atom xvBrightness, xvContrast, xvSyncToVblank, xvColorspace; static XvFormatRec Formats[] = { - {15}, {16}, {24}, {30} + { .depth = 15, }, + { .depth = 16, }, + { .depth = 24, }, + { .depth = 30, }, }; static const XvAttributeRec Attributes[] = { From patchwork Thu Sep 19 16:31:03 2019 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: 11152901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6D5A13BD for ; Thu, 19 Sep 2019 16:31:52 +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 AEE57218AF for ; Thu, 19 Sep 2019 16:31:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEE57218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 322436F75D; Thu, 19 Sep 2019 16:31:52 +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 D63DE6F7CF for ; Thu, 19 Sep 2019 16:31:49 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="181527406" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 19 Sep 2019 09:31:47 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:46 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:03 +0300 Message-Id: <20190919163113.17402-12-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 11/21] sna: Increase the size of the path name buffer a bit 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" From: Ville Syrjälä ../src/intel_device.c: In function ‘__intel_open_device__pci.isra.6’: ../src/intel_device.c:321:25: warning: ‘%s’ directive writing up to 255 bytes into a region of size 247 [-Wformat-overflow=] sprintf(path + base, "%s", de->d_name); Signed-off-by: Ville Syrjälä --- src/intel_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel_device.c b/src/intel_device.c index 219550731500..f28d3be11796 100644 --- a/src/intel_device.c +++ b/src/intel_device.c @@ -301,9 +301,9 @@ static int open_cloexec(const char *path) #ifdef __linux__ static int __intel_open_device__major_minor(int _major, int _minor) { - char path[256]; DIR *dir; struct dirent *de; + char path[9+sizeof(de->d_name)]; int base, fd = -1; base = sprintf(path, "/dev/dri/"); From patchwork Thu Sep 19 16:31:04 2019 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: 11152903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 58F2D1599 for ; Thu, 19 Sep 2019 16:31:55 +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 41A8D218AF for ; Thu, 19 Sep 2019 16:31:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41A8D218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 CD4456F7CF; Thu, 19 Sep 2019 16:31:54 +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 EFF446F7E2 for ; Thu, 19 Sep 2019 16:31:52 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="178106128" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga007.jf.intel.com with SMTP; 19 Sep 2019 09:31:50 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:49 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:04 +0300 Message-Id: <20190919163113.17402-13-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 12/21] sna: Use memcmp() to avoid strict aliasing warns 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" From: Ville Syrjälä ../src/sna/sna_display.c: In function ‘sna_covering_crtc’: ../src/sna/sna_display.c:8235:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (*(const uint64_t *)box == *(uint64_t *)&crtc->bounds) { Signed-off-by: Ville Syrjälä --- src/sna/sna_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 5c522011e056..5c377cf2d86d 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -8232,7 +8232,7 @@ sna_covering_crtc(struct sna *sna, const BoxRec *box, xf86CrtcPtr desired) __FUNCTION__, c, crtc->bounds.x1, crtc->bounds.y1, crtc->bounds.x2, crtc->bounds.y2)); - if (*(const uint64_t *)box == *(uint64_t *)&crtc->bounds) { + if (!memcmp(box, &crtc->bounds, sizeof(*box))) { DBG(("%s: box exactly matches crtc [%d]\n", __FUNCTION__, c)); return crtc; From patchwork Thu Sep 19 16:31:05 2019 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: 11152905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB3611599 for ; Thu, 19 Sep 2019 16:31:57 +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 93A6B218AF for ; Thu, 19 Sep 2019 16:31:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93A6B218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 10F026F7E3; Thu, 19 Sep 2019 16:31:57 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C7C76F7E3 for ; Thu, 19 Sep 2019 16:31:55 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="186853734" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga008.fm.intel.com with SMTP; 19 Sep 2019 09:31:53 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:52 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:05 +0300 Message-Id: <20190919163113.17402-14-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 13/21] sna: Avoid strict aliasing violations with glyphinfo 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" From: Ville Syrjälä Just access the xGlyphInfo members directly to avoid the compiler getting upset about strict aliasing violations. Signed-off-by: Ville Syrjälä --- src/sna/sna_glyphs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 6ee403360226..ebc061b5a8a8 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -85,8 +85,11 @@ #define NO_ATLAS ((PicturePtr)-1) #define GLYPH_TOLERANCE 3 -#define glyph_valid(g) *((uint32_t *)&(g)->info.width) -#define glyph_copy_size(r, g) *(uint32_t *)&(r)->width = *(uint32_t *)&g->info.width +#define glyph_valid(g) ((g)->info.width || (g)->info.height) +#define glyph_copy_size(r, g) do { \ + (r)->width = (g)->info.width; \ + (r)->height = (g)->info.height; \ +} while (0) #if HAS_PIXMAN_GLYPHS static pixman_glyph_cache_t *__global_glyph_cache; From patchwork Thu Sep 19 16:31:06 2019 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: 11152907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E641D13BD for ; Thu, 19 Sep 2019 16:31:59 +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 CE5A7218AF for ; Thu, 19 Sep 2019 16:31:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE5A7218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 677A36F7EE; Thu, 19 Sep 2019 16:31:59 +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 CE8746F7E2 for ; Thu, 19 Sep 2019 16:31:58 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:31:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="194432423" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by FMSMGA003.fm.intel.com with SMTP; 19 Sep 2019 09:31:56 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:55 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:06 +0300 Message-Id: <20190919163113.17402-15-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 14/21] sna/fb: Use memcpy() to avoid strict aliasing violations 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" From: Ville Syrjälä Replace the cast+deref with memcpy() so that we don't upset the compiler's strict aliasing rules. Signed-off-by: Ville Syrjälä --- src/sna/fb/fbspan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sna/fb/fbspan.c b/src/sna/fb/fbspan.c index 45cb7cc7bd6c..18136c200458 100644 --- a/src/sna/fb/fbspan.c +++ b/src/sna/fb/fbspan.c @@ -39,12 +39,13 @@ fbFillSpans(DrawablePtr drawable, GCPtr gc, while (n--) { BoxRec box; - *(DDXPointPtr)&box = *pt++; + memcpy(&box, pt, sizeof(box)); box.x2 = box.x1 + *width++; box.y2 = box.y1 + 1; /* XXX fSorted */ fbDrawableRun(drawable, gc, &box, fbFillSpan, NULL); + pt++; } } @@ -91,7 +92,8 @@ fbSetSpans(DrawablePtr drawable, GCPtr gc, while (n--) { BoxRec box; - *(DDXPointPtr)&box = data.pt = *pt; + memcpy(&box, pt, sizeof(box)); + data.pt = *pt; box.x2 = box.x1 + *width; box.y2 = box.y1 + 1; From patchwork Thu Sep 19 16:31:07 2019 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: 11152909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E82013BD for ; Thu, 19 Sep 2019 16:32:04 +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 26AE2218AF for ; Thu, 19 Sep 2019 16:32:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26AE2218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 A2A486F7F3; Thu, 19 Sep 2019 16:32:03 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF6D56F7E2 for ; Thu, 19 Sep 2019 16:32:00 +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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="202314814" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 19 Sep 2019 09:31:58 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:31:58 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:07 +0300 Message-Id: <20190919163113.17402-16-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 15/21] xvmc: Eliminate strict aliasing violations 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" From: Ville Syrjälä Just access both halves of the motion vector thing directly instead of doung the cast to uint and deref. Signed-off-by: Ville Syrjälä --- src/legacy/i810/xvmc/I810XvMC.c | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/legacy/i810/xvmc/I810XvMC.c b/src/legacy/i810/xvmc/I810XvMC.c index a538e9991602..6780bba06b2c 100644 --- a/src/legacy/i810/xvmc/I810XvMC.c +++ b/src/legacy/i810/xvmc/I810XvMC.c @@ -1246,8 +1246,8 @@ static __inline__ void renderFieldinField(uint **datay,uint **datau, *dy++ = (1<<30) | (3<<28) | dw1; *dy++ = xy; *dy++ = (16<<16) | 16; - *dy++ = *(uint *)fmv; - *dy++ = *(uint *)bmv; + *dy++ = fmv[1] << 16 | fmv[0]; + *dy++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(dy,block_ptr,ysize); block_ptr = (short *)((unsigned long)block_ptr + ysize); /* End Y Blocks */ @@ -1263,8 +1263,8 @@ static __inline__ void renderFieldinField(uint **datay,uint **datau, *du++ = (2<<30) | (1<<28) | dw1; *du++ = xy; *du++ = (8<<16) | 8; - *du++ = *(uint *)fmv; - *du++ = *(uint *)bmv; + *du++ = fmv[1] << 16 | fmv[0]; + *du++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(du,block_ptr,usize); block_ptr = (short *)((unsigned long)block_ptr + usize); @@ -1273,8 +1273,8 @@ static __inline__ void renderFieldinField(uint **datay,uint **datau, *dv++ = (3<<30) | (1<<28) | dw1; *dv++ = xy; *dv++ = (8<<16) | 8; - *dv++ = *(uint *)fmv; - *dv++ = *(uint *)bmv; + *dv++ = fmv[1] << 16 | fmv[0]; + *dv++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(dv,block_ptr,vsize); block_ptr = (short *)((unsigned long)block_ptr + vsize); @@ -1394,8 +1394,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau, *dy++ = (1<<30) | (2<<28) | dw1[0]; *dy++ = xy; *dy++ = (8<<16) | 16; - *dy++ = *(uint *)fmv; - *dy++ = *(uint *)bmv; + *dy++ = fmv[1] << 16 | fmv[0]; + *dy++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(dy,block_ptr,y1size); block_ptr = (short *)((unsigned long)block_ptr + y1size); @@ -1404,8 +1404,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau, *dy++ = (1<<30) | (2<<28) | dw1[1]; *dy++ = (xy + 8); *dy++ = (8<<16) | 16; - *dy++ = *(uint *)&fmv[2]; - *dy++ = *(uint *)&bmv[2]; + *dy++ = fmv[3] << 16 | fmv[2]; + *dy++ = bmv[3] << 16 | bmv[2]; PACK_CORR_DATA(dy,block_ptr,y2size); block_ptr = (short *)((unsigned long)block_ptr + y2size); /* End Y Blocks */ @@ -1427,8 +1427,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau, *du++ = (2<<30) | (1<<28) | dw1[0]; *du++ = xy; *du++ = (4<<16) | 8; - *du++ = *(uint *)fmv; - *du++ = *(uint *)bmv; + *du++ = fmv[1] << 16 | fmv[0]; + *du++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(du,block_ptr,usize); block_ptr = (short *)((unsigned long)block_ptr + usize); @@ -1437,8 +1437,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau, *du++ = (2<<30) | (1<<28) | dw1[1]; *du++ = (xy + 4); *du++ = (4<<16) | 8; - *du++ = *(uint *)&fmv[2]; - *du++ = *(uint *)&bmv[2]; + *du++ = fmv[3] << 16 | fmv[2]; + *du++ = bmv[3] << 16 | bmv[2]; PACK_CORR_DATA(du,block_ptr,usize); block_ptr = (short *)((unsigned long)block_ptr + usize); /* End U Blocks */ @@ -1448,8 +1448,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau, *dv++ = (3<<30) | (1<<28) | dw1[0]; *dv++ = xy; *dv++ = (4<<16) | 8; - *dv++ = *(uint *)fmv; - *dv++ = *(uint *)bmv; + *dv++ = fmv[1] << 16 | fmv[0]; + *dv++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(dv,block_ptr,vsize); block_ptr = (short *)((unsigned long)block_ptr + vsize); @@ -1458,8 +1458,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau, *dv++ = (3<<30) | (1<<28) | dw1[1]; *dv++ = (xy + 4); *dv++ = (4<<16) | 8; - *dv++ = *(uint *)&fmv[2]; - *dv++ = *(uint *)&bmv[2]; + *dv++ = fmv[3] << 16 | fmv[2]; + *dv++ = bmv[3] << 16 | bmv[2]; PACK_CORR_DATA(dv,block_ptr,vsize); block_ptr = (short *)((unsigned long)block_ptr + vsize); /* End V Blocks */ @@ -1513,8 +1513,8 @@ static __inline__ void renderDualPrimeinField(uint **datay,uint **datau, *dy++ = (1<<30) | (3<<28) | dw1; *dy++ = xy; *dy++ = (16<<16) | 16; - *dy++ = *(uint *)fmv; - *dy++ = *(uint *)bmv; + *dy++ = fmv[1] << 16 | fmv[0]; + *dy++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(dy,block_ptr,ysize); block_ptr = (short *)((unsigned long)block_ptr + ysize); /* End Y Blocks */ @@ -1530,8 +1530,8 @@ static __inline__ void renderDualPrimeinField(uint **datay,uint **datau, *du++ = (2<<30) | (1<<28) | dw1; *du++ = xy; *du++ = (8<<16) | 8; - *du++ = *(uint *)fmv; - *du++ = *(uint *)bmv; + *du++ = fmv[1] << 16 | fmv[0]; + *du++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(du,block_ptr,usize); block_ptr = (short *)((unsigned long)block_ptr + usize); @@ -1540,8 +1540,8 @@ static __inline__ void renderDualPrimeinField(uint **datay,uint **datau, *dv++ = (3<<30) | (1<<28) | dw1; *dv++ = xy; *dv++ = (8<<16) | 8; - *dv++ = *(uint *)fmv; - *dv++ = *(uint *)bmv; + *dv++ = fmv[1] << 16 | fmv[0]; + *dv++ = bmv[1] << 16 | bmv[0]; PACK_CORR_DATA(dv,block_ptr,vsize); block_ptr = (short *)((unsigned long)block_ptr + vsize); From patchwork Thu Sep 19 16:31:08 2019 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: 11152911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD3931599 for ; Thu, 19 Sep 2019 16:32:06 +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 C591E218AF for ; Thu, 19 Sep 2019 16:32:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C591E218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 5BEF46F809; Thu, 19 Sep 2019 16:32:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA5B46F809 for ; Thu, 19 Sep 2019 16:32:03 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="199451952" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 19 Sep 2019 09:32:01 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:32:00 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:08 +0300 Message-Id: <20190919163113.17402-17-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 16/21] sna/fb: Initialize xoff/yoff 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" From: Ville Syrjälä The compiler seems to think src/mask xoff/yoff can be used uninitialized. Zero them to make sure. Signed-off-by: Ville Syrjälä --- src/sna/fb/fbpict.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c index abe223f31c88..8e65deb26fe9 100644 --- a/src/sna/fb/fbpict.c +++ b/src/sna/fb/fbpict.c @@ -313,8 +313,10 @@ image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff, { pixman_image_t *image = NULL; - if (!pict) + if (!pict) { + *xoff = *yoff = 0; return NULL; + } if (pict->pDrawable) { image = create_bits_picture(pict, has_clip, xoff, yoff); @@ -336,6 +338,8 @@ image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff, image = create_conical_gradient_image(gradient); } *xoff = *yoff = 0; + } else { + *xoff = *yoff = 0; } if (image) From patchwork Thu Sep 19 16:31:09 2019 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: 11152913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 183341599 for ; Thu, 19 Sep 2019 16:32:10 +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 0092E218AF for ; Thu, 19 Sep 2019 16:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0092E218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 7EF146F81B; Thu, 19 Sep 2019 16:32:09 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 847166F816 for ; Thu, 19 Sep 2019 16:32:06 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="188138439" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga007.fm.intel.com with SMTP; 19 Sep 2019 09:32:04 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:32:03 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:09 +0300 Message-Id: <20190919163113.17402-18-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 17/21] sna: Use -Wno-maybe-uninitialized 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" From: Ville Syrjälä The compiler seems incapable of deducing whether something is used uninitialized or not. Signed-off-by: Ville Syrjälä --- src/sna/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sna/meson.build b/src/sna/meson.build index 9e4b69f45e55..7408f63c82db 100644 --- a/src/sna/meson.build +++ b/src/sna/meson.build @@ -132,6 +132,7 @@ sna = static_library('sna', '-Wno-unused-but-set-variable', '-Wno-expansion-to-defined', '-Wno-shift-negative-value', + '-Wno-maybe-uninitialized', '-Wno-unused-parameter', '-Wno-unused-function', '-Wno-unused-variable', From patchwork Thu Sep 19 16:31:10 2019 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: 11152915 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FC8813BD for ; Thu, 19 Sep 2019 16:32:12 +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 677B2218AF for ; Thu, 19 Sep 2019 16:32:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 677B2218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 EC9816F816; Thu, 19 Sep 2019 16:32:11 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE20A6F816 for ; Thu, 19 Sep 2019 16:32:09 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="271275241" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga001.jf.intel.com with SMTP; 19 Sep 2019 09:32:07 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:32:06 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:10 +0300 Message-Id: <20190919163113.17402-19-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 18/21] sna: Get rid of -Wno-shift-negative-value 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" From: Ville Syrjälä Use a cast to avoid the "left shift of negative value [-Wshift-negative-value]" warning, and get rid of the suppression. Signed-off-by: Ville Syrjälä --- src/sna/meson.build | 1 - src/sna/sna_trapezoids_mono.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sna/meson.build b/src/sna/meson.build index 7408f63c82db..e1eb25f2be36 100644 --- a/src/sna/meson.build +++ b/src/sna/meson.build @@ -131,7 +131,6 @@ sna = static_library('sna', c_args : [ '-Wno-unused-but-set-variable', '-Wno-expansion-to-defined', - '-Wno-shift-negative-value', '-Wno-maybe-uninitialized', '-Wno-unused-parameter', '-Wno-unused-function', diff --git a/src/sna/sna_trapezoids_mono.c b/src/sna/sna_trapezoids_mono.c index 07a7867d7f09..1582c96c57e8 100644 --- a/src/sna/sna_trapezoids_mono.c +++ b/src/sna/sna_trapezoids_mono.c @@ -657,7 +657,7 @@ mono_init(struct mono *c, int num_edges) c->head.dy = 0; c->head.height_left = INT_MAX; - c->head.x.quo = INT16_MIN << 16; + c->head.x.quo = (uint32_t)INT16_MIN << 16; c->head.prev = NULL; c->head.next = &c->tail; c->tail.prev = &c->head; From patchwork Thu Sep 19 16:31:11 2019 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: 11152919 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6122195A for ; Thu, 19 Sep 2019 16:32:15 +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 9E9E4218AF for ; Thu, 19 Sep 2019 16:32:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E9E4218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 2F0016F81D; Thu, 19 Sep 2019 16:32:15 +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 9DFF16F822 for ; Thu, 19 Sep 2019 16:32:12 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="192097327" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga006.jf.intel.com with SMTP; 19 Sep 2019 09:32:10 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:32:09 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:11 +0300 Message-Id: <20190919163113.17402-20-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 19/21] uxa: Get rid of -Wno-shift-negative-value 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" From: Ville Syrjälä The minimum CS URB entry size is 1. Let's use that instead of 0 so that we don't end up left shifting a -1. Signed-off-by: Ville Syrjälä --- src/uxa/i965_render.c | 2 +- src/uxa/i965_video.c | 2 +- src/uxa/meson.build | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/uxa/i965_render.c b/src/uxa/i965_render.c index c1943fb6b5a8..32dbf2f95173 100644 --- a/src/uxa/i965_render.c +++ b/src/uxa/i965_render.c @@ -277,7 +277,7 @@ i965_check_composite_texture(ScreenPtr screen, PicturePtr picture) /* Set up a default static partitioning of the URB, which is supposed to * allow anything we would want to do, at potentially lower performance. */ -#define URB_CS_ENTRY_SIZE 0 +#define URB_CS_ENTRY_SIZE 1 #define URB_CS_ENTRIES 0 #define URB_VS_ENTRY_SIZE 1 // each 512-bit row diff --git a/src/uxa/i965_video.c b/src/uxa/i965_video.c index 9b9203b66f25..fcd5657d9426 100644 --- a/src/uxa/i965_video.c +++ b/src/uxa/i965_video.c @@ -378,7 +378,7 @@ static void i965_post_draw_debug(ScrnInfoPtr scrn) #define URB_SF_ENTRY_SIZE 2 #define URB_CS_ENTRIES 0 -#define URB_CS_ENTRY_SIZE 0 +#define URB_CS_ENTRY_SIZE 1 static void i965_create_dst_surface_state(ScrnInfoPtr scrn, PixmapPtr pixmap, diff --git a/src/uxa/meson.build b/src/uxa/meson.build index 5f0929ae32a9..f4a3302d3655 100644 --- a/src/uxa/meson.build +++ b/src/uxa/meson.build @@ -58,7 +58,6 @@ uxa = static_library('uxa', include_directories : inc, c_args : [ '-Wno-deprecated-declarations', - '-Wno-shift-negative-value', '-Wno-unused-parameter', '-Wno-sign-compare', ], From patchwork Thu Sep 19 16:31:12 2019 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: 11152921 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1C0513BD for ; Thu, 19 Sep 2019 16:32:18 +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 DA118218AF for ; Thu, 19 Sep 2019 16:32:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA118218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 088A56F822; Thu, 19 Sep 2019 16:32:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35AD96F822 for ; Thu, 19 Sep 2019 16:32:15 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="217356984" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 19 Sep 2019 09:32:13 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:32:12 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:12 +0300 Message-Id: <20190919163113.17402-21-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 20/21] tools: Get rid of -Wno-sign-compare 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" From: Ville Syrjälä Fix the sign comparison warnings by changing some types, and using a few casts. Signed-off-by: Ville Syrjälä --- tools/backlight_helper.c | 2 +- tools/meson.build | 2 -- tools/virtual.c | 18 +++++++++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/tools/backlight_helper.c b/tools/backlight_helper.c index aadb8fac92ba..65151a534009 100644 --- a/tools/backlight_helper.c +++ b/tools/backlight_helper.c @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) if (snprintf(buf, sizeof(buf), "/sys/class/backlight/%s/brightness", - argv[1]) >= sizeof(buf)) + argv[1]) >= (int)sizeof(buf)) die("Invalid interface '%s': name too long\n", argv[1]); fd = open(buf, O_RDWR); diff --git a/tools/meson.build b/tools/meson.build index b4621abb3c7c..3df33385be3b 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -17,7 +17,6 @@ if with_tools ], c_args : [ '-Wno-unused-parameter', - '-Wno-sign-compare', ], install : true) @@ -81,7 +80,6 @@ if with_backlight_helper install_mode : [ 'rws--x--x', 'root', 'root' ], c_args : [ '-DMAJOR_IN_SYSMACROS', - '-Wno-sign-compare', ], install : true) diff --git a/tools/virtual.c b/tools/virtual.c index fc8db2b9f2e2..010a3aab7cf3 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -121,7 +121,7 @@ struct display { int cursor_y; int cursor_moved; int cursor_visible; - int cursor; + Cursor cursor; int flush; int send; @@ -148,7 +148,7 @@ struct output { Pixmap pixmap; GC gc; - long serial; + unsigned long serial; int use_shm; int use_shm_pixmap; XShmSegmentInfo shm; @@ -166,7 +166,7 @@ struct clone { struct clone *active; struct output src, dst; - long timestamp; + Time timestamp; XShmSegmentInfo shm; XImage image; @@ -194,8 +194,8 @@ struct context { int timer_active; - long timestamp; - long configTimestamp; + Time timestamp; + Time configTimestamp; Atom singleton; char command[1024]; @@ -597,7 +597,7 @@ static int mode_equal(const XRRModeInfo *a, const XRRModeInfo *b) a->modeFlags == b->modeFlags); } -static XRRModeInfo *lookup_mode(XRRScreenResources *res, int id) +static XRRModeInfo *lookup_mode(XRRScreenResources *res, RRMode id) { int i; @@ -3055,7 +3055,7 @@ static int first_display_send_command(struct context *ctx, int timeout, va_start(va, format); len = vsnprintf(buf+4, sizeof(buf)-4, format, va)+5; va_end(va); - assert(len < sizeof(buf)); + assert(len < (int)sizeof(buf)); DBG(X11, ("%s: send command '%s'\n", DisplayString(display->dpy), buf)); @@ -3063,7 +3063,7 @@ static int first_display_send_command(struct context *ctx, int timeout, while (len) { XClientMessageEvent msg; int n = len; - if (n > sizeof(msg.data.b)) + if (n > (int)sizeof(msg.data.b)) n = sizeof(msg.data.b); len -= n; @@ -3113,7 +3113,7 @@ static void first_display_handle_command(struct context *ctx, for (len = 0; len < 20 && msg[len]; len++) ; - if (ctx->command_continuation + len > sizeof(ctx->command)) { + if (ctx->command_continuation + len > (int)sizeof(ctx->command)) { ctx->command_continuation = 0; return; } From patchwork Thu Sep 19 16:31:13 2019 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: 11152923 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 129CE13BD for ; Thu, 19 Sep 2019 16:32:22 +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 EDDD0218AF for ; Thu, 19 Sep 2019 16:32:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDDD0218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.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 7ED3C6F878; Thu, 19 Sep 2019 16:32:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BC946F878 for ; Thu, 19 Sep 2019 16:32:18 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="181527543" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 19 Sep 2019 09:32:16 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:32:15 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:13 +0300 Message-Id: <20190919163113.17402-22-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 21/21] sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr 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" From: Ville Syrjälä Deal with xserver commit 8e3b26ceaa86 ("Make PixmapDirtyUpdateRec::src a DrawablePtr") Not sure this is still correct though. Is this stuff limited to pixmaps anymore? Signed-off-by: Ville Syrjälä --- src/sna/sna_accel.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 8266e86d8fea..fa386ff6b9a6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -17518,7 +17518,11 @@ static bool has_offload_slaves(struct sna *sna) PixmapDirtyUpdatePtr dirty; xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) { +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + assert(dirty->src == &sna->front->drawable); +#else assert(dirty->src == sna->front); +#endif if (RegionNotEmpty(DamageRegion(dirty->damage))) return true; } @@ -17679,7 +17683,11 @@ static void sna_accel_post_damage(struct sna *sna) if (RegionNil(damage)) continue; - src = dirty->src; +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + assert(dirty->src->type == DRAWABLE_PIXMAP); +#endif + + src = (PixmapPtr)dirty->src; dst = dirty->slave_dst->master_pixmap; region.extents.x1 = dirty->x; @@ -17930,9 +17938,15 @@ migrate_dirty_tracking(PixmapPtr old_front, PixmapPtr new_front) PixmapDirtyUpdatePtr dirty, safe; xorg_list_for_each_entry_safe(dirty, safe, &screen->pixmap_dirty_list, ent) { +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + assert(dirty->src == &old_front->drawable); + if (dirty->src != &old_front->drawable) + continue; +#else assert(dirty->src == old_front); if (dirty->src != old_front) continue; +#endif DamageUnregister(&dirty->src->drawable, dirty->damage); DamageDestroy(dirty->damage); @@ -17947,7 +17961,11 @@ migrate_dirty_tracking(PixmapPtr old_front, PixmapPtr new_front) } DamageRegister(&new_front->drawable, dirty->damage); +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + dirty->src = &new_front->drawable; +#else dirty->src = new_front; +#endif } #endif }