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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4F8CCC433FE for ; Tue, 11 Oct 2022 10:32:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFD9A10E352; Tue, 11 Oct 2022 10:32:43 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 601AB10E34E; Tue, 11 Oct 2022 10:32:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665484360; x=1697020360; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=PmoXsfsuU1g2vWiW+wkOkDnJcfLzJAQp/lvee/CHGEg=; b=EMFJT4kVcQa5Ak3RuhIKdSvA93mdWFyaBjVqPUCpxU9NpBTJTxCGc3Pu RLEhm7hqAf+ekb3JZcns7aOK9j6Xt5RZrVhJZQqNslLlRkfF/Ns6QehLz K63yeTO5yCzY3yTCZ8GUcZFPTSsa7Mo6DGR8YAJ31IK2UiC5p5EgFkT0B cwMs0REafcvvKChdGW3IqCweJk3MR/gu1ddTodTXf3bN3JBXklHdMevCb mOGoyNGy0nzEDlVC44+L1AwRbaTkiqsOVtH++IUdFfW91k7L2ZteFEBEN VYm2QOF/ZihKWf0eWgnKMqgtz8oNxr2Za3N2BMOvrzBDwve6eJlSAW7io g==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="304457168" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="304457168" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 03:32:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="801410639" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="801410639" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga005.jf.intel.com with SMTP; 11 Oct 2022 03:32:36 -0700 Received: by stinkbox (sSMTP sendmail emulation); Tue, 11 Oct 2022 13:32:35 +0300 Date: Tue, 11 Oct 2022 13:32:35 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Jani Nikula Message-ID: References: <20221010231720.3730568-1-radhakrishna.sripada@intel.com> <87pmeyyg3n.fsf@intel.com> <87k056y8kt.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87k056y8kt.fsf@intel.com> X-Patchwork-Hint: comment Subject: Re: [Intel-gfx] [PATCH] drm/i915: Use graphics ver, rel info for media on old platforms 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: , Cc: "intel-gfx@lists.freedesktop.org" , "De Marchi, Lucas" , "dri-devel@lists.freedesktop.org" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Oct 11, 2022 at 01:10:26PM +0300, Jani Nikula wrote: > On Tue, 11 Oct 2022, "Sripada, Radhakrishna" wrote: > > Hi Jani, > > > >> -----Original Message----- > >> From: Jani Nikula > >> Sent: Tuesday, October 11, 2022 12:28 AM > >> To: Sripada, Radhakrishna ; intel- > >> gfx@lists.freedesktop.org > >> Cc: dri-devel@lists.freedesktop.org; Sripada, Radhakrishna > >> ; De Marchi, Lucas > >> ; Roper, Matthew D > >> > >> Subject: Re: [PATCH] drm/i915: Use graphics ver, rel info for media on old > >> platforms > >> > >> On Mon, 10 Oct 2022, Radhakrishna Sripada > >> wrote: > >> > Platforms prior to MTL do not have a separate media and graphics version. > >> > On platforms where GMD id is not supported, reuse the graphics ip version, > >> > release info for media. > >> > > >> > The rest of the IP graphics, display versions would be copied during driver > >> > creation. > >> > > >> > While at it warn if GMD is not used for platforms greater than gen12. > >> > > >> > Fixes: c2c7075225ef ("drm/i915: Read graphics/media/display arch version > >> from hw") > >> > Cc: Jani Nikula > >> > Cc: Lucas De Marchi > >> > Cc: Matt Roper > >> > Signed-off-by: Radhakrishna Sripada > >> > --- > >> > drivers/gpu/drm/i915/intel_device_info.c | 12 +++++++++++- > >> > 1 file changed, 11 insertions(+), 1 deletion(-) > >> > > >> > diff --git a/drivers/gpu/drm/i915/intel_device_info.c > >> b/drivers/gpu/drm/i915/intel_device_info.c > >> > index 090097bb3c0a..ba178b61bceb 100644 > >> > --- a/drivers/gpu/drm/i915/intel_device_info.c > >> > +++ b/drivers/gpu/drm/i915/intel_device_info.c > >> > @@ -329,8 +329,18 @@ static void intel_ipver_early_init(struct > >> drm_i915_private *i915) > >> > { > >> > struct intel_runtime_info *runtime = RUNTIME_INFO(i915); > >> > > >> > - if (!HAS_GMD_ID(i915)) > >> > + if (!HAS_GMD_ID(i915)) { > >> > + drm_WARN_ON(&i915->drm, RUNTIME_INFO(i915)- > >> >graphics.ip.ver > 12); > >> > + /* > >> > + * On older platforms, graphics and media share the same ip > >> > + * version and release. > >> > + */ > >> > + RUNTIME_INFO(i915)->media.ip.ver = > >> > + RUNTIME_INFO(i915)->graphics.ip.ver; > >> > + RUNTIME_INFO(i915)->media.ip.rel = > >> > + RUNTIME_INFO(i915)->graphics.ip.rel; > >> > >> You could assign the whole struct ip_version (*) at once, or is there a > >> reason you're intentionally not assigning step? > > Step info would anyways be determined later in the function intel_step_init. > > We already have macros in place to handle common gt and media steps there. > > > > Do you suggest we memcpy(&RUNTIME_INFO(i915)->media.ip, &RUNTIME_INFO->graphics.ip, sizeof(struct ip_version)) here? > > Simple assign should do it for such a small struct. IMO for any struct. Only use memcpy() when copying arrays and such. -- Ville Syrjälä Intel