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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71708C433EF for ; Mon, 20 Jun 2022 16:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243797AbiFTQG5 (ORCPT ); Mon, 20 Jun 2022 12:06:57 -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-Google-Smtp-Source: AGRyM1tS84pAl4gPEG6VUAiyQ3CNBgM/Fof7DG4xoDCk5JDIMJryIQAgfInVIRMaMIhvmvCck0bUzQ== 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 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 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 D9928C43334 for ; Mon, 20 Jun 2022 16:06:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D897010E03F; Mon, 20 Jun 2022 16:06:51 +0000 (UTC) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F99310E0D3 for ; Mon, 20 Jun 2022 16:06:50 +0000 (UTC) Received: by mail-wr1-x42c.google.com with SMTP id w17so15310981wrg.7 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=a3LCYkuIdOPvXRVpWnSRZRuEMjUPWny9/xnZASXT3nZJZISZbwTMlFGy2CJLNb8Xb4 jDAt7wfuq1yxaDolgR7gp5CXL2h/mRDZU+RAyDaNlqqsRdLajZRxS9pPz8exOCjwpuBi unNuBxvtUVv12zwtkoolWhEosuIHIVs5m/hM50UKCEtexQQKrk0A/kscyUGPMwxQX+wb ekeVVuSBTGW9C5AUCqpE9l/LKPol2ABpN4dkU2lA90bcDGQAkLZBjZT8JGpO24rq8X68 xC/lFMb5XATPKmHM+UdFgLDNJgW3uONodpzRwEmRM+utayIxnAkpncJaJXQ8ORvQoPYx FuGw== X-Gm-Message-State: AJIora+sY1Vwraqx/XXsUcRx0VCZlcwYbzJOgM1wxVatNCfd1WzGhAms 72DSPLMUAWw7IDWG7X2303skZHjvzcuZIQ== X-Google-Smtp-Source: AGRyM1tS84pAl4gPEG6VUAiyQ3CNBgM/Fof7DG4xoDCk5JDIMJryIQAgfInVIRMaMIhvmvCck0bUzQ== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, davidgow@google.com, magalilemes00@gmail.com, airlied@linux.ie, maira.canal@usp.br, dlatypov@google.com, linux-kernel@vger.kernel.org, Jani Nikula , =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= , tzimmermann@suse.de, tales.aparecida@gmail.com, isabbasso@riseup.net, kunit-dev@googlegroups.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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