Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3677531iog; Tue, 21 Jun 2022 03:48:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sDRdbneq8axDnXbi11+JXpwA3sTa+5fp+8DlnMP/pC/w1Md+hCd3/VIiLM3uzFQjOPj+PH X-Received: by 2002:a17:906:ff18:b0:711:d197:b942 with SMTP id zn24-20020a170906ff1800b00711d197b942mr24977531ejb.357.1655808535521; Tue, 21 Jun 2022 03:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655808535; cv=none; d=google.com; s=arc-20160816; b=ulAR432uc4yhy+JkUOhf7Z8sk4Sk+Hv5QA2KBSXhXVtq7S6kNpw0OiN/QMmeghFqEv hF73Yg2HmH6lmAeKhnTbwvjRT5hDk/yE9funRMAN9/odcGodLvo/6vC4u5OW4/hyQ0jy qFqk1KBg2segEFWV5gUdlSx+++C/ENs5GmaR74fDr8tnZ/wndC/ubFyRF6Jg7oNLMuRD H2UymnVJY7pFd1jAPV+1s2SNuYIwo8UBE7x6TYlV64D+V2Rcwt+0tOpexXNAP0Ni1C8j 6fTOX9gjMrq5+ZzYm4pHYde3te5r4wJcLwPXiW7Ch7CxkpVS+5gbhz5tXw3aih32K7Gn B2aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=lCsOOCttnKJNi+Dt6aOp1OEvOErTQU47HeeZ4wYOudc=; b=ASrBax+JPH4vTYyOXkmo3ugL6scpfR2FK6h/ujF1ySSqsuvXRjD9KzKQ39VAdP6xCd oZrjqvI0La3nKSR85tqrqTmUdqYAW+wfknOeIIbWc4it2L+klM4OgS2yzZ7gIYxvhLpz FtuUv8mHRJV1l238UJunWwzR7GBsQDUHES+MIMoozyR9BHBlKg1F9Bxk93Hg3AogPAeh dwf8rKjYW/5MIswo+bpe3Y84OcTqbiL4F0fRFKuYVk1nc/E1NAoPS9cvPoGnzMvECRb5 C4qmmQzbkMV82s8wdFo4hQvT9xGaVibANtf99fN6dWGGgYROUNCfudNRlVDwKDak9gXm lJWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FXibfh9H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a05640235d000b004359f333398si329635edc.321.2022.06.21.03.48.29; Tue, 21 Jun 2022 03:48:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FXibfh9H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344495AbiFUKpc (ORCPT + 99 others); Tue, 21 Jun 2022 06:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349091AbiFUKNZ (ORCPT ); Tue, 21 Jun 2022 06:13:25 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E729286D6 for ; Tue, 21 Jun 2022 03:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655806405; x=1687342405; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=mR5Un6+9WKGYeywFJRvZiZCin9Uu7YE1gj2wX8VDPHE=; b=FXibfh9HV9WY5pUfCY1SBaOyWZde+hf7EsFcBR0F5dbDqvY0JdE//tti cNTuOHEktTfmH5Z4KyKg/g3+bPjnrVSDz2C9ShQwhYcRfzBjDb0SW/Axi 8Wt1hYHJyIxBDIMFcjwpOO2BpdZhI4O10tlAt9+BA85/Z3/IL+DxR+4eZ 7VTuvtNOZNU7Njxa6ekvEQeQiG1utRVoggNgmJowsQGSWXhpqx+A92JgZ v+K0vV4xS5gKfb/OJoA50uLLnQ8TeWyuwjIEgk+/bF4u3KaZUXzUtHPGg CD4kD+VpnFVAiN3KGoZgLW1vzy85rhbGZZrkBHU9lcCQrw80d1lYeiHnA g==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="305525615" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="305525615" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 03:13:24 -0700 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="591589620" Received: from rgrotewx-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.35.153]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 03:13:21 -0700 From: Jani Nikula To: Thomas Zimmermann , David Gow , =?utf-8?Q?Jos=C3=A9_Exp=C3=B3sito?= Cc: dri-devel@lists.freedesktop.org, magalilemes00@gmail.com, David Airlie , =?utf-8?Q?Ma=C3=ADra?= Canal , Daniel Latypov , Javier Martinez Canillas , Linux Kernel Mailing List , tales.aparecida@gmail.com, Isabella Basso , KUnit Development Subject: Re: [PATCH v4 1/3] drm/rect: Add DRM_RECT_INIT() macro In-Reply-To: <045f480b-9f47-6f10-9e5d-4436335b272e@suse.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220620160640.3790-1-jose.exposito89@gmail.com> <20220620160640.3790-2-jose.exposito89@gmail.com> <045f480b-9f47-6f10-9e5d-4436335b272e@suse.de> Date: Tue, 21 Jun 2022 13:13:18 +0300 Message-ID: <87fsjys4sh.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Jun 2022, Thomas Zimmermann wrote: > Hi > > Am 21.06.22 um 11:38 schrieb David Gow: >> On Tue, Jun 21, 2022 at 12:06 AM Jos=C3=A9 Exp=C3=B3sito >> wrote: >>> >>> Add a helper macro to initialize a rectangle from x, y, width and >>> height information. >>> >>> Reviewed-by: Jani Nikula >>> Acked-by: Thomas Zimmermann >>> Signed-off-by: Jos=C3=A9 Exp=C3=B3sito >>> --- >>=20 >> This looks good to me, though I have one minor concern about the macro >> name. (But if it's okay with the DRM folks, which it seems to be, I >> won't object.) >>=20 >> Either way, >> Reviewed-by: David Gow >>=20 >>> include/drm/drm_rect.h | 16 ++++++++++++++++ >>> 1 file changed, 16 insertions(+) >>> >>> diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h >>> index 6f6e19bd4dac..e8d94fca2703 100644 >>> --- a/include/drm/drm_rect.h >>> +++ b/include/drm/drm_rect.h >>> @@ -47,6 +47,22 @@ struct drm_rect { >>> int x1, y1, x2, y2; >>> }; >>> >>> +/** >>> + * DRM_RECT_INIT - initialize a rectangle from x/y/w/h >>> + * @x: x coordinate >>> + * @y: y coordinate >>> + * @w: width >>> + * @h: height >>> + * >>> + * RETURNS: >>> + * A new rectangle of the specified size. >>> + */ >>> +#define DRM_RECT_INIT(x, y, w, h) ((struct drm_rect){ \ >>> + .x1 =3D (x), \ >>> + .y1 =3D (y), \ >>> + .x2 =3D (x) + (w), \ >>> + .y2 =3D (y) + (h) }) >>> + >>=20 >> My only slight concern here is that it might be a little bit confusing >> that a macro called DRM_RECT_INIT() accepts x/y/w/h, whereas the >> actual struct drm_rect is x1/y1/x2/y2. If the macro were called >> something like DRM_RECT_INIT_FROM_XYWH() or similar. > > The existing drm_rect_init() function uses xywh arguments. So the=20 > current name is consistent with existing practice. I don't think we=20 > refer to x2,y2 much, if ever. Agreed, and if we initialized with x1,y1,x2,y2 we wouldn't need the function/macro in the first place. BR, Jani. > > Best regards > Thomas > >>=20 >>=20 >>> /** >>> * DRM_RECT_FMT - printf string for &struct drm_rect >>> */ >>> -- >>> 2.25.1 >>> --=20 Jani Nikula, Intel Open Source Graphics Center