Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3015748iog; Mon, 20 Jun 2022 09:22:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t4AGoN3ZURCD8VPMr4TJXSaeK/ZKxnBNMJgwN3U2OuFWpaacxzH1zZZnt+j+2Rz1/sizri X-Received: by 2002:a05:6402:3608:b0:435:4a91:9ce2 with SMTP id el8-20020a056402360800b004354a919ce2mr25988748edb.342.1655742155566; Mon, 20 Jun 2022 09:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655742155; cv=none; d=google.com; s=arc-20160816; b=pGbmyWMP1n57ZpRmKuY2PZ9cg720ECgMsOroKZeocV01PqE9Kc3QdLqRRIvM11Tn26 iDelwinMXaXf7APftBpqBRwriZThsb0OmH4JMVyUz48RKokR2RKI9eRtDrglhOtoz1bH y6V5BF3K41D7ueRN5eENMivK5Px0+cihYRnXTO/shlKreA9vZRrQCM4G5sqCJE2rWT85 3rjEX0DbnQUcwkuzxDiel3Enficu/R2wb23EZjCYKGuiAXuwjSbZnuNBPqDnPD4sHAap 8xXbkRnu8IaCvEZkkZv9Zw5DKNzPQHRBX3t7dxr/8YYU6sV+ZdJ65IPuaoJNjoyKwnHl OpmQ== 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=1hWIp6gyzPawjh1VYTnBY7bZuvMtRrsBKXWqmX440Jo=; b=AUFNml5clYwygTR0BN/scsTM05PiyP4uO8hc3aozOR5GRq771avng3YJPl5bAi1pPV 8ModRH+ieioatBwSUSJINa5wQU6YNbZlydYvamIxI7BPfszuGAJH80Gvw6fE1sHG6BMC Rf56hDecpf7lxJjsoL49frkRRJIEJe0M3inSyNkbw7HLLRSQ6fvgrVKEE38VhS6q7Te2 8vY9zFg/LHtJgAHgJ23Ns4i6H5Cmr4FjRzv5us+JkIbk3PiMAsXTGEP8B1l7T5gZ8qTy Ht6dPxoB/3XbnlhCx+u7Vnw1PMrtlv6i8fv9bvIKrKMlpArBnoNLMbNoHBvfzYXmr94d wRqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ImEBBc8M; 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 a22-20020aa7d756000000b0043578c6395fsi5098293eds.593.2022.06.20.09.22.10; Mon, 20 Jun 2022 09:22:35 -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=ImEBBc8M; 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 S243642AbiFTQG4 (ORCPT + 99 others); Mon, 20 Jun 2022 12:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238254AbiFTQGv (ORCPT ); Mon, 20 Jun 2022 12:06:51 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72696201A7 for ; Mon, 20 Jun 2022 09:06:50 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id g27so8679253wrb.10 for ; Mon, 20 Jun 2022 09:06:50 -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=1hWIp6gyzPawjh1VYTnBY7bZuvMtRrsBKXWqmX440Jo=; b=ImEBBc8Mfaf3egC0vLFYHtdUnz5XmDGiODkNpny5L5NPHSAFnXLokHTZEmjWbnT3WC gKlKSq67gALLdEBqLgVdXM2EvbJUo00ndmOR842m86KRxt5VX6WrM2ri21wVe6d1j7aL 2DWC1bN/+70XXpa175XD+jNo2Nn+8IjjsbjnSvPQoe2SzNGGEekAiR77TERTEKSH176b 76cmdO2wc36wuiKAp7akZkAhM7tikVlSgafLp+f9VtDUdvd9St/saVksJfNvu6bY78Iz FsckfGv9MJiGxHIyijZejdm61HMTuqSlGGr5T+nSRVBqmkWj+ClP4Tfkkk0K/gA3a63j w2HA== 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=1hWIp6gyzPawjh1VYTnBY7bZuvMtRrsBKXWqmX440Jo=; b=NW+WkNkbWHhqj57P0/kjx6gbiBUFfUxND4DXXMCGYF/58rEU5/L2tZzRyUZd/K18Ks dC1/YU3ppuAmxJ3OfLL3Wgy+AK+tvVxOQffBT96g1d9/JLRt9psxRj+Idw1FKh0LosqD 1bxTyCrJKrslagCcWPtlf71K7xsJNnYFK3Hx3L924KnzL7VeuTS+b0ALA/A4S2JJK3rN 7EAV5xlE3TvAo5FwlHf9t0Y+XqeLuyLd5oCVIfM56t+gg2oTl9IFpWkFXJaBPLBDEK8U /Vhr3NpXdKFzLtxxXI3hJ2t0LW7VPtzOf+ui3TkWiJBmBxQ8cRMH1Vg0TeQ2JANvHrOx na0A== X-Gm-Message-State: AJIora/wV4eQTGPj9w8OJyo23QXX+vZMpSQ9bxzsA6oRVJ6FIatZDIzh EzohzCytXtO268mlnzuKTv4= X-Received: by 2002:a05:6000:2a4:b0:218:77ba:988e with SMTP id l4-20020a05600002a400b0021877ba988emr23689984wry.459.1655741208896; Mon, 20 Jun 2022 09:06:48 -0700 (PDT) Received: from localhost.localdomain ([94.73.36.128]) by smtp.gmail.com with ESMTPSA id h14-20020a5d430e000000b0021b90cc66a1sm2986096wrq.2.2022.06.20.09.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 09:06:48 -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, maira.canal@usp.br, isabbasso@riseup.net, magalilemes00@gmail.com, tales.aparecida@gmail.com, dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= , Jani Nikula Subject: [PATCH v4 1/3] drm/rect: Add DRM_RECT_INIT() macro Date: Mon, 20 Jun 2022 18:06:38 +0200 Message-Id: <20220620160640.3790-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620160640.3790-1-jose.exposito89@gmail.com> References: <20220620160640.3790-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. Reviewed-by: Jani Nikula Acked-by: Thomas Zimmermann 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