From patchwork Fri Aug 10 13:28:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 143924 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3360534ljj; Fri, 10 Aug 2018 06:29:19 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwuKVw3IE+Ya4T1ltB6r5XQy6P5rEZjZViHvqTqryAGfGmFPgep2kGSHrtOrAfpdn3uvjtH X-Received: by 2002:a63:dd49:: with SMTP id g9-v6mr6448148pgj.356.1533907759563; Fri, 10 Aug 2018 06:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533907759; cv=none; d=google.com; s=arc-20160816; b=OZMhfFj7QxTOEQD3bfyH/pLRC6t7VC4aEqFkyrLrYg7HoaPR1OQh1+QpcX9ctdIBp7 3IV6vQWBm+JLLQSKGi1vWlnNu/W8iYLBwDCgw8jVjK4zGwAKMESZqPaov6ALbmXi2noO 7SohjbjN5jpKoq6pMmbX3aETE5WlILH5XQBeZuQtDwYJJ5bm1E5aL5kNjhr0tRzIkLLX Thhn6U645nM5Zvwdx2Gxd2U9PhPv0pazCOTuurllsqs4vOZLwQEA2AkWDc6b0WCTggQj UgDPm0eEiisuxzVTsEHlOuxtrKQQNKt7p8Ps8CRCGsSf8Dq7bnl1HVFJmtMjVVKItLui JSXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :in-reply-to:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=bbgQ1NVhUsnXDO2BpEmgNdQTYJNBqdedg+R5msMKCWU=; b=oFBwZA6JYJ0lLMV4uUDEP1AlwJZ/c+KWVqiTrfZg3kmujPDzQ3TUcInu2evICKpDaz OqhTfRbR0aoND9mFKAOmLm2P6k5E/O9AEevcFZesDqiLdsUDIJ8/AUVdsvPrwrb06Do8 Z9aiy35ugAP4s5qJzL4xyFT0TTyGMF6WbovSItxGhQ904mkVq2P7QLxxuIaCGqC/1WcK j+FiqWX4ggU5GKAn0V+Ee2MkOlXWiXYyyHuIx42scMHlXdU2DgefkBowfBlg+geISFtS y/2CdFlnKFYIRcLlWr5tha7/7SADqv8R2bM84SFTjAhP+7RcGV99tP+MabuDwwmtMp/M kGGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Pp48+RU9; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e186-v6si10172744pfc.176.2018.08.10.06.29.19; Fri, 10 Aug 2018 06:29:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Pp48+RU9; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727341AbeHJP7N (ORCPT + 3 others); Fri, 10 Aug 2018 11:59:13 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:56341 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727563AbeHJP7N (ORCPT ); Fri, 10 Aug 2018 11:59:13 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180810132916euoutp022064c9914528fc43cd8e47f29e2647d0~JiPpbi_V41132511325euoutp02H for ; Fri, 10 Aug 2018 13:29:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180810132916euoutp022064c9914528fc43cd8e47f29e2647d0~JiPpbi_V41132511325euoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1533907756; bh=bbgQ1NVhUsnXDO2BpEmgNdQTYJNBqdedg+R5msMKCWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pp48+RU9khZnAh37QY8LgLggB/pRxEAMjpNEBi6KannqJpLNXEu1mA+IMp4PtoHYq f2Ykw+YiIFee/cIZOiysep4Rnbh1ZbUXFzW3Gf4sYJ5rG5ElZ85Fdeym1mPnLzCfWB lNGCXRvFEgsrvR36qm1ilR9kr9KdJJRpERq7sJXo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180810132916eucas1p1dcf64464796b978073ce36e16a3ab964~JiPpBdW6w2268722687eucas1p1e; Fri, 10 Aug 2018 13:29:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5A.C2.04294.C239D6B5; Fri, 10 Aug 2018 14:29:16 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20180810132915eucas1p270d9df94b0aaaa17b0eddfb8682bd3bd~JiPoK4ppk2592125921eucas1p2z; Fri, 10 Aug 2018 13:29:15 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180810132915eusmtrp1b6d473a4b2f38bf837ffa68c0eca6655~JiPn7Ecrb1157411574eusmtrp1w; Fri, 10 Aug 2018 13:29:15 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-7c-5b6d932ca03d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D3.BA.04128.B239D6B5; Fri, 10 Aug 2018 14:29:15 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.116.147.25]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180810132914eusmtip147b119c0345a0873c0226f10950f6e86~JiPngfwuM1796317963eusmtip1y; Fri, 10 Aug 2018 13:29:14 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Pietrasiewicz Subject: [PATCH 1/3] drm: drm_fourcc: add Samsung 16x16 tile format Date: Fri, 10 Aug 2018 15:28:59 +0200 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810132901.11844-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRmVeSWpSXmKPExsWy7djPc7o6k3OjDVac4rWY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoErY/p+1oJezopjM2azNzCeYu9i5OSQEDCR2PN3CVsXIxeHkMAKRolfew8xQjhfGCVu zXrNCuF8ZpR49XsDI0zLhe97oFqWM0pMa3wH5XxllFi14DozSBWbgKFE19suNhBbRMBNounw TLBRzAKPGSXW7t4Mtl1YwFni4dIpLCA2i4CqxJMlz6GukpdYveEA0CAODk4BO4l78zJAeiUE 7rNJ7P/zDuwMXoEyiRMn9jBB1LtIPJr8hgXCFpZ4dXwL1BwZidOTe1ggmpsZJdpnzGKHcHoY JbbO2cEGUWUtcfj4RVaQbcwCmhLrd+mDmBICjhLfJxdBmHwSN94KghQzA5mTtk1nhgjzSnS0 CUHMUJOYdXwd3NaDFy5BlXhIXGlxgATPREaJXVPbGScwys9CWLWAkXEVo3hqaXFuemqxUV5q uV5xYm5xaV66XnJ+7iZGYDo4/e/4lx2Mu/4kHWIU4GBU4uEVKM6JFmJNLCuuzD3EKMHBrCTC m2maGy3Em5JYWZValB9fVJqTWnyIUZqDRUmcl08rLVpIID2xJDU7NbUgtQgmy8TBKdXA2K+d YrV4ldcrh38ejiWu0wzUeLLkD7dyRDS4rLE+VtNxsizx9bLLurkbtHQCH3w3Tduad7LG0v+P zbVI54M/7gQ/9276Hqu09I1Kg3Pq0blCGUnnNCz+lkqwMC55bp/6u6AjsN1L3KM+PWchc7Tn wQs3mb9dO+Sk8mSRyLfSWVfu1Ta/d89TYinOSDTUYi4qTgQARjW6FwMDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t/xu7rak3OjDV5vE7SY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOUrPpii/tCRV ISO/uMRWKdrQwkjP0NJCz8jEUs/Q2DzWyshUSd/OJiU1J7MstUjfLkEvY/p+1oJezopjM2az NzCeYu9i5OSQEDCRuPB9D1sXIxeHkMBSRolj52+zQSRkJE5Oa2CFsIUl/lzrgir6zCjxYdIj ZpAEm4ChRNfbLrAGEQEPieZvx9lBipgFnjJKfD34gwUkISzgLPFw6RQwm0VAVeLJkudARRwc vAK2Ep1TQiEWyEus3nCAGSTMKWAncW9eBkhYCKhiwt2DLBMY+RYwMqxiFEktLc5Nzy020itO zC0uzUvXS87P3cQIDM5tx35u2cHY9S74EKMAB6MSDy9Dak60EGtiWXFl7iFGCQ5mJRHeTNPc aCHelMTKqtSi/Pii0pzU4kOMpkAnTWSWEk3OB0ZOXkm8oamhuYWlobmxubGZhZI473mDyigh gfTEktTs1NSC1CKYPiYOTqkGxp328/4I5j/g2RB/8u372Cmnew2v83j2iaY1Sp6S8Cp1jXkU pfxh9mmxGnWbp33tCj89jnKfdZ61W+RyvZBv09KvEq889u+4rDR9a/CC/6zZWo8WLm3gv75g TvWbzAvPzleUy3PPXCZbrxKavEX9ZnHk/7zie7r9BwwLLr98m6W80MvR6OI6FSWW4oxEQy3m ouJEABKv/ExkAgAA Message-Id: <20180810132915eucas1p270d9df94b0aaaa17b0eddfb8682bd3bd~JiPoK4ppk2592125921eucas1p2z@eucas1p2.samsung.com> X-CMS-MailID: 20180810132915eucas1p270d9df94b0aaaa17b0eddfb8682bd3bd X-Msg-Generator: CA X-RootMTR: 20180810132915eucas1p270d9df94b0aaaa17b0eddfb8682bd3bd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180810132915eucas1p270d9df94b0aaaa17b0eddfb8682bd3bd References: <20180810132901.11844-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Andrzej Pietrasiewicz Add modifier for tiled formats used by graphics modules found in Samsung Exynos5250/542x/5433 SoCs. This is a simple tiled layout using tiles of 16x16 pixels in a row-major layout. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Marek Szyprowski --- include/uapi/drm/drm_fourcc.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.1 Reviewed-by: Inki Dae diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 721ab7e54d96..5631b196c07a 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -299,6 +299,15 @@ extern "C" { */ #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) +/* + * Tiled, 16 (pixels) x 16 (lines) - sized macroblocks + * + * This is a simple tiled layout using tiles of 16x16 pixels in a row-major + * layout. For YCbCr formats Cb/Cr components are taken in such a way that + * they correspond to their 16x16 luma block. + */ +#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2) + /* * Qualcomm Compressed Format * From patchwork Fri Aug 10 13:29:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 143926 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3360547ljj; Fri, 10 Aug 2018 06:29:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzvK4f9zV1kj3bI7lz3gFVQxm3dvQGAQJN08/LrqzaXWerrQ4gOuQxOFlsTaFJ6LFKBfIVn X-Received: by 2002:a63:4811:: with SMTP id v17-v6mr6331603pga.379.1533907760413; Fri, 10 Aug 2018 06:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533907760; cv=none; d=google.com; s=arc-20160816; b=e7LqDHQnuJzNCsBqWc57YmHgu94quAL6aC6CIpfvuxKt31SQ1osVCg2FrO9KE0/VSf +3mxGszdgBjqEePI4Dr0o+S7suRQlnLsM+fSV3xn9aDfW1X9SGKBT8GDM4GEy49YoALD +zvr8TrLfXwSqEWbjNeVnyOUcSDMIJIakcpCg4PW3ZmfyRRf0GzP17m69QHOW7uFR1BI GZtBVb4pFYljo8EAlk9PJDq3nz7eKRvZiPr5FP1yfTZJH+Tki/Q3IsCyQ9Zk2Wtov+XY 3ijE8lo9VzTzX08e70WXIEkqG6ihOBxaryu+a4WOpWxtRVuMosW35LLvYLRSZEomysVc bKeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :in-reply-to:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=PzBr86ZrJE0qCtnq7M1FZEIjT79OvQBy+sjKRQIsi1Q=; b=CXdQWM8nehEISzx3oa1B7OfJSyN3U9pp3GPGpracgF7gRqF8uZkdP+7Rtuklss5cVn zeuRSbNDTTn13FQ4zqqDXQZ+JURT35JG1aeJ95NDiw9Xpd8YoOaJw+xIe2h1bKMBLuoT SfxhwQ7xzdMvZq18awEWtGBHxoh0jdguSo6OImdzdv5bRNCSNOtQHYXle3xJ9nRYKUEL pRHji3WpWem/JT7g4uIWbU54+uoqS0AmP7oX/4u7y933p8w3XcxIeqB4LkIpi/qlZz0W E+XPFrdZw5RRVQw6Q+u55zaGXgqxZLOqLb1gvTDmat1EhM82EVXgiI+h/mZQufjYSBRw ukoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=X9Uv0MxR; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e186-v6si10172744pfc.176.2018.08.10.06.29.20; Fri, 10 Aug 2018 06:29:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=X9Uv0MxR; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727864AbeHJP7O (ORCPT + 3 others); Fri, 10 Aug 2018 11:59:14 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:56347 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727630AbeHJP7O (ORCPT ); Fri, 10 Aug 2018 11:59:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180810132917euoutp0238e095f1d9c915cb1673481cabd47bbe~JiPqDkUna1079610796euoutp02u for ; Fri, 10 Aug 2018 13:29:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180810132917euoutp0238e095f1d9c915cb1673481cabd47bbe~JiPqDkUna1079610796euoutp02u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1533907757; bh=PzBr86ZrJE0qCtnq7M1FZEIjT79OvQBy+sjKRQIsi1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X9Uv0MxRfouoHT4qX3g9TaHGgroRB+zSz85ullW+SQya2n6u7q65fa26kIkX7jHLy 0ZvXNrd0XeO9PmtFrjaJQ0N9aNgzNAMZ2GNM4HNPcC2lE1h76HOUdBqlxPjcChdzNq mb1W5WgfUn8RMM31+PC0IjVeAHbBELhY5fp85YnM= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180810132916eucas1p2126b5d6050cc94a7838456ea1d6847b6~JiPpXXdkf2600526005eucas1p2Q; Fri, 10 Aug 2018 13:29:16 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B8.B7.04806.C239D6B5; Fri, 10 Aug 2018 14:29:16 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180810132915eucas1p18c60ec0bc72fb40b53d0f41a3d43c565~JiPohZpxV1504615046eucas1p1-; Fri, 10 Aug 2018 13:29:15 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180810132915eusmtrp116f1a777b49a152169b269b050f27845~JiPoSEwuR1157411574eusmtrp1y; Fri, 10 Aug 2018 13:29:15 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-93-5b6d932c2c4e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D5.BB.04284.B239D6B5; Fri, 10 Aug 2018 14:29:15 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.116.147.25]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180810132915eusmtip15d12f1d7061856b1c70a55df5fc66c7e~JiPn5md6s1891018910eusmtip1a; Fri, 10 Aug 2018 13:29:15 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Pietrasiewicz Subject: [PATCH 2/3] drm/exynos: scaler: Add support for tiled formats Date: Fri, 10 Aug 2018 15:29:00 +0200 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810132901.11844-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIIsWRmVeSWpSXmKPExsWy7djP87o6k3OjDSbMUraY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr49L+DqaCRdYV59rLGxh7jLoYOTkkBEwk7n3dxNbFyMUhJLCCUWL3xiPsIAkhgS+M EqdbUiESnxkljrRcZofpeNe1lgkisZxR4tfJ6ywQzldGiWczj7KCVLEJGEp0ve1iA7FFBNwk mg7PZAUpYhZ4zCixdvdmsFHCQImZZ94zgdgsAqoSW2ddYYVYIS+xesMB5i5GDg5OATuJe/My QHolBB6zSbSfOc4CUsMrUCbRdf0CVL2LxMxH0xkhbGGJV8e3QJ0qI3F6cg8LRHMzo0T7jFns EE4Po8TWOTvYIKqsJQ4fv8gKso1ZQFNi/S59iLCjRGfrVkaQsIQAn8SNt4IgYWYgc9K26cwQ YV6JjjYhiGo1iVnH18GtPXjhEjOE7SGx5t0vRkgATWSUeLp9B/MERvlZCMsWMDKuYhRPLS3O TU8tNs5LLdcrTswtLs1L10vOz93ECEwIp/8d/7qDcd+fpEOMAhyMSjy8DKk50UKsiWXFlbmH GCU4mJVEeDNNc6OFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8/JppUULCaQnlqRmp6YWpBbBZJk4 OKUaGCXFSxZLL2lqOyPF3sD8IPN34LxG6Xj7jFmLn/xq41Zb2JA9TVtWskk3MIaJ/YFg5cRz onUxlmq3MqZrWDa9U7/HuvKJu+dzfuefEs9kQ0J0Zkkc2fHmhUChfNPPP3XXRad/SdM6Nel/ W9XSIqlvdg8X8+wt2vfKXKz6+fJ7V/KuPDkr+8Q3VomlOCPRUIu5qDgRAGvzB/YEAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t/xu7rak3OjDVbs1rKY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOUrPpii/tCRV ISO/uMRWKdrQwkjP0NJCz8jEUs/Q2DzWyshUSd/OJiU1J7MstUjfLkEv49L+DqaCRdYV59rL Gxh7jLoYOTkkBEwk3nWtZQKxhQSWMkpcmpwAEZeRODmtgRXCFpb4c62LrYuRC6jmM6PEnoXz 2EASbAKGEl1vu8BsEQEPieZvx9lBipgFnjJKfD34gwUkISzgJjHzzHuwDSwCqhJbZ10Bm8or YCtx7+8BJogN8hKrNxxg7mLk4OAUsJO4Ny8D4iBbiQl3D7JMYORbwMiwilEktbQ4Nz232FCv ODG3uDQvXS85P3cTIzA4tx37uXkH46WNwYcYBTgYlXh4GVJzooVYE8uKK3MPMUpwMCuJ8Gaa 5kYL8aYkVlalFuXHF5XmpBYfYjQFumkis5Rocj4wcvJK4g1NDc0tLA3Njc2NzSyUxHnPG1RG CQmkJ5akZqemFqQWwfQxcXBKNTDmmkk/b2eY0pHSf+E733xGc79Hx6P1Pb+KnmqRePJnQnuH 7Ixz59iOpczkufv+lFOLl2x79Os/dYFaMcL7V9jmZEfp20nv3/VPyfnvv59bLx09+o7lo8Ej xs3TH86xX+P8SfmiIPdZnzm3pK1OZBw/YqlTPqN36WUO5gUGs00NHrxzcp/fsEhXiaU4I9FQ i7moOBEACXsdqmQCAAA= Message-Id: <20180810132915eucas1p18c60ec0bc72fb40b53d0f41a3d43c565~JiPohZpxV1504615046eucas1p1-@eucas1p1.samsung.com> X-CMS-MailID: 20180810132915eucas1p18c60ec0bc72fb40b53d0f41a3d43c565 X-Msg-Generator: CA X-RootMTR: 20180810132915eucas1p18c60ec0bc72fb40b53d0f41a3d43c565 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180810132915eucas1p18c60ec0bc72fb40b53d0f41a3d43c565 References: <20180810132901.11844-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Andrzej Pietrasiewicz Add support for 16x16 tiled formats: NV12/NV21, YUYV and YUV420. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 133 ++++++++++++--------- 1 file changed, 75 insertions(+), 58 deletions(-) -- 2.17.1 diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index 0ddb6eec7b11..8e761ef63eac 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -49,56 +49,46 @@ struct scaler_context { const struct scaler_data *scaler_data; }; -static u32 scaler_get_format(u32 drm_fmt) +struct scaler_format { + u32 drm_fmt; + u32 internal_fmt; + u32 chroma_tile_w; + u32 chroma_tile_h; +}; + +static const struct scaler_format scaler_formats[] = { + { DRM_FORMAT_NV12, SCALER_YUV420_2P_UV, 8, 8 }, + { DRM_FORMAT_NV21, SCALER_YUV420_2P_VU, 8, 8 }, + { DRM_FORMAT_YUV420, SCALER_YUV420_3P, 8, 8 }, + { DRM_FORMAT_YUYV, SCALER_YUV422_1P_YUYV, 16, 16 }, + { DRM_FORMAT_UYVY, SCALER_YUV422_1P_UYVY, 16, 16 }, + { DRM_FORMAT_YVYU, SCALER_YUV422_1P_YVYU, 16, 16 }, + { DRM_FORMAT_NV16, SCALER_YUV422_2P_UV, 8, 16 }, + { DRM_FORMAT_NV61, SCALER_YUV422_2P_VU, 8, 16 }, + { DRM_FORMAT_YUV422, SCALER_YUV422_3P, 8, 16 }, + { DRM_FORMAT_NV24, SCALER_YUV444_2P_UV, 16, 16 }, + { DRM_FORMAT_NV42, SCALER_YUV444_2P_VU, 16, 16 }, + { DRM_FORMAT_YUV444, SCALER_YUV444_3P, 16, 16 }, + { DRM_FORMAT_RGB565, SCALER_RGB_565, 0, 0 }, + { DRM_FORMAT_XRGB1555, SCALER_ARGB1555, 0, 0 }, + { DRM_FORMAT_ARGB1555, SCALER_ARGB1555, 0, 0 }, + { DRM_FORMAT_XRGB4444, SCALER_ARGB4444, 0, 0 }, + { DRM_FORMAT_ARGB4444, SCALER_ARGB4444, 0, 0 }, + { DRM_FORMAT_XRGB8888, SCALER_ARGB8888, 0, 0 }, + { DRM_FORMAT_ARGB8888, SCALER_ARGB8888, 0, 0 }, + { DRM_FORMAT_RGBX8888, SCALER_RGBA8888, 0, 0 }, + { DRM_FORMAT_RGBA8888, SCALER_RGBA8888, 0, 0 }, +}; + +static const struct scaler_format *scaler_get_format(u32 drm_fmt) { - switch (drm_fmt) { - case DRM_FORMAT_NV12: - return SCALER_YUV420_2P_UV; - case DRM_FORMAT_NV21: - return SCALER_YUV420_2P_VU; - case DRM_FORMAT_YUV420: - return SCALER_YUV420_3P; - case DRM_FORMAT_YUYV: - return SCALER_YUV422_1P_YUYV; - case DRM_FORMAT_UYVY: - return SCALER_YUV422_1P_UYVY; - case DRM_FORMAT_YVYU: - return SCALER_YUV422_1P_YVYU; - case DRM_FORMAT_NV16: - return SCALER_YUV422_2P_UV; - case DRM_FORMAT_NV61: - return SCALER_YUV422_2P_VU; - case DRM_FORMAT_YUV422: - return SCALER_YUV422_3P; - case DRM_FORMAT_NV24: - return SCALER_YUV444_2P_UV; - case DRM_FORMAT_NV42: - return SCALER_YUV444_2P_VU; - case DRM_FORMAT_YUV444: - return SCALER_YUV444_3P; - case DRM_FORMAT_RGB565: - return SCALER_RGB_565; - case DRM_FORMAT_XRGB1555: - return SCALER_ARGB1555; - case DRM_FORMAT_ARGB1555: - return SCALER_ARGB1555; - case DRM_FORMAT_XRGB4444: - return SCALER_ARGB4444; - case DRM_FORMAT_ARGB4444: - return SCALER_ARGB4444; - case DRM_FORMAT_XRGB8888: - return SCALER_ARGB8888; - case DRM_FORMAT_ARGB8888: - return SCALER_ARGB8888; - case DRM_FORMAT_RGBX8888: - return SCALER_RGBA8888; - case DRM_FORMAT_RGBA8888: - return SCALER_RGBA8888; - default: - break; - } + int i; - return 0; + for (i = 0; i < ARRAY_SIZE(scaler_formats); i++) + if (scaler_formats[i].drm_fmt == drm_fmt) + return &scaler_formats[i]; + + return NULL; } static inline int scaler_reset(struct scaler_context *scaler) @@ -152,11 +142,11 @@ static inline void scaler_enable_int(struct scaler_context *scaler) } static inline void scaler_set_src_fmt(struct scaler_context *scaler, - u32 src_fmt) + u32 src_fmt, u32 tile) { u32 val; - val = SCALER_SRC_CFG_SET_COLOR_FORMAT(src_fmt); + val = SCALER_SRC_CFG_SET_COLOR_FORMAT(src_fmt) | (tile << 10); scaler_write(val, SCALER_SRC_CFG); } @@ -188,15 +178,19 @@ static inline void scaler_set_src_span(struct scaler_context *scaler, scaler_write(val, SCALER_SRC_SPAN); } -static inline void scaler_set_src_luma_pos(struct scaler_context *scaler, - struct drm_exynos_ipp_task_rect *src_pos) +static inline void scaler_set_src_luma_chroma_pos(struct scaler_context *scaler, + struct drm_exynos_ipp_task_rect *src_pos, const struct scaler_format *fmt) { u32 val; val = SCALER_SRC_Y_POS_SET_YH_POS(src_pos->x << 2); val |= SCALER_SRC_Y_POS_SET_YV_POS(src_pos->y << 2); scaler_write(val, SCALER_SRC_Y_POS); - scaler_write(val, SCALER_SRC_C_POS); /* ATTENTION! */ + val = SCALER_SRC_C_POS_SET_CH_POS( + (src_pos->x * fmt->chroma_tile_w / 16) << 2); + val |= SCALER_SRC_C_POS_SET_CV_POS( + (src_pos->y * fmt->chroma_tile_h / 16) << 2); + scaler_write(val, SCALER_SRC_C_POS); } static inline void scaler_set_src_wh(struct scaler_context *scaler, @@ -366,10 +360,10 @@ static int scaler_commit(struct exynos_drm_ipp *ipp, struct scaler_context *scaler = container_of(ipp, struct scaler_context, ipp); - u32 src_fmt = scaler_get_format(task->src.buf.fourcc); + const struct scaler_format *src_fmt = scaler_get_format(task->src.buf.fourcc); struct drm_exynos_ipp_task_rect *src_pos = &task->src.rect; - u32 dst_fmt = scaler_get_format(task->dst.buf.fourcc); + const struct scaler_format *dst_fmt = scaler_get_format(task->dst.buf.fourcc); struct drm_exynos_ipp_task_rect *dst_pos = &task->dst.rect; pm_runtime_get_sync(scaler->dev); @@ -380,13 +374,14 @@ static int scaler_commit(struct exynos_drm_ipp *ipp, scaler->task = task; - scaler_set_src_fmt(scaler, src_fmt); + scaler_set_src_fmt( + scaler, src_fmt->internal_fmt, task->src.buf.modifier != 0); scaler_set_src_base(scaler, &task->src); scaler_set_src_span(scaler, &task->src); - scaler_set_src_luma_pos(scaler, src_pos); + scaler_set_src_luma_chroma_pos(scaler, src_pos, src_fmt); scaler_set_src_wh(scaler, src_pos); - scaler_set_dst_fmt(scaler, dst_fmt); + scaler_set_dst_fmt(scaler, dst_fmt->internal_fmt); scaler_set_dst_base(scaler, &task->dst); scaler_set_dst_span(scaler, &task->dst); scaler_set_dst_luma_pos(scaler, dst_pos); @@ -617,6 +612,16 @@ static const struct drm_exynos_ipp_limit scaler_5420_one_pixel_limits[] = { .v = { 65536 * 1 / 4, 65536 * 16 }) }, }; +static const struct drm_exynos_ipp_limit scaler_5420_tile_limits[] = { + { IPP_SIZE_LIMIT(BUFFER, .h = { 16, SZ_8K }, .v = { 16, SZ_8K })}, + { IPP_SIZE_LIMIT(AREA, .h.align = 16, .v.align = 16) }, + { IPP_SCALE_LIMIT(.h = {1, 1}, .v = {1, 1})}, + { } +}; + +#define IPP_SRCDST_TILE_FORMAT(f, l) \ + IPP_SRCDST_MFORMAT(f, DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, (l)) + static const struct exynos_drm_ipp_formats exynos5420_formats[] = { /* SCALER_YUV420_2P_UV */ { IPP_SRCDST_FORMAT(NV21, scaler_5420_two_pixel_hv_limits) }, @@ -680,6 +685,18 @@ static const struct exynos_drm_ipp_formats exynos5420_formats[] = { /* SCALER_RGBA8888 */ { IPP_SRCDST_FORMAT(RGBA8888, scaler_5420_one_pixel_limits) }, + + /* SCALER_YUV420_2P_UV TILE */ + { IPP_SRCDST_TILE_FORMAT(NV21, scaler_5420_tile_limits) }, + + /* SCALER_YUV420_2P_VU TILE */ + { IPP_SRCDST_TILE_FORMAT(NV12, scaler_5420_tile_limits) }, + + /* SCALER_YUV420_3P TILE */ + { IPP_SRCDST_TILE_FORMAT(YUV420, scaler_5420_tile_limits) }, + + /* SCALER_YUV422_1P_YUYV TILE */ + { IPP_SRCDST_TILE_FORMAT(YUYV, scaler_5420_tile_limits) }, }; static const struct scaler_data exynos5420_data = { From patchwork Fri Aug 10 13:29:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 143925 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3360544ljj; Fri, 10 Aug 2018 06:29:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzJccP7cGmHu8+8dB67P+tlY/CBSBNBI42teSqoX0DOWfhDCM55Cr6uFYovvbTwAxqcbCwq X-Received: by 2002:a17:902:342:: with SMTP id 60-v6mr6155937pld.15.1533907760134; Fri, 10 Aug 2018 06:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533907760; cv=none; d=google.com; s=arc-20160816; b=JrZmVoXaT6+b7EJ9MoCiqgY5IHJK31OoAeGgZYS/5TE9jDnet62Sef2AyOWJz6SntD c/5fAG6m3oibQBJ+OxdcK6neATgKwZRMfOSCIrn/447ryhyqTu8KfZyRlJIRZwHvIyvg xQizyDk6+r0zbxA2WXnFN14CDVCoWsE5rJcTBVBi21pYhjd+XCDmD3GdL7UF9QgnLfYg Zw7B0XbDpPjIEnR1P/iPixftuqIn9oBW5GB2gzMVWYiPiq+QhBHl53CQoJoOV95fmJhH Hml372WxxhNvLeAEpI0g7C70QWgNl6n68Ytm8FQP3oV7xvChPI1Bb1dEtmAAdaA4P2Rl HuHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :in-reply-to:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=AYvc+NdNL6Ia3GjEn6O/qml54FDnLBp/Fuku8xBtmu8=; b=DkvLpgXCa9ydeD39htFkGJmGNqjOAqPGrXUR54ijZEAh1/WU17oLpjfqqmbEvz0rDL PQaQ+WZmqVT5MYkf0h4NnRBD25SjEOAVbPOwk6wcWgHrToOrlKFIwUhXqRHJTGuVeIcw Vo7PMKOTG5xzpFcbDriWYBuT3uo3qp6bz8ekVUyy5JjmXx8xQqmVikDZYAK49e3pwE0B lPTNpJzPhjgRMvGN5tjI5wvXrhLv4MwrJ3Y55h7da7PXoDwgagt9Bt9Pv0r0tLciDzj8 lEsugff7aGyZE+r1Y9gtk6mITMB2Cl4hv3c9nrX1Lmn/RiZ2Jn6AssPCBhBnva+Rdpxq WoVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ijnQgcDW; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e186-v6si10172744pfc.176.2018.08.10.06.29.19; Fri, 10 Aug 2018 06:29:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ijnQgcDW; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbeHJP7O (ORCPT + 3 others); Fri, 10 Aug 2018 11:59:14 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:56348 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbeHJP7N (ORCPT ); Fri, 10 Aug 2018 11:59:13 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180810132917euoutp0215a156ab913cade046461f214b2db06e~JiPqJQaqe1078710787euoutp02z for ; Fri, 10 Aug 2018 13:29:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180810132917euoutp0215a156ab913cade046461f214b2db06e~JiPqJQaqe1078710787euoutp02z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1533907757; bh=AYvc+NdNL6Ia3GjEn6O/qml54FDnLBp/Fuku8xBtmu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ijnQgcDWUCN2LVxxra/bkptJ9l3rrcg1zqx0ijdBJOptoAVVL8TmhkE+50faIqnWQ 1y0zRp+PUAGZEq7WPm6b/OiC/67D1TR3FkpHC0kLOPcX83WCoRJIwIlS+S+ABMVzuL CnAiLg5+ZeCTe/idhYJBH+vDLjq94T0bwHz4P1UE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180810132917eucas1p1f2c330ff0a401fc9c3f113ed4e593bbc~JiPpfQ1Pc2268722687eucas1p1g; Fri, 10 Aug 2018 13:29:17 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id DA.C2.04294.C239D6B5; Fri, 10 Aug 2018 14:29:16 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180810132916eucas1p1539d4d2c2d1eb4fc0ae95cd504fad927~JiPosCC_B0188601886eucas1p1T; Fri, 10 Aug 2018 13:29:16 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180810132916eusmtrp123e3be6116e4fec88047cb5c08be6f85~JiPoq4mpi1157411574eusmtrp10; Fri, 10 Aug 2018 13:29:16 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-7d-5b6d932c6840 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 97.BA.04128.C239D6B5; Fri, 10 Aug 2018 14:29:16 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.116.147.25]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180810132915eusmtip17ce3cbd7bb222122bb5a3beeca0c8b2a~JiPoSS4u81796317963eusmtip1z; Fri, 10 Aug 2018 13:29:15 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Pietrasiewicz Subject: [PATCH 3/3] drm/exynos: gsc: Add support for tiled formats Date: Fri, 10 Aug 2018 15:29:01 +0200 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810132901.11844-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEIsWRmVeSWpSXmKPExsWy7djPc7o6k3OjDZqWaFvMetnOYrFxxnpW iytf37NZTLo/gcVixvl9TBZrj9xlt5gx+SWbA7vH/e7jTB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CV8efwMfaCzwoVZx+uYm5gnCvdxcjJISFgIrGo/QdbFyMXh5DACkaJRx23mEESQgJf GCUalmhCJD4zSjxd85wVpqPl6ydmiMRyRomFYAkQ5yujxIUt+8Cq2AQMJbredrGB2CICbhJN h2eCFTELPGaUWLt7MztIQljAWeLQ0bNgNouAqsSluy1QK+QlVm84ALSCg4NTwE7i3rwMkF4J gcdsEgveHGQBqeEVKJN4vHkqI0S9i0TX/T9MELawxKvjW9ghbBmJ05N7WCCamxkl2mfMYodw ehglts7ZwQZRZS1x+PhFVpBtzAKaEut36UOEHSUeHv/GDhKWEOCTuPFWECTMDGRO2jadGSLM K9HRJgRRrSYx6/g6uLUHL1xihrA9JObf/ccCCaCJjBIffi9jm8AoPwth2QJGxlWM4qmlxbnp qcVGeanlesWJucWleel6yfm5mxiBKeH0v+NfdjDu+pN0iFGAg1GJh1egOCdaiDWxrLgy9xCj BAezkghvpmlutBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFePq20aCGB9MSS1OzU1ILUIpgsEwen VAMj/8lJ02ZmpCXJtByMzw8o6WQ2z4369mbBwUu/zCKPOCkVrz9zu9v81OJNBp8sJResj3yf FJt1LC/+iteZj+sWhIt5xRpqszhkG8uc2v/uBPPNqxu0rnYufjX93iuGEJlat2C1qqqtp5ed OvhwZcaLv7cKbh/adu4Go138MoeCvqu2NzVeTOKbrcRSnJFoqMVcVJwIAG6j6GQFAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsVy+t/xu7o6k3OjDSYsZbeY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOUrPpii/tCRV ISO/uMRWKdrQwkjP0NJCz8jEUs/Q2DzWyshUSd/OJiU1J7MstUjfLkEv48/hY+wFnxUqzj5c xdzAOFe6i5GTQ0LARKLl6yfmLkYuDiGBpYwSex/cZYFIyEicnNbACmELS/y51sUGUfQZqGjC FCaQBJuAoUTXW5AEJ4eIgIdE87fj7CBFzAJPGSW+HvwBNklYwFni0NGz7CA2i4CqxKW7LUBT OTh4BWwlHs/IgFggL7F6wwFmkDCngJ3EvXlgYSGgigl3D7JMYORbwMiwilEktbQ4Nz232Eiv ODG3uDQvXS85P3cTIzA8tx37uWUHY9e74EOMAhyMSjy8DKk50UKsiWXFlbmHGCU4mJVEeDNN c6OFeFMSK6tSi/Lji0pzUosPMZoCnTSRWUo0OR8YO3kl8YamhuYWlobmxubGZhZK4rznDSqj hATSE0tSs1NTC1KLYPqYODilGhiPHHtz+32vv36vs1m9z6M3GU8yI38/LnnJeeK/YFed+KIl hbP5yu6nNEZVq2W+E/feq3I2+360SFXaWwPD+ry+Q7xbDb2uXY51TZk9+7xjXdPS1DVhOTvO eOy/4X/HdhbXXNN/IrVvNl5tW8PlGyHytebn78OML680L3X4Ij9RXDYqeF7d7sNKLMUZiYZa zEXFiQDWRj7gZQIAAA== Message-Id: <20180810132916eucas1p1539d4d2c2d1eb4fc0ae95cd504fad927~JiPosCC_B0188601886eucas1p1T@eucas1p1.samsung.com> X-CMS-MailID: 20180810132916eucas1p1539d4d2c2d1eb4fc0ae95cd504fad927 X-Msg-Generator: CA X-RootMTR: 20180810132916eucas1p1539d4d2c2d1eb4fc0ae95cd504fad927 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180810132916eucas1p1539d4d2c2d1eb4fc0ae95cd504fad927 References: <20180810132901.11844-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add support for 16x16 tiled NV12 and NV21 formats. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 46 ++++++++++++++++++------- 1 file changed, 34 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 7ba414b52faa..ce15d46bfce8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -448,7 +448,7 @@ static void gsc_handle_irq(struct gsc_context *ctx, bool enable, } -static void gsc_src_set_fmt(struct gsc_context *ctx, u32 fmt) +static void gsc_src_set_fmt(struct gsc_context *ctx, u32 fmt, bool tiled) { u32 cfg; @@ -514,6 +514,9 @@ static void gsc_src_set_fmt(struct gsc_context *ctx, u32 fmt) break; } + if (tiled) + cfg |= (GSC_IN_TILE_C_16x8 | GSC_IN_TILE_MODE); + gsc_write(cfg, GSC_IN_CON); } @@ -632,7 +635,7 @@ static void gsc_src_set_addr(struct gsc_context *ctx, u32 buf_id, gsc_src_set_buf_seq(ctx, buf_id, true); } -static void gsc_dst_set_fmt(struct gsc_context *ctx, u32 fmt) +static void gsc_dst_set_fmt(struct gsc_context *ctx, u32 fmt, bool tiled) { u32 cfg; @@ -698,6 +701,9 @@ static void gsc_dst_set_fmt(struct gsc_context *ctx, u32 fmt) break; } + if (tiled) + cfg |= (GSC_IN_TILE_C_16x8 | GSC_OUT_TILE_MODE); + gsc_write(cfg, GSC_OUT_CON); } @@ -1122,11 +1128,11 @@ static int gsc_commit(struct exynos_drm_ipp *ipp, return ret; } - gsc_src_set_fmt(ctx, task->src.buf.fourcc); + gsc_src_set_fmt(ctx, task->src.buf.fourcc, task->src.buf.modifier); gsc_src_set_transf(ctx, task->transform.rotation); gsc_src_set_size(ctx, &task->src); gsc_src_set_addr(ctx, 0, &task->src); - gsc_dst_set_fmt(ctx, task->dst.buf.fourcc); + gsc_dst_set_fmt(ctx, task->dst.buf.fourcc, task->dst.buf.modifier); gsc_dst_set_size(ctx, &task->dst); gsc_dst_set_addr(ctx, 0, &task->dst); gsc_set_prescaler(ctx, &ctx->sc, &task->src.rect, &task->dst.rect); @@ -1200,6 +1206,10 @@ static const unsigned int gsc_formats[] = { DRM_FORMAT_YUV420, DRM_FORMAT_YVU420, DRM_FORMAT_YUV422, }; +static const unsigned int gsc_tiled_formats[] = { + DRM_FORMAT_NV12, DRM_FORMAT_NV21, +}; + static int gsc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1207,23 +1217,24 @@ static int gsc_probe(struct platform_device *pdev) struct exynos_drm_ipp_formats *formats; struct gsc_context *ctx; struct resource *res; - int ret, i; + int num_formats, ret, i, j; ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; - formats = devm_kcalloc(dev, - ARRAY_SIZE(gsc_formats), sizeof(*formats), - GFP_KERNEL); - if (!formats) - return -ENOMEM; - driver_data = (struct gsc_driverdata *)of_device_get_match_data(dev); ctx->dev = dev; ctx->num_clocks = driver_data->num_clocks; ctx->clk_names = driver_data->clk_names; + /* construct formats/limits array */ + num_formats = ARRAY_SIZE(gsc_formats) + ARRAY_SIZE(gsc_tiled_formats); + formats = devm_kcalloc(dev, num_formats, sizeof(*formats), GFP_KERNEL); + if (!formats) + return -ENOMEM; + + /* linear formats */ for (i = 0; i < ARRAY_SIZE(gsc_formats); i++) { formats[i].fourcc = gsc_formats[i]; formats[i].type = DRM_EXYNOS_IPP_FORMAT_SOURCE | @@ -1231,8 +1242,19 @@ static int gsc_probe(struct platform_device *pdev) formats[i].limits = driver_data->limits; formats[i].num_limits = driver_data->num_limits; } + + /* tiled formats */ + for (j = i, i = 0; i < ARRAY_SIZE(gsc_tiled_formats); j++, i++) { + formats[j].fourcc = gsc_tiled_formats[i]; + formats[j].modifier = DRM_FORMAT_MOD_SAMSUNG_16_16_TILE; + formats[j].type = DRM_EXYNOS_IPP_FORMAT_SOURCE | + DRM_EXYNOS_IPP_FORMAT_DESTINATION; + formats[j].limits = driver_data->limits; + formats[j].num_limits = driver_data->num_limits; + } + ctx->formats = formats; - ctx->num_formats = ARRAY_SIZE(gsc_formats); + ctx->num_formats = num_formats; /* clock control */ for (i = 0; i < ctx->num_clocks; i++) {