From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB1E3C433EF for ; Tue, 19 Oct 2021 08:02: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 AFC226112D for ; Tue, 19 Oct 2021 08:02:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AFC226112D 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=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24CF76EB44; Tue, 19 Oct 2021 08:02:57 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id D91E56EB44 for ; Tue, 19 Oct 2021 08:02:55 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10141"; a="227218127" X-IronPort-AV: E=Sophos;i="5.85,383,1624345200"; d="scan'208,223";a="227218127" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 01:02:50 -0700 X-IronPort-AV: E=Sophos;i="5.85,383,1624345200"; d="scan'208,223";a="483123644" Received: from jsanz-mobl1.ger.corp.intel.com (HELO localhost) ([10.251.211.239]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 01:02:48 -0700 From: Jani Nikula To: Imre Deak , intel-gfx@lists.freedesktop.org Cc: Juha-Pekka Heikkila , Ville =?utf-8?B?U3lyasOkbMOk?= In-Reply-To: <20211014220921.683870-10-imre.deak@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20211014220921.683870-1-imre.deak@intel.com> <20211014220921.683870-10-imre.deak@intel.com> Date: Tue, 19 Oct 2021 11:02:45 +0300 Message-ID: <87h7ddsaqi.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Intel-gfx] [PATCH v3 09/11] drm/i915: Add a platform independent way to check for CCS AUX planes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" >From patch 1: static bool check_modifier_display_ver(const struct intel_modifier_desc *md, u8 display_ver) { return display_ver >= md->display_ver.from && display_ver <= md->display_ver.until; } On Fri, 15 Oct 2021, Imre Deak wrote: > +static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md, > + u8 display_ver_from, u8 display_ver_until) > +{ > + return check_modifier_display_ver(md, display_ver_from) && > + check_modifier_display_ver(md, display_ver_until); > +} > + ... > +/** > + * intel_fb_is_gen12_ccs_aux_plane: Check if a framebuffer color plane is a GEN12 CCS AUX plane > + * @fb: Framebuffer > + * @color_plane: color plane index to check > + * > + * Returns: > + * Returns %true if @fb's color plane at index @color_plane is a GEN12 CCS AUX plane. > + */ > +static bool intel_fb_is_gen12_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane) > { > - return is_gen12_ccs_modifier(fb->modifier) && is_ccs_plane(fb, plane); > + const struct intel_modifier_desc *md = lookup_modifier(fb->modifier); > + > + return check_modifier_display_ver_range(md, 12, 13) && > + ccs_aux_plane_mask(md, fb->format) & BIT(color_plane); > } check_modifier_display_ver_range(md, 12, 13) ==> check_modifier_display_ver(md, 12) && check_modifier_display_ver(md, 13) ==> 12 >= md->display_ver.from && 12 <= md->display_ver.until && 13 >= md->display_ver.from && 13 <= md->display_ver.until ==> Always false. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center