From patchwork Fri Mar 9 00:53:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schake X-Patchwork-Id: 10269481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B9836016D for ; Fri, 9 Mar 2018 00:55:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C10E29B81 for ; Fri, 9 Mar 2018 00:55:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40F0029C2E; Fri, 9 Mar 2018 00:55:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B10029B81 for ; Fri, 9 Mar 2018 00:55:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AD5DD6E2C9; Fri, 9 Mar 2018 00:55:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id D2B816E2C9 for ; Fri, 9 Mar 2018 00:55:07 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id z9so1056909wmb.3 for ; Thu, 08 Mar 2018 16:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O90758xJVE7n7QwnSWDaDIAnj646LKqw1KTUXBosJVY=; b=Ji5yCY+yEYFi6P2OHEjB666dSizLuCZOvZn9WS2FjFJPciExbgU4z2SfuUm/7WAxvR 5CQmXFFjyaLq8m8WY5nUvJcPlYaw/3RFUEbW2ZbwJJehVvZpCU/iwH8+7tw1TTdmCz0G YUjwDD8vEmq52hbOI21xfVWHldYlS9Hgrto1PM5EN2KSge3u2oU1T5JVWGqhWDlbcV1B /X3uIiLWCNd3nSH49hF8DB3mi3jCWRwvV/eAXBd7gzDKK9TLtp6kjF6eqa+a1BRdrW4A ZQ9dwRUpKrPBSqhJD73d/RfV7V/uHlheNoUJP7e2fevkz9RcUmDMLIV0EmJqmuCinmj4 mCBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O90758xJVE7n7QwnSWDaDIAnj646LKqw1KTUXBosJVY=; b=etuxe4NR4SROATupUW1HP6MJR1KFVo35cVGbxm+3mvDfqMmozYlnAFIY7/j7+eDeq9 h+ok8Fkez2LrtsNKtFxW/+bp0N0ClP6mZQO7vRdUxbK6YLBOPp7vE8wuA4lB6Ox4F9b4 oAO+j4JC12Ew8rFRsV/4sgZX0HfVJpoqpcSoz4UZQbgCMJby2UgBQJjesA/o5Kwnzv/N 7251rgFdfXgBT1VZH5NQ4mCMC1tkU1d8Sh+BJ6cXarwXRM5/SrphcbeBCJwQq14sYa1r UizLCc9nN4GMyLYWDmi4Xsp1SWdLxJfbqD0BTWFOKzCsc/0jZgekyzCNqJQ+R8+LSmfE kqZA== X-Gm-Message-State: AElRT7FD5gA4mMyo8avegF1Sw4R3CFYmctCELqM1GATtgbIastcU5/WD 7ceXieUZ5YE+Zr8gy87Cz5o= X-Google-Smtp-Source: AG47ELug6Z91PZAF0h9+KF1Ad3jYn2yAdVkFiKt1e6ZZskDLvJIBpgtAQkI323ZESvzoU4vBPw3FOQ== X-Received: by 10.28.185.83 with SMTP id j80mr532351wmf.69.1520556906435; Thu, 08 Mar 2018 16:55:06 -0800 (PST) Received: from localhost.localdomain (x4e31ef02.dyn.telefonica.de. [78.49.239.2]) by smtp.gmail.com with ESMTPSA id s78sm45884815wrc.93.2018.03.08.16.55.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Mar 2018 16:55:05 -0800 (PST) From: Stefan Schake To: eric@anholt.net Subject: [PATCH v2 3/4] drm/vc4: Move plane state to header Date: Fri, 9 Mar 2018 01:53:36 +0100 Message-Id: <1520556817-97297-4-git-send-email-stschake@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520556817-97297-1-git-send-email-stschake@gmail.com> References: <1520556817-97297-1-git-send-email-stschake@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Stefan Schake MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We need to reference it from the CRTC to make a decision for enabling background color fill. Signed-off-by: Stefan Schake --- drivers/gpu/drm/vc4/vc4_drv.h | 60 +++++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/vc4/vc4_plane.c | 60 ----------------------------------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index fefa166..1b4cd1f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -310,6 +310,66 @@ to_vc4_plane(struct drm_plane *plane) return (struct vc4_plane *)plane; } +enum vc4_scaling_mode { + VC4_SCALING_NONE, + VC4_SCALING_TPZ, + VC4_SCALING_PPF, +}; + +struct vc4_plane_state { + struct drm_plane_state base; + /* System memory copy of the display list for this element, computed + * at atomic_check time. + */ + u32 *dlist; + u32 dlist_size; /* Number of dwords allocated for the display list */ + u32 dlist_count; /* Number of used dwords in the display list. */ + + /* Offset in the dlist to various words, for pageflip or + * cursor updates. + */ + u32 pos0_offset; + u32 pos2_offset; + u32 ptr0_offset; + + /* Offset where the plane's dlist was last stored in the + * hardware at vc4_crtc_atomic_flush() time. + */ + u32 __iomem *hw_dlist; + + /* Clipped coordinates of the plane on the display. */ + int crtc_x, crtc_y, crtc_w, crtc_h; + /* Clipped area being scanned from in the FB. */ + u32 src_x, src_y; + + u32 src_w[2], src_h[2]; + + /* Scaling selection for the RGB/Y plane and the Cb/Cr planes. */ + enum vc4_scaling_mode x_scaling[2], y_scaling[2]; + bool is_unity; + bool is_yuv; + + /* Offset to start scanning out from the start of the plane's + * BO. + */ + u32 offsets[3]; + + /* Our allocation in LBM for temporary storage during scaling. */ + struct drm_mm_node lbm; + + /* Set when the plane has per-pixel alpha content or does not cover + * the entire screen. This is a hint to the CRTC that it might need + * to enable background color fill. + */ + bool needs_bg_fill; +}; + +static inline struct vc4_plane_state * +to_vc4_plane_state(struct drm_plane_state *state) +{ + return (struct vc4_plane_state *)state; +} + enum vc4_encoder_type { VC4_ENCODER_TYPE_NONE, VC4_ENCODER_TYPE_HDMI, diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 8be9a87..ce39390 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -27,66 +27,6 @@ #include "vc4_drv.h" #include "vc4_regs.h" -enum vc4_scaling_mode { - VC4_SCALING_NONE, - VC4_SCALING_TPZ, - VC4_SCALING_PPF, -}; - -struct vc4_plane_state { - struct drm_plane_state base; - /* System memory copy of the display list for this element, computed - * at atomic_check time. - */ - u32 *dlist; - u32 dlist_size; /* Number of dwords allocated for the display list */ - u32 dlist_count; /* Number of used dwords in the display list. */ - - /* Offset in the dlist to various words, for pageflip or - * cursor updates. - */ - u32 pos0_offset; - u32 pos2_offset; - u32 ptr0_offset; - - /* Offset where the plane's dlist was last stored in the - * hardware at vc4_crtc_atomic_flush() time. - */ - u32 __iomem *hw_dlist; - - /* Clipped coordinates of the plane on the display. */ - int crtc_x, crtc_y, crtc_w, crtc_h; - /* Clipped area being scanned from in the FB. */ - u32 src_x, src_y; - - u32 src_w[2], src_h[2]; - - /* Scaling selection for the RGB/Y plane and the Cb/Cr planes. */ - enum vc4_scaling_mode x_scaling[2], y_scaling[2]; - bool is_unity; - bool is_yuv; - - /* Offset to start scanning out from the start of the plane's - * BO. - */ - u32 offsets[3]; - - /* Our allocation in LBM for temporary storage during scaling. */ - struct drm_mm_node lbm; - - /* Set when the plane has per-pixel alpha content or does not cover - * the entire screen. This is a hint to the CRTC that it might need - * to enable background color fill. - */ - bool needs_bg_fill; -}; - -static inline struct vc4_plane_state * -to_vc4_plane_state(struct drm_plane_state *state) -{ - return (struct vc4_plane_state *)state; -} - static const struct hvs_format { u32 drm; /* DRM_FORMAT_* */ u32 hvs; /* HVS_FORMAT_* */