From patchwork Mon Nov 30 03:12:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 7720841 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D367A9F30B for ; Mon, 30 Nov 2015 03:12:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08C5C2062E for ; Mon, 30 Nov 2015 03:12:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 420012062C for ; Mon, 30 Nov 2015 03:12:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE2936E4C5; Sun, 29 Nov 2015 19:12:40 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id E071E6E4BD for ; Sun, 29 Nov 2015 19:12:31 -0800 (PST) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYL00NE5Y8STA20@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 30 Nov 2015 12:12:28 +0900 (KST) Received: from epcpdlpp15 ( [172.20.52.115]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id DF.F1.04972.C9EBB565; Mon, 30 Nov 2015 12:12:28 +0900 (KST) X-AuditID: cbfee68e-f793c6d00000136c-b6-565bbe9c0300 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id A3.20.13906.C9EBB565; Mon, 30 Nov 2015 12:12:28 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYL00MGBY8OW830@mmp2.samsung.com>; Mon, 30 Nov 2015 12:12:27 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org, emil.l.velikov@gmail.com, jy0922.shim@samsung.com, inki.dae@samsung.com, human.hwang@samsung.com, tjakobi@math.uni-bielefeld.de Subject: [PATCH v3 6/9] exynos: fimg2d: add g2d_set_direction Date: Mon, 30 Nov 2015 12:12:18 +0900 Message-id: <1448853141-27791-7-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1448853141-27791-1-git-send-email-human.hwang@samsung.com> References: <1448853141-27791-1-git-send-email-human.hwang@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsWyRsSkWHfOvugwg/4HIhZXvr5ns9hz9R6T xdIZfawWk+5PYLF4ce8ii0Xb6g+sDmweO2fdZfe4332cyePfMXaPvi2rGANYorhsUlJzMstS i/TtErgynvfsZi3YLlLRs/sCWwPjI4EuRk4OCQETiYNzdjFB2GISF+6tZ+ti5OIQEpjFKNHV eowNpmjG7CZmuMTHZTuZIJwfjBJf52wFq2IT0JNYcO0HO4gtIrCCUWLOUicQW1jAVuJ+701m EJtFQFXi8YReVhCbV8Bd4u6xrVAb5CROHpsMFucU8JBYt/MN2ElCQDWzby5mBFkmIfCfTWLR 3oXsEIMEJL5NPsTSxcgBlJCV2HSAGWKOpMTBFTdYJjAKLWBkWMUomlqQXFCclF5kpFecmFtc mpeul5yfu4kRGLyn/z3r28F484D1IUYBDkYlHl4Js+gwIdbEsuLK3EOMpkAbJjJLiSbnA2Mk ryTe0NjMyMLUxNTYyNzSTEmcN0HqZ7CQQHpiSW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TXqYCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tobias Jakobi This allows setting the two direction registers, which specify how the engine blits pixels. This can be used for overlapping blits, which happen e.g. when 'moving' a rectangular region inside a fixed buffer. Reviewed-by: Hyungwon Hwang Signed-off-by: Tobias Jakobi Signed-off-by: Hyungwon Hwang --- Changes for v3: - Definitions of e_g2d_dir_mode, g2d_direction_val are moved to source file from header file exynos/exynos_fimg2d.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) -- 1.9.1 diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c index b10620b..3bef93b 100644 --- a/exynos/exynos_fimg2d.c +++ b/exynos/exynos_fimg2d.c @@ -65,6 +65,44 @@ enum g2d_base_addr_reg { g2d_src }; +enum e_g2d_dir_mode { + G2D_DIR_MODE_POSITIVE = 0, + G2D_DIR_MODE_NEGATIVE = 1 +}; + +union g2d_direction_val { + unsigned int val[2]; + struct { + /* SRC_MSK_DIRECT_REG [0:1] (source) */ + enum e_g2d_dir_mode src_x_direction:1; + enum e_g2d_dir_mode src_y_direction:1; + + /* SRC_MSK_DIRECT_REG [2:3] */ + unsigned int reversed1:2; + + /* SRC_MSK_DIRECT_REG [4:5] (mask) */ + enum e_g2d_dir_mode mask_x_direction:1; + enum e_g2d_dir_mode mask_y_direction:1; + + /* SRC_MSK_DIRECT_REG [6:31] */ + unsigned int padding1:26; + + /* DST_PAT_DIRECT_REG [0:1] (destination) */ + enum e_g2d_dir_mode dst_x_direction:1; + enum e_g2d_dir_mode dst_y_direction:1; + + /* DST_PAT_DIRECT_REG [2:3] */ + unsigned int reversed2:2; + + /* DST_PAT_DIRECT_REG [4:5] (pattern) */ + enum e_g2d_dir_mode pat_x_direction:1; + enum e_g2d_dir_mode pat_y_direction:1; + + /* DST_PAT_DIRECT_REG [6:31] */ + unsigned int padding2:26; + } data; +}; + static unsigned int g2d_get_scaling(unsigned int src, unsigned int dst) { /* @@ -242,6 +280,19 @@ static void g2d_add_base_addr(struct g2d_context *ctx, struct g2d_image *img, } /* + * g2d_set_direction - setup direction register (useful for overlapping blits). + * + * @ctx: a pointer to g2d_context structure. + * @dir: a pointer to the g2d_direction_val structure. + */ +static void g2d_set_direction(struct g2d_context *ctx, + const union g2d_direction_val *dir) +{ + g2d_add_cmd(ctx, SRC_MASK_DIRECT_REG, dir->val[0]); + g2d_add_cmd(ctx, DST_PAT_DIRECT_REG, dir->val[1]); +} + +/* * g2d_reset - reset fimg2d hardware. * * @ctx: a pointer to g2d_context structure.