Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp792981iog; Mon, 13 Jun 2022 13:07:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uALWHvnJqjQtPS0RCpDMCIHgaRTxyhyyJ75ZuJ8dS3XGaE/FlSgIrq8Ls2RfF/kehJBA/2 X-Received: by 2002:a17:903:234d:b0:167:4b11:aa7 with SMTP id c13-20020a170903234d00b001674b110aa7mr782695plh.89.1655150832765; Mon, 13 Jun 2022 13:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655150832; cv=none; d=google.com; s=arc-20160816; b=DuOV+VlSSrf/nI6qpQz5wpZcOel9guDsKJ6JQMZmOVLXSkkKZFZhSIb7COBtNNC3JS oxtLCxA/apq4kC+aWWDCPidxSVmO43mHJV5g7oQ3jrZiRzxWQhpQe7aCHtPqehxsLjJG ACPzSvS0VZKINfBm5Q63gV/DvKQj1hxuXfGY9H5sTWnC0qLGYVFK4MTIdOr5zpxHXbSB qVCvvric67PkqRD3o9mfBErQWP5yyqhFyrTVqEmAgNuWABtyLvIzKMEGjfnN9NBjAMpY 1glFMqvEooeK2oxADqXz2oLd2NBG8u5jLLCjBSkxTKkT7PxcQMuwH+opTmMSg7L4pL2H 8yyg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oTgKLvjLuTzO7UM/mQsy+9BhRmEEwbTxiHwdzXn+Bis=; b=gFuHClD8w/ZoL9kDfcW57o/7de8Qi3zbTYSVnE3roHGV+XYwNSVpql5WDhaQKCO69N PLbESDKyO27EPFCre7LHTFlXADJuHhUTNsD968zAN/4yYzOqFmuptWd2EvUYKUnebkM5 PCJRxBUjLyRniVuyg7lMaQrQl9tfFa2RbX9lv2co1oOCDqDpmaLVi3INRdrObrZWeU5L tE6HpYbn3h4XPHRM6v/Usx4tfBmCTvJbOpEveeAsamxB2J0zAW+lVydhRkfCoWXAac4Y TvIpFqCjOCU7P1WvPA4CSqGBu0FWKXj1b0DIkM7uK5AtV4Fx6gvfjAf9D4N0i1+tcxHR 4P0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GCqt0jHD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a63fe0e000000b003c64eaa98cbsi10347040pgh.58.2022.06.13.13.06.59; Mon, 13 Jun 2022 13:07:12 -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=@gmail.com header.s=20210112 header.b=GCqt0jHD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242043AbiFMTV5 (ORCPT + 99 others); Mon, 13 Jun 2022 15:21:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348629AbiFMTVW (ORCPT ); Mon, 13 Jun 2022 15:21:22 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26ADC1FA61 for ; Mon, 13 Jun 2022 10:17:49 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id i17-20020a7bc951000000b0039c4760ec3fso4396271wml.0 for ; Mon, 13 Jun 2022 10:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oTgKLvjLuTzO7UM/mQsy+9BhRmEEwbTxiHwdzXn+Bis=; b=GCqt0jHDbbSAEtN+nQobnMYuspNmhWO31Jlw3BkNbBf4JuoBPhaTz0IqkCqndu0yTD XEwFvO18vMq2x/zYuP5VPzM6C0GXCH1I+T7FuwfX+Xm/eS0o66cQKMSnc9vGmcbtS3qn kVUxCXGnNvfc20nSneMcBtPI3GxeM/pWq5php6GklT52+D+OYf4wSJ0j8sFvUd0b46UK TB2d/JBO3OhcD1A0VMlyA89+trntVh6ygLkNqYmxKlw3kzPSlyfyry7hzFAm7Z6D7oGF inGWMPjHahuf5WdtUGZsdgXaytjRrsEafpH3TYIMSbmAWjV4EudB7pPINesAvIhvdcth rzqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oTgKLvjLuTzO7UM/mQsy+9BhRmEEwbTxiHwdzXn+Bis=; b=T7MhDy2vySL52Zt29K+XGJTKWPlEcp5MmUtg0AZLl9zzkY7tVwk+Ae4PDQJ3GKoPXC dlszmrtEK826Rpv82yWhjWmJeLs9th152IUEnEgoUPVNH7fWYfiHxEwomGd3BNXq8UVW TMVwjpNS9uac7zgoex4tZdJ0E3N40AD85+I85N7LpuZt36gm8fLds6HVGvVD3lig/p4/ SP24xRiTs+hwlzjPEu2qk4Wbot6ang37vEmubVH5t+exmPd7NEh0KB9l7mcG2WjrC4e8 ghW0qPCYUyG+WDOA3ClMjxxnuYCJvvkFEI86Mo2NNTWOFsPXqTbdzeTiLlIzyy3K34h8 I/mQ== X-Gm-Message-State: AOAM532k2ofkcpLme72cMUl+OmoT9Uk/dJfMkvfm6PaTmaAgaDjgxsnY Dn9o0lXMWHTfjiQDA43VL4Y= X-Received: by 2002:a1c:7901:0:b0:39c:4252:d7f1 with SMTP id l1-20020a1c7901000000b0039c4252d7f1mr537938wme.178.1655140667601; Mon, 13 Jun 2022 10:17:47 -0700 (PDT) Received: from localhost.localdomain ([94.73.36.128]) by smtp.gmail.com with ESMTPSA id a10-20020a056000100a00b0020d106c0386sm9016129wrx.89.2022.06.13.10.17.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 10:17:47 -0700 (PDT) From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= To: javierm@redhat.com Cc: davidgow@google.com, dlatypov@google.com, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@linux.ie, daniel@ffwll.ch, jani.nikula@linux.intel.com, dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Subject: [PATCH v3 1/3] drm/rect: Add DRM_RECT_INIT() macro Date: Mon, 13 Jun 2022 19:17:36 +0200 Message-Id: <20220613171738.111013-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220613171738.111013-1-jose.exposito89@gmail.com> References: <20220613171738.111013-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 Add a helper macro to initialize a rectangle from x, y, width and height information. Signed-off-by: José Expósito --- 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 = (x), \ + .y1 = (y), \ + .x2 = (x) + (w), \ + .y2 = (y) + (h) }) + /** * DRM_RECT_FMT - printf string for &struct drm_rect */ -- 2.25.1