From patchwork Fri Dec 14 12:10:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Manszewski X-Patchwork-Id: 10732861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAD1F14DE for ; Mon, 17 Dec 2018 07:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D233A2949C for ; Mon, 17 Dec 2018 07:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C68F1299E1; Mon, 17 Dec 2018 07:53:42 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 87AFA2949C for ; Mon, 17 Dec 2018 07:53:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF6EC6E2CC; Mon, 17 Dec 2018 07:53:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1672E6F45E for ; Fri, 14 Dec 2018 12:10:36 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181214121034euoutp010758d80e478582ad6cf153993f1364cd~wMc5gxwCv2420424204euoutp01k for ; Fri, 14 Dec 2018 12:10:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181214121034euoutp010758d80e478582ad6cf153993f1364cd~wMc5gxwCv2420424204euoutp01k Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214121033eucas1p285a93be22fde9770583d2a2af6f307a9~wMc42asHR1566115661eucas1p2s; Fri, 14 Dec 2018 12:10:33 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 95.7D.04294.9BD931C5; Fri, 14 Dec 2018 12:10:33 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181214121032eucas1p24af580721ebd6f86a4f9ddf701957ab6~wMc3_KReu1556815568eucas1p2h; Fri, 14 Dec 2018 12:10:32 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181214121032eusmtrp1fb5b974b3259c515c3b73cd7d2114a9a~wMc3uCJlG2638626386eusmtrp1T; Fri, 14 Dec 2018 12:10:32 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-19-5c139db971ce Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 00.91.04128.8BD931C5; Fri, 14 Dec 2018 12:10:32 +0000 (GMT) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181214121031eusmtip293d22b98bffcd885ff2210de090bdb53~wMc27XV0T0091800918eusmtip2i; Fri, 14 Dec 2018 12:10:31 +0000 (GMT) From: Christoph Manszewski To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/6] include/drm: color_mgmt: Add enum labels Date: Fri, 14 Dec 2018 13:10:16 +0100 Message-Id: <1544789421-5265-2-git-send-email-c.manszewski@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0hTYRj22zk7O85mx6Pph4biysAiNSn5QpMUwUN/rH4UlaRLD27kjU3N W2ReKk3zBilas6A0rTTX1FyZJMs5yokXZC1MQxQvpeQ0ylRyO1r/nvd5n+d93vfjIzFay3cl ZYkprDxREi8mhHh772/Dwc77jpF+uXV7kanZwEclBj0PtVa38JHu9WOARlYWCVQxXoajmS+D OCqdnMfQwMALAerP/SZAqslRPhrW3CNQ9cBbHnquHROghz/acDQx2w3QWKUWoOrKWeI4zSif ZTGqpkKC6fg5wWeU+lPM+G0dj3n56Bqj05gEzB11E2DMKveTtueFQbFsvCyNlfsGRwul76uM WLKeSDf/KiBywCi/CNiSkDoM/4zrQBEQkjT1BMDm6kmcK5YBNBcs8iwqmjIDWJPnvO1YGMwR cHwDgIbysH+Ghto63NIgqCPw89gSYcFO1B64Xt5kjcAoDR8uTK5apzpSx+DUx3qrCKe84Ju+ JetOIiocds73C7g0d/jJUIhZsC3FwHrNI+sgSJkE0PRVz+NEYbB1rZvgsCOc06m3zLvhh8pi nDPkAWhatlxtKcoAfPe0COdUgVBlnNucRG7u5w1bNL4cHQK7eg0CCw0pe2j87mChsU1Y0V6F cbQI3rpBc+p9cF6tJrZjZ8wrgMMM1HdvbD1pLYDvG41EGfCo+R/2AIAm4MKmKhLiWIV/InvF RyFJUKQmxvnEJCWowObf+rChW34FNGuXegBFAvEOkbSCjqT5kjRFRkIPgCQmdhKdKXCMpEWx koxMVp4UJU+NZxU9wI3ExS6iLJuJCzQVJ0lhL7NsMivf7vJIW9ccEHDaLSKm/9z0d/+hmZ1n p4T2BeW68ajpEYf8rmBZh2hYtksbnqYM8gxQdYRo3vn7yNIzm107HLwqzOoN55jGA9kR0bi2 xMNu0C6wzRgq9TtRGqrM27PWG1s/JQ7ybF93un7Vm5Xcje+7GXd0dTmsQSTNvnwxrDitN2Po bFt+n40YV0glh/ZjcoXkL2NBTvBXAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsVy+t/xe7o75grHGOzdqmpxa905VovecyeZ LDbOWM9qcXz3UkaLK1/fs1lMuj+BxeLFvYssFv2PXzNbnD+/gd3ibNMbdotNj6+xWlzeNYfN Ysb5fUwWa4/cZbdY+HEri8WDl/sZLe5OPsJoMWPySzYHIY95a6o9Nq3qZPPY/u0Bq8e8k4Ee 97uPM3lsXlLvcXzXLXaPvi2rGD0+b5IL4IzSsynKLy1JVcjILy6xVYo2tDDSM7S00DMysdQz NDaPtTIyVdK3s0lJzcksSy3St0vQyzg6/QZzwUm2is8/WtkaGK+xdjFyckgImEi8u9jA3sXI xSEksJRRYunrzUwQCRmJeWf72CBsYYk/17rYIIo+ARW92cQOkmATMJW4ffcTWJGIgLLE34mr GEGKmAWOsUpMfL8KrEhYwFbi6ZllYEUsAqoSe058AlvNK+AusfP1WXaIDXISN891MoPYnAIe Est2LWEEsYWAal7N/MI4gZFvASPDKkaR1NLi3PTcYiO94sTc4tK8dL3k/NxNjMA42nbs55Yd jF3vgg8xCnAwKvHwHpgiFCPEmlhWXJl7iFGCg1lJhDesVThGiDclsbIqtSg/vqg0J7X4EKMp 0FETmaVEk/OBMZ5XEm9oamhuYWlobmxubGahJM573qAySkggPbEkNTs1tSC1CKaPiYNTqoFx XpOEfuM/U5YXsZW6reVMpy44+H2/uii8Om/Sm67q5PCehtwNDRKbvRbflet/miizca/yWh6+ 981LHEO+qq150ia9nN0vJH7eRseXca/X6rZM6rx0keeo/TZG98bdR47ty8jc1yj+1/q68wqV 33N5bbv8Tp/OXjG7/PPTrtC/uV0yxY0dYSeUWIozEg21mIuKEwHnrVeluQIAAA== X-CMS-MailID: 20181214121032eucas1p24af580721ebd6f86a4f9ddf701957ab6 X-Msg-Generator: CA X-RootMTR: 20181214121032eucas1p24af580721ebd6f86a4f9ddf701957ab6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214121032eucas1p24af580721ebd6f86a4f9ddf701957ab6 References: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Mailman-Approved-At: Mon, 17 Dec 2018 07:52:24 +0000 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: Maxime Ripard , linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Christoph Manszewski , Seung-Woo Kim , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , David Airlie , Kyungmin Park , Kukjin Kim , Sean Paul , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Range setting makes sense for YCbCr and RGB buffers. Current drm_color_range enum labels suggest use with YCbCr buffers. Create enum labels without colorspace specification. Signed-off-by: Christoph Manszewski --- include/drm/drm_color_mgmt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h index 90ef9996d9a4..52f6d5221a0d 100644 --- a/include/drm/drm_color_mgmt.h +++ b/include/drm/drm_color_mgmt.h @@ -62,6 +62,8 @@ enum drm_color_range { DRM_COLOR_YCBCR_LIMITED_RANGE, DRM_COLOR_YCBCR_FULL_RANGE, DRM_COLOR_RANGE_MAX, + DRM_COLOR_LIMITED_RANGE = DRM_COLOR_YCBCR_LIMITED_RANGE, + DRM_COLOR_FULL_RANGE = DRM_COLOR_YCBCR_FULL_RANGE, }; int drm_plane_create_color_properties(struct drm_plane *plane, From patchwork Fri Dec 14 12:10:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Manszewski X-Patchwork-Id: 10732845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6B3514DE for ; Mon, 17 Dec 2018 07:53:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DF40299DD for ; Mon, 17 Dec 2018 07:53:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91976299E1; Mon, 17 Dec 2018 07:53:24 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 211FF299DD for ; Mon, 17 Dec 2018 07:53:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ECD5E6E2A3; Mon, 17 Dec 2018 07:52:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 179C56F460 for ; Fri, 14 Dec 2018 12:10:37 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181214121036euoutp02bdb28add57ee934e8080c19f569b14cc~wMc6zKCCE0904709047euoutp02J for ; Fri, 14 Dec 2018 12:10:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181214121036euoutp02bdb28add57ee934e8080c19f569b14cc~wMc6zKCCE0904709047euoutp02J Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181214121035eucas1p12bed885eb8619e309d4d09646695c2f4~wMc58FU0C0507605076eucas1p1l; Fri, 14 Dec 2018 12:10:35 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 9C.9B.04441.ABD931C5; Fri, 14 Dec 2018 12:10:34 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181214121034eucas1p14b05676ff59998f760296f9ed33ba3dc~wMc5MZ4xG1069910699eucas1p1a; Fri, 14 Dec 2018 12:10:34 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181214121034eusmtrp2b56d5ccdbe535cf6fdf8cf308a3a6398~wMc48qAux1165211652eusmtrp2g; Fri, 14 Dec 2018 12:10:34 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-6a-5c139dba57aa Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 6B.CC.04284.9BD931C5; Fri, 14 Dec 2018 12:10:33 +0000 (GMT) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181214121033eusmtip26d55cb18db455cf2423aa6794cd8d31d~wMc4M1_U03233032330eusmtip2v; Fri, 14 Dec 2018 12:10:33 +0000 (GMT) From: Christoph Manszewski To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/6] drm: color_mgmt: Split create_color_properties function Date: Fri, 14 Dec 2018 13:10:17 +0100 Message-Id: <1544789421-5265-3-git-send-email-c.manszewski@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSeUhUURTG585b5jk18XxKXrJ1KqXFLSouGGEQ9IKwhOiPMmomH6PkjPKe WwWVmpJbuSANuUaLMeU2jloTlJk0DdVIGmaKS0ySa1am4JI1zzfSf79zv+8753C4FMa8ItZQ MYYEjjdoYtWkEm96PesIsJZ5RQb/6N+FemocBMpz2OWo3lhLINuz+wB9nJ4kUeFAPo6G+z/g 6KZzDEPt7XUK9D5tXIHMzi4CdVpLSWRsfy5H1W19CnTnZyOOBkdeANRX1AaQsWiEDGPY8seX WLMpi2SbZwYJttwewQ7k2ORsw70rrM3ao2BvWEyAnTKvP+ZxUrkviouNSeL4oP1nldF3s8fJ +JbglJpi7VVg888GHhSkd8P+5g4iGygphn4I4GJ6CykKDP0bwAqnShKmXEJOhWI5YZ5ZwCSh CsDuxUx34UoMOkuX4iS9B/b2/Vpib3oz/FNgAqIJo60E/O6ck4uCF30E9rZN4iLj9FaYlWsi RFbRh2BLux1I49bDz44sTGQPmoUPrPeWGkG6SwFvttSRkukgLMgbxiX2gqM2i3vXtfDv0wq5 FEgHsOd3FyEV+QC+fJTtToRCc/eoy0W59tsGa61BIkL6AOzojJVwFeye8BTNmAsLm25h0rMK Xs9kpB5+cMxiIZenDk9Nu9dn4afxKiAdqATAcluGIh9suP1/ViUAJuDDJQp6HSeEGLjkQEGj FxINusBzcXozcH2tt4u2X0/AdIe2FdAUUK9URRcykQyhSRIu6FsBpDC1t+pEhlcko4rSXLjI 8XFn+MRYTmgFvhSu9lFdkg2eYmidJoE7z3HxHL+syimPNVdB1UR9WvJ8WFLZ4R2Rfnzl6U3a 3lcNq/11z8JTvviFRr3PW7Futy4e2a95D7ENjLZngH/xwBK4zfk14HuMv654aPXGeX1GcrNx 7ugbe+5MJvntJLalcyF5p2z+5eW0y6klRPW74+myhlSZ797cE3xQSIzBM6JoVu2QN+b71J57 E67GhWhNyHaMFzT/ANYiCP5WAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsVy+t/xe7o75wrHGHRstrS4te4cq0XvuZNM FhtnrGe1OL57KaPFla/v2Swm3Z/AYvHi3kUWi/7Hr5ktzp/fwG5xtukNu8Wmx9dYLS7vmsNm MeP8PiaLtUfuslss/LiVxeLBy/2MFncnH2G0mDH5JZuDkMe8NdUem1Z1snls//aA1WPeyUCP +93HmTw2L6n3OL7rFrtH35ZVjB6fN8kFcEbp2RTll5akKmTkF5fYKkUbWhjpGVpa6BmZWOoZ GpvHWhmZKunb2aSk5mSWpRbp2yXoZSzuesNWcMCgYt3UpAbG4+pdjJwcEgImEpu+/WEGsYUE ljJKLF1fCBGXkZh3to8NwhaW+HOtC8jmAqr5xCjRvuI6WIJNwFTi9t1PYLaIgLLE34mrGEGK mAWOsUpMfL+KHSQhLOAjcfvIexYQm0VAVaKzZxUriM0r4C5x4PxJRogNchI3z3WCXcEp4CGx bNcSRoiL3CVezfzCOIGRbwEjwypGkdTS4tz03GJDveLE3OLSvHS95PzcTYzAGNp27OfmHYyX NgYfYhTgYFTi4T0wRShGiDWxrLgy9xCjBAezkghvWKtwjBBvSmJlVWpRfnxRaU5q8SFGU6Cj JjJLiSbnA+M7ryTe0NTQ3MLS0NzY3NjMQkmc97xBZZSQQHpiSWp2ampBahFMHxMHp1QDY//3 3R2z/4ZynVm7cUoBg/gOASfPV8e5HuhnrIhNcXSQ83OsvHRsUWx15HyDaLPLzzvt3JY8ufzH 7mz9/I5rp7pDGn7qXW//zcbJkKpiYbJmduAePY05zSx6mvt2VDa8f7In7l7QPQ+OUy7n0057 /xT/G3v3lXqY1bKv87iSYtlutK+6Pef5HSWW4oxEQy3mouJEAM3Wb2W3AgAA X-CMS-MailID: 20181214121034eucas1p14b05676ff59998f760296f9ed33ba3dc X-Msg-Generator: CA X-RootMTR: 20181214121034eucas1p14b05676ff59998f760296f9ed33ba3dc X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214121034eucas1p14b05676ff59998f760296f9ed33ba3dc References: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Mailman-Approved-At: Mon, 17 Dec 2018 07:52:24 +0000 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: Maxime Ripard , linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Christoph Manszewski , Seung-Woo Kim , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , David Airlie , Kyungmin Park , Kukjin Kim , Sean Paul , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Split drm_plane_create_color_properties into two separate functions. This allows to create range and encoding property independently. Signed-off-by: Christoph Manszewski --- drivers/gpu/drm/drm_color_mgmt.c | 93 +++++++++++++++++++++++++++++++--------- include/drm/drm_color_mgmt.h | 8 ++++ 2 files changed, 81 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c index 581cc3788223..416cc9c8560b 100644 --- a/drivers/gpu/drm/drm_color_mgmt.c +++ b/drivers/gpu/drm/drm_color_mgmt.c @@ -396,29 +396,24 @@ const char *drm_get_color_range_name(enum drm_color_range range) } /** - * drm_plane_create_color_properties - color encoding related plane properties + * drm_plane_create_encoding_property - color encoding related plane property * @plane: plane object * @supported_encodings: bitfield indicating supported color encodings - * @supported_ranges: bitfileld indicating supported color ranges * @default_encoding: default color encoding - * @default_range: default color range * - * Create and attach plane specific COLOR_ENCODING and COLOR_RANGE - * properties to @plane. The supported encodings and ranges should - * be provided in supported_encodings and supported_ranges bitmasks. - * Each bit set in the bitmask indicates that its number as enum - * value is supported. + * Create and attach plane specific COLOR_ENCODING property to @plane. + * The supported encodings be provided in supported_encodings bitmask. + * Each bit set in the bitmask indicates that its number as enum value + * is supported. */ -int drm_plane_create_color_properties(struct drm_plane *plane, - u32 supported_encodings, - u32 supported_ranges, - enum drm_color_encoding default_encoding, - enum drm_color_range default_range) + +int drm_plane_create_encoding_property(struct drm_plane *plane, + u32 supported_encodings, + enum drm_color_encoding default_encoding) { struct drm_device *dev = plane->dev; struct drm_property *prop; - struct drm_prop_enum_list enum_list[max_t(int, DRM_COLOR_ENCODING_MAX, - DRM_COLOR_RANGE_MAX)]; + struct drm_prop_enum_list enum_list[DRM_COLOR_ENCODING_MAX]; int i, len; if (WARN_ON(supported_encodings == 0 || @@ -426,11 +421,6 @@ int drm_plane_create_color_properties(struct drm_plane *plane, (supported_encodings & BIT(default_encoding)) == 0)) return -EINVAL; - if (WARN_ON(supported_ranges == 0 || - (supported_ranges & -BIT(DRM_COLOR_RANGE_MAX)) != 0 || - (supported_ranges & BIT(default_range)) == 0)) - return -EINVAL; - len = 0; for (i = 0; i < DRM_COLOR_ENCODING_MAX; i++) { if ((supported_encodings & BIT(i)) == 0) @@ -450,6 +440,36 @@ int drm_plane_create_color_properties(struct drm_plane *plane, if (plane->state) plane->state->color_encoding = default_encoding; + return 0; +} +EXPORT_SYMBOL(drm_plane_create_encoding_property); + +/** + * drm_plane_create_range_property - color range related plane property + * @plane: plane object + * @supported_ranges: bitfileld indicating supported color ranges + * @default_range: default color range + * + * Create and attach plane specific COLOR_RANGE property to @plane. + * The supported ranges should be provided in supported_ranges bitmask. + * Each bit set in the bitmask indicates that its number as enum value + * is supported. + */ + +int drm_plane_create_range_property(struct drm_plane *plane, + u32 supported_ranges, + enum drm_color_range default_range) +{ + struct drm_device *dev = plane->dev; + struct drm_property *prop; + struct drm_prop_enum_list enum_list[DRM_COLOR_RANGE_MAX]; + int i, len; + + if (WARN_ON(supported_ranges == 0 || + (supported_ranges & -BIT(DRM_COLOR_RANGE_MAX)) != 0 || + (supported_ranges & BIT(default_range)) == 0)) + return -EINVAL; + len = 0; for (i = 0; i < DRM_COLOR_RANGE_MAX; i++) { if ((supported_ranges & BIT(i)) == 0) @@ -471,4 +491,37 @@ int drm_plane_create_color_properties(struct drm_plane *plane, return 0; } +EXPORT_SYMBOL(drm_plane_create_range_property); + +/** + * drm_plane_create_color_properties - color encoding related plane properties + * @plane: plane object + * @supported_encodings: bitfield indicating supported color encodings + * @supported_ranges: bitfileld indicating supported color ranges + * @default_encoding: default color encoding + * @default_range: default color range + * + * Create and attach plane specific COLOR_ENCODING and COLOR_RANGE + * properties to @plane. The supported encodings and ranges should + * be provided in supported_encodings and supported_ranges bitmasks. + * Each bit set in the bitmask indicates that its number as enum + * value is supported. + */ + +int drm_plane_create_color_properties(struct drm_plane *plane, + u32 supported_encodings, + u32 supported_ranges, + enum drm_color_encoding default_encoding, + enum drm_color_range default_range) +{ + int ret; + + ret = drm_plane_create_encoding_property(plane, supported_encodings, + default_encoding); + if (ret) + return ret; + + return drm_plane_create_range_property(plane, supported_ranges, + default_range); +} EXPORT_SYMBOL(drm_plane_create_color_properties); diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h index 52f6d5221a0d..fca8d3fabcd9 100644 --- a/include/drm/drm_color_mgmt.h +++ b/include/drm/drm_color_mgmt.h @@ -66,6 +66,14 @@ enum drm_color_range { DRM_COLOR_FULL_RANGE = DRM_COLOR_YCBCR_FULL_RANGE, }; +int drm_plane_create_encoding_property(struct drm_plane *plane, + u32 supported_encodings, + enum drm_color_encoding default_encoding); + +int drm_plane_create_range_property(struct drm_plane *plane, + u32 supported_ranges, + enum drm_color_range default_range); + int drm_plane_create_color_properties(struct drm_plane *plane, u32 supported_encodings, u32 supported_ranges, From patchwork Fri Dec 14 12:10:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Manszewski X-Patchwork-Id: 10732853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D633E14DE for ; Mon, 17 Dec 2018 07:53:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF334299DD for ; Mon, 17 Dec 2018 07:53:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C34FF299E3; Mon, 17 Dec 2018 07:53:34 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 0E080299DD for ; Mon, 17 Dec 2018 07:53:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCCEE6E2B2; Mon, 17 Dec 2018 07:53:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 752C26F46D for ; Fri, 14 Dec 2018 12:10:38 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181214121037euoutp02113a9188eaa6c8ff9c341568c564ee93~wMc8E9SBx0904709047euoutp02L for ; Fri, 14 Dec 2018 12:10:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181214121037euoutp02113a9188eaa6c8ff9c341568c564ee93~wMc8E9SBx0904709047euoutp02L Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214121036eucas1p2f97ace3bea4f416a36f5f81a65ca4501~wMc69wxkB1566115661eucas1p2w; Fri, 14 Dec 2018 12:10:36 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id ED.9B.04441.BBD931C5; Fri, 14 Dec 2018 12:10:35 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181214121035eucas1p11c9465bd3d5398c7d9c947c2e1844854~wMc6Nt3481060310603eucas1p1v; Fri, 14 Dec 2018 12:10:35 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181214121035eusmtrp2c5247febf3a785ee094755a577de9564~wMc596Hlb1165911659eusmtrp2r; Fri, 14 Dec 2018 12:10:35 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-6d-5c139dbb483b Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 9C.CC.04284.BBD931C5; Fri, 14 Dec 2018 12:10:35 +0000 (GMT) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181214121034eusmtip268a6ef2ac764e6d85719c2abd8b2bb16~wMc5NRC0P0092500925eusmtip2-; Fri, 14 Dec 2018 12:10:34 +0000 (GMT) From: Christoph Manszewski To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/6] drm/exynos: drm_drv: Extend exynos_drm_plane_config Date: Fri, 14 Dec 2018 13:10:18 +0100 Message-Id: <1544789421-5265-4-git-send-email-c.manszewski@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0hTYRjHe3cuO44Wp6Phi4nRpCIpb1i8ZUlC1PkU9aUiR7X0oJJT29Q0 ySTRdJF5CZu11MxSZqlN0zlLc4jDLJeXRC1vmeC1vCYpaptH69vz/J/f//0/PLwUxjQSDlRw aASnCJWFSEgRXtn4x7y/5omt1H0p7xDqKWkh0L2WJgF6rS4lkKnmOUAd879IlNGfhqORvlYc 3R8ax5DZXCZEn25PCJFuqJNA7QYNidTmWgF61dArRE+n3+BoYLQOoN7MBoDUmaPkMYbNeRnL 6rQpJFv1e4Bgc5rOsP13TQK2vOAWazL0CNnUCi1gZ3VOp20uiI4EcCHBUZzCzeeyKKhcb8bC TcLourcaLB6UkypgQ0HaC5q+6QgVEFEMXQTgZGk9yTdzAE6V/RDyzSyAemMttmFpjf8s4AeF AFY/MBP/LLkFo8BKkfQB+LV3Zi3EjnaGy+laYIUw2kDAn0OLAuvAlmZhW8KzNQind8GSiSXc WovpkzC3dlHIxznB7paUtWgbC//CULD2EKR7hHA1ewznoeOwRKtZ388Wjpkq1s2OcLU6V8Ab EgDsmesk+CYNwPpi1brbG+q6xiwUZdlvLyw1uPGyL1RXLxBWGdJbYNfkVquMWcqMyocYL4th chLD07vheEUFuRE7MjsP+JqFlcbq9Qs9BrAtK5lMAzse/Q/LA0AL7LlIpTyQU3qEctddlTK5 MjI00NU/TK4Dlt/VvGKa0YP5titGQFNAslkclMFIGUIWpYyRGwGkMImd+GyirZQRB8hibnCK sEuKyBBOaQTbKVxiL47dNODH0IGyCO4qx4Vzio2pgLJxiAd7arty7bN6kY+7nzOpuDn9odS7 9VThRfUMuOZ78Eu7dKjYK31Y3vBu6s4CmRAcY1C5xJlP6JnBc93JR7fhIg3rJfBWue+MquI6 qKy+OK/sQE3RSH60/0f3us4pz+U5leegg7mZXNoHndMPD+u/J55fqWpfmZ3KT0p93+2YuUmC K4NkHi6YQin7C1S3WDZZAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsVy+t/xe7q75wrHGFyfwWJxa905VovecyeZ LDbOWM9qcXz3UkaLK1/fs1lMuj+BxeLFvYssFv2PXzNbnD+/gd3ibNMbdotNj6+xWlzeNYfN Ysb5fUwWa4/cZbdY+HEri8WDl/sZLe5OPsJoMWPySzYHIY95a6o9Nq3qZPPY/u0Bq8e8k4Ee 97uPM3lsXlLvcXzXLXaPvi2rGD0+b5IL4IzSsynKLy1JVcjILy6xVYo2tDDSM7S00DMysdQz NDaPtTIyVdK3s0lJzcksSy3St0vQy9i84zxzwXH2iv175jA3MG5m62Lk5JAQMJG42HCBqYuR i0NIYCmjxLvZJ6ESMhLzzvZB2cISf651sUEUfWKUmLn2GDNIgk3AVOL23U9gRSICyhJ/J65i BCliFjjGKjHx/Sp2kISwgIfEpebFYEUsAqoS6978ZgGxeQXcJebv+8UOsUFO4ua5TrChnED1 y3YtYQSxhYBqXs38wjiBkW8BI8MqRpHU0uLc9NxiQ73ixNzi0rx0veT83E2MwDjaduzn5h2M lzYGH2IU4GBU4uE9MEUoRog1say4MvcQowQHs5IIb1ircIwQb0piZVVqUX58UWlOavEhRlOg oyYyS4km5wNjPK8k3tDU0NzC0tDc2NzYzEJJnPe8QWWUkEB6YklqdmpqQWoRTB8TB6dUA6OL e6g4U8d51Qfm+iF2Zd+nX1h5d+GjTbY7xWLXBt4+qL5w/+dXCfXaLJl/BRqrzptly6230Pna 0XWVax3vp4qyd2VWZ7auFbC/cP7vE8/7EiwvQp5zp4Tq5bZPzdTheqVbaWW0aYd0ufH3CUte b5YJvLhoWtE6Tc+d8hZtzf/1Dh/8/raCN1CJpTgj0VCLuag4EQDG0Q5XuQIAAA== X-CMS-MailID: 20181214121035eucas1p11c9465bd3d5398c7d9c947c2e1844854 X-Msg-Generator: CA X-RootMTR: 20181214121035eucas1p11c9465bd3d5398c7d9c947c2e1844854 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214121035eucas1p11c9465bd3d5398c7d9c947c2e1844854 References: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Mailman-Approved-At: Mon, 17 Dec 2018 07:52:24 +0000 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: Maxime Ripard , linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Christoph Manszewski , Seung-Woo Kim , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , David Airlie , Kyungmin Park , Kukjin Kim , Sean Paul , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Define new range capability and add range value to exynos_drm_plane_config. Signed-off-by: Christoph Manszewski --- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 5e61e707f955..1bc334d846c5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -94,6 +94,7 @@ struct exynos_drm_plane { #define EXYNOS_DRM_PLANE_CAP_TILE (1 << 3) #define EXYNOS_DRM_PLANE_CAP_PIX_BLEND (1 << 4) #define EXYNOS_DRM_PLANE_CAP_WIN_BLEND (1 << 5) +#define EXYNOS_DRM_PLANE_CAP_RANGE (1 << 6) /* * Exynos DRM plane configuration structure. @@ -111,6 +112,7 @@ struct exynos_drm_plane_config { const uint32_t *pixel_formats; unsigned int num_pixel_formats; unsigned int capabilities; + enum drm_color_range range; }; /* From patchwork Fri Dec 14 12:10:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Manszewski X-Patchwork-Id: 10732859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42A3D14DE for ; Mon, 17 Dec 2018 07:53:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3924B2949C for ; Mon, 17 Dec 2018 07:53:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D775299E1; Mon, 17 Dec 2018 07:53:41 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 DEF932949C for ; Mon, 17 Dec 2018 07:53:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCA6B6E2A4; Mon, 17 Dec 2018 07:53:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DE476F468 for ; Fri, 14 Dec 2018 12:10:39 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181214121038euoutp029a0892249e5297ae0236d84c3ae8dd03~wMc823Ofx0861108611euoutp02h for ; Fri, 14 Dec 2018 12:10:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181214121038euoutp029a0892249e5297ae0236d84c3ae8dd03~wMc823Ofx0861108611euoutp02h Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214121037eucas1p238e32d7786d5613b2486f19bc3f9538c~wMc8EmS6Z2115021150eucas1p2w; Fri, 14 Dec 2018 12:10:37 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A1.E6.04806.DBD931C5; Fri, 14 Dec 2018 12:10:37 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181214121036eucas1p13237f995477f1a630c16fb452ba94598~wMc7PuHea1069310693eucas1p1g; Fri, 14 Dec 2018 12:10:36 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181214121036eusmtrp2c7d8bd9319d1a5d896040a86386bb93e~wMc6-4jeo1165211652eusmtrp2i; Fri, 14 Dec 2018 12:10:36 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-7c-5c139dbdb0b5 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 4E.CC.04284.CBD931C5; Fri, 14 Dec 2018 12:10:36 +0000 (GMT) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181214121035eusmtip24abcd4c141378a135392b8689b974885~wMc6R8Tqn3233032330eusmtip2w; Fri, 14 Dec 2018 12:10:35 +0000 (GMT) From: Christoph Manszewski To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/6] drm/exynos: plane: Minor cleanup Date: Fri, 14 Dec 2018 13:10:19 +0100 Message-Id: <1544789421-5265-5-git-send-email-c.manszewski@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSWUwTURSGvZ2l02rNOCXxBo2aKiaYCCiYXKNRTIzOIxr1QRu1wgSItECn 4BaVxQUqIEKCKIogi6TI0lpBqihWtCyhlagEaVAUY1gE1FKigAvtgL5955z/P//JzaUwppnw paI1Ok6rUcUoSCle9+KnfW3jTbkyqPURhXqq7QTKtLeKkDG/hkC2h2UAvXaPkSjnfTaOBt51 4uhy/zCGHI5aMepI+SJGpv4uAr2y3CBRvuOxCFU194pR8bf7OOobfAJQb24zQPm5g2Qowxbe PcWaDOkkWz/RR7CFrbvY95dsIvZe6VnWZukRs1lmA2BdpmVhkv3SzRFcTHQipw3cclgalfpy hIxLmn+8rTAPJIHbEj2QUJAOgRfeFhF6IKUYugLAxpwSIBTjAN6ssuBC4QJwYKKfnLPU52bM Wu4AOFX1SvTPUvEx3asi6Q3Q2fvdyz70SvjrisG7F6MtBBztnxR5BvIZ0Vili/AwTvvBzqkf M32KktE7YVMLENKWwbf2dMzDEpqF5ZZS7x5IvxPDikyjWBBth+PF5bjAcjhkM8/2l8I/DbdE giEVwJ7xLkIosgF8WqmfdWyCpu4hbzJG+8MaS6AHIb0Nfi5hBFwIu0cWecTYDObUXcWEtgym XWCEHavhsNlMzqUOuNyz57MwY3RKLLxPAYAdF3+LssHy6/+zigAwgMVcAq+O5PhgDXcsgFep +QRNZEB4rNoEZv5W+2+b+wF4PH3ECmgKKBbIWgoYJUOoEvkTaiuAFKbwke07L1cysgjViZOc NvaQNiGG461gCYUrFstOzes7wNCRKh13lOPiOO3cVERJfJPAm3hXj7FBpzfJn+t+uR3PkhXG 6862/RMLnSHJ6+u2BhVMZ/mXWwO509Iwt3pb2J+vS/M+Aj9H1hP+m9h+rWlStX2Y7uWu7S6z ys+sCjoTcrDduWciknbvSNwbFRxPGvdtNBR9UH7CEy4n5qWtCN/T7puiQ12VZ6tDudquc8kp CpyPUq1bg2l51V/5qJkpVwMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRmVeSWpSXmKPExsVy+t/xe7p75grHGMxaz2Vxa905VovecyeZ LDbOWM9qcXz3UkaLK1/fs1lMuj+BxeLFvYssFv2PXzNbnD+/gd3ibNMbdotNj6+xWlzeNYfN Ysb5fUwWa4/cZbdY+HEri8WDl/sZLe5OPsJoMWPySzYHIY95a6o9Nq3qZPPY/u0Bq8e8k4Ee 97uPM3lsXlLvcXzXLXaPvi2rGD0+b5IL4IzSsynKLy1JVcjILy6xVYo2tDDSM7S00DMysdQz NDaPtTIyVdK3s0lJzcksSy3St0vQy2i+8JatoIG74tS8aYwNjIs4uxg5OSQETCS2T+5h7WLk 4hASWMoo8effCRaIhIzEvLN9bBC2sMSfa11sEEWfGCWmbj/LDJJgEzCVuH33E1iRiICyxN+J qxhBipgFjrFKTHy/ih0kIQxU9H71Z1YQm0VAVeLi7x9MXYwcHLwC7hIHTjBCLJCTuHmuE2wm p4CHxLJdS8DiQkAlr2Z+YZzAyLeAkWEVo0hqaXFuem6xoV5xYm5xaV66XnJ+7iZGYBRtO/Zz 8w7GSxuDDzEKcDAq8fAemCIUI8SaWFZcmXuIUYKDWUmEN6xVOEaINyWxsiq1KD++qDQntfgQ oynQTROZpUST84ERnlcSb2hqaG5haWhubG5sZqEkznveoDJKSCA9sSQ1OzW1ILUIpo+Jg1Oq gTFEtO2m0Ltd/pPj1FTCJV/u2VkpqiLCcyDC0+ze7nXbwo00U+Z572txvjuXYf5How87mL4r /d049fULxXOHJcSfyqU9376SVWe35p/Pgpm2V3mtPjzl5Lj4YOPTgJfrrim9PpP8u0M+47+z QKtq25a2w4yTc+KCV55aecfZQYznndC3hz28862UWIozEg21mIuKEwGSfg/KuAIAAA== X-CMS-MailID: 20181214121036eucas1p13237f995477f1a630c16fb452ba94598 X-Msg-Generator: CA X-RootMTR: 20181214121036eucas1p13237f995477f1a630c16fb452ba94598 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214121036eucas1p13237f995477f1a630c16fb452ba94598 References: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Mailman-Approved-At: Mon, 17 Dec 2018 07:52:24 +0000 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: Maxime Ripard , linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Christoph Manszewski , Seung-Woo Kim , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , David Airlie , Kyungmin Park , Kukjin Kim , Sean Paul , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use available drm_plane pointer, for consistency. Signed-off-by: Christoph Manszewski --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index df0508e0e49e..cf352d980eee 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -303,7 +303,7 @@ int exynos_plane_init(struct drm_device *dev, BIT(DRM_MODE_BLEND_COVERAGE); struct drm_plane *plane = &exynos_plane->base; - err = drm_universal_plane_init(dev, &exynos_plane->base, + err = drm_universal_plane_init(dev, plane, 1 << dev->mode_config.num_crtc, &exynos_plane_funcs, config->pixel_formats, @@ -314,12 +314,12 @@ int exynos_plane_init(struct drm_device *dev, return err; } - drm_plane_helper_add(&exynos_plane->base, &plane_helper_funcs); + drm_plane_helper_add(plane, &plane_helper_funcs); exynos_plane->index = index; exynos_plane->config = config; - exynos_plane_attach_zpos_property(&exynos_plane->base, config->zpos, + exynos_plane_attach_zpos_property(plane, config->zpos, !(config->capabilities & EXYNOS_DRM_PLANE_CAP_ZPOS)); if (config->capabilities & EXYNOS_DRM_PLANE_CAP_PIX_BLEND) From patchwork Fri Dec 14 12:10:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Manszewski X-Patchwork-Id: 10732835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29AE614DE for ; Mon, 17 Dec 2018 07:53:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20FCE299DD for ; Mon, 17 Dec 2018 07:53:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14CCC299E1; Mon, 17 Dec 2018 07:53:08 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 BA867299DD for ; Mon, 17 Dec 2018 07:53:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AC416E29E; Mon, 17 Dec 2018 07:52:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 911AF6F469 for ; Fri, 14 Dec 2018 12:10:40 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181214121039euoutp02dcc31961e27576be3d56d1ce9c84df6a~wMc_CvfIu0903709037euoutp02S for ; Fri, 14 Dec 2018 12:10:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181214121039euoutp02dcc31961e27576be3d56d1ce9c84df6a~wMc_CvfIu0903709037euoutp02S Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181214121038eucas1p1d7dac6bc6d989211d7f26458f232a64d~wMc9M6dk70507605076eucas1p1p; Fri, 14 Dec 2018 12:10:38 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 9F.9B.04441.EBD931C5; Fri, 14 Dec 2018 12:10:38 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181214121037eucas1p2469a23e8e393bdca487a11260b187510~wMc8WEb0k1559015590eucas1p2g; Fri, 14 Dec 2018 12:10:37 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181214121037eusmtrp16e00c00b128e5a7ae4e1df3913b6c1ec~wMc8EJf4I2638626386eusmtrp1c; Fri, 14 Dec 2018 12:10:37 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-74-5c139dbecf49 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 64.91.04128.DBD931C5; Fri, 14 Dec 2018 12:10:37 +0000 (GMT) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181214121036eusmtip248e6713acb29150c20131270465aac16~wMc7WlgIc3233032330eusmtip2x; Fri, 14 Dec 2018 12:10:36 +0000 (GMT) From: Christoph Manszewski To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/6] drm/exynos: plane: Add range property to exynos plane Date: Fri, 14 Dec 2018 13:10:20 +0100 Message-Id: <1544789421-5265-6-git-send-email-c.manszewski@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0hTYRjG+3YuOxsuj5vkh4bBouyipqTwQRFFSgcjqD+SKMNmnpzozHam 5aUSw2yWaRuRXbRCLZmmOZfFJDO1pnkrs6WrqWCB1/I2oejmdpT++73P+7w87/vxUZj0FeFN xSdpWHWSIlFOivH61z96AhqLZVFBg39lyFbdTaD87nYBqi2qIZCloRygPsd3EumGCnE0OvgO RwUjExjq6XksRF3Zk0JkHLES6L35DomKehoF6FGrXYjuzzzB0fDYC4Ds+laAivRj5E4pU1KV wRgNWpJ5ujBMMCXtB5ihyxYBU1d2nrGYbULmqskAmDmj737RYfH2WDYxPpVVb9lxTKzsyikn k6vczkw3m/EsUC/OAyIK0iHwUrYVzwNiSkpXAPgrd4Lgi3kAB0r1JF/MAZj1YgFbHtFa8gV8 4yGAtRNd/0e0vTdJp4ukQ+En+6yLPem18Pc1A3CaMNpMwG8jPwXOhoyOgNX2v8DJOL0ODna+ xJ0soffAaWMO4ON84UC31hUtohn4wFy2pFuF8JZjA89hsK/utpBnGRy3mJZ4NezQX3FdB+kL ANrmrQRfFAL4sjIP513boLF/fHEjanG9jbDGvIWXd8HPudMuGdIrYf+Uh1PGFlFXfwPjZQm8 dFHKu9fDCZOJXI4dnXMsrclAc7tNyD/QbQC/1tqIQrDm1v+wewAYgBebwqniWC44iT0dyClU XEpSXODxkyojWPxcHX8ss8+AozemGdAUkLtJlDpplJRQpHJpqmYAKUzuKYnMkUVJJbGKtHRW fTJanZLIcs3Ah8LlXpKMFcNHpHScQsMmsGwyq17uCiiRdxbQhUVPnUtv6Wy7bi17W2GvDPJf 2RqU6NMU/tgRG67UWnJDT2mysi+ciNyd8PvsbDrTibtrWjra7sobvhQf9belN0U0xU+alAXK EU+fuY37D4a5P9/L+QWo8reGlHtkRoR8bBvOjhktQW9EvqUVboc+zKhRuxzT7du8qu2XX6ay Wo5zSkXwJkzNKf4BozHju1gDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsVy+t/xe7p75wrHGGw4IWJxa905VovecyeZ LDbOWM9qcXz3UkaLK1/fs1lMuj+BxeLFvYssFv2PXzNbnD+/gd3ibNMbdotNj6+xWlzeNYfN Ysb5fUwWa4/cZbdY+HEri8WDl/sZLe5OPsJoMWPySzYHIY95a6o9Nq3qZPPY/u0Bq8e8k4Ee 97uPM3lsXlLvcXzXLXaPvi2rGD0+b5IL4IzSsynKLy1JVcjILy6xVYo2tDDSM7S00DMysdQz NDaPtTIyVdK3s0lJzcksSy3St0vQyzjbupStYA1PxYdDu1gaGLdxdTFyckgImEh0Hu9lArGF BJYySnw4ywgRl5GYd7aPDcIWlvhzrYsNouYTo0Tzd3YQm03AVOL23U9gcREBZYm/E1cB9XJx MAscY5WY+H4VWJGwgJfEurv/wYayCKhK3DtzkAXE5hVwl/iwqRVqmZzEzXOdzCA2p4CHxLJd SxghlrlLvJr5hXECI98CRoZVjCKppcW56bnFRnrFibnFpXnpesn5uZsYgTG07djPLTsYu94F H2IU4GBU4uE9MEUoRog1say4MvcQowQHs5IIb1ircIwQb0piZVVqUX58UWlOavEhRlOgoyYy S4km5wPjO68k3tDU0NzC0tDc2NzYzEJJnPe8QWWUkEB6YklqdmpqQWoRTB8TB6dUA+M8/YpV OoHX5aztqv2OMux5sl20t/jetbScY9sK3t/8s+68xtFPzxeyv7/3sNf5T0aT9t+VK9vvr/fK 7tzH//mOsKbVW4XCTT0Zns4ZjzbfSl/E9I2v4lX1vtzTVXe9jTrKuLev/RtkK+2yyShiRm3K dNN9k72v7g3hfFP59ey1y+8fLerduIlBiaU4I9FQi7moOBEAzvQinrcCAAA= X-CMS-MailID: 20181214121037eucas1p2469a23e8e393bdca487a11260b187510 X-Msg-Generator: CA X-RootMTR: 20181214121037eucas1p2469a23e8e393bdca487a11260b187510 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214121037eucas1p2469a23e8e393bdca487a11260b187510 References: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Mailman-Approved-At: Mon, 17 Dec 2018 07:52:24 +0000 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: Maxime Ripard , linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Christoph Manszewski , Seung-Woo Kim , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , David Airlie , Kyungmin Park , Kukjin Kim , Sean Paul , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Create range property within exynos_drm_plane_init and set to default value in exynos_drm_plane_reset. Signed-off-by: Christoph Manszewski --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index cf352d980eee..a6ab0e7277f0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -140,6 +140,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) if (exynos_state) { __drm_atomic_helper_plane_reset(plane, &exynos_state->base); plane->state->zpos = exynos_plane->config->zpos; + plane->state->color_range = exynos_plane->config->range; } } @@ -301,6 +302,10 @@ int exynos_plane_init(struct drm_device *dev, unsigned int supported_modes = BIT(DRM_MODE_BLEND_PIXEL_NONE) | BIT(DRM_MODE_BLEND_PREMULTI) | BIT(DRM_MODE_BLEND_COVERAGE); + + u32 supported_ranges = BIT(DRM_COLOR_LIMITED_RANGE) | + BIT(DRM_COLOR_FULL_RANGE); + struct drm_plane *plane = &exynos_plane->base; err = drm_universal_plane_init(dev, plane, @@ -328,5 +333,9 @@ int exynos_plane_init(struct drm_device *dev, if (config->capabilities & EXYNOS_DRM_PLANE_CAP_WIN_BLEND) drm_plane_create_alpha_property(plane); + if (config->capabilities & EXYNOS_DRM_PLANE_CAP_RANGE) + drm_plane_create_range_property(plane, supported_ranges, + config->range); + return 0; } From patchwork Fri Dec 14 12:10:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Manszewski X-Patchwork-Id: 10732867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB0FD14DE for ; Mon, 17 Dec 2018 07:54:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A259C29601 for ; Mon, 17 Dec 2018 07:54:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96C26299E3; Mon, 17 Dec 2018 07:54:49 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 2B0ED29601 for ; Mon, 17 Dec 2018 07:54:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FF956E2DE; Mon, 17 Dec 2018 07:54:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7CB966F46B for ; Fri, 14 Dec 2018 12:10:41 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181214121040euoutp0113f9231d8d3255b9b9861384cbf70a24~wMc_6Z8ME2571625716euoutp01J for ; Fri, 14 Dec 2018 12:10:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181214121040euoutp0113f9231d8d3255b9b9861384cbf70a24~wMc_6Z8ME2571625716euoutp01J Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181214121039eucas1p1f2b41003a918eab54a3c502dece0d777~wMc_KnfAD1061410614eucas1p1s; Fri, 14 Dec 2018 12:10:39 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B8.7D.04294.FBD931C5; Fri, 14 Dec 2018 12:10:39 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181214121038eucas1p20a2aec53761cacb8e4ee57f9f2aa1167~wMc9d5EFE0911909119eucas1p2B; Fri, 14 Dec 2018 12:10:38 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181214121038eusmtrp107fa9abe1a0b0da439b5e0ef2bc0919f~wMc9Hgmn82638626386eusmtrp1f; Fri, 14 Dec 2018 12:10:38 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-28-5c139dbf31e2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 06.91.04128.EBD931C5; Fri, 14 Dec 2018 12:10:38 +0000 (GMT) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181214121037eusmtip27979f972f7e5d102709e321e4701a5e7~wMc8aSSsQ0092500925eusmtip2B; Fri, 14 Dec 2018 12:10:37 +0000 (GMT) From: Christoph Manszewski To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/6] drm/exynos: mixer: Make input buffer color range configurable Date: Fri, 14 Dec 2018 13:10:21 +0100 Message-Id: <1544789421-5265-7-git-send-email-c.manszewski@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSfSyUcRzvd88rde3pGL+pZc5qNG+1Wr8ttd5WT/+xZC22uniGccfucfKy liSFyuEPF1EtvQyR65CrUcJNxiUv6eq47dQIWYcWUjkP9d/n+3n5fr777UdjkjbCjY5RJHJK hSxOSjri9e1zRt/mUqfwgO48V2Sq7ibQ9e4OEarV1BDI8Pw+QH2zUyQqGFbjaHSoB0d51nEM GY1PKNSVMUEhrXWAQL36WyTSGJtE6HGrmUJ3v9fhyDLWDJC5sBUgTeEYuV/CllWlsdqKbJJt +GEh2LKOYHY41yBin5ZfYA16E8Xe0FUAdlq7OcjhlGNgJBcXk8Qp/fedcYwenPuDJzR7JWeq K6l0YPTIAQ40ZHbCybcjRA5wpCXMIwDzJ64AYZgBcOh1ESUM0wBWD30mVyNFnaMrwkMAb9c+ oP5Fytp0wO4imV3wo9m2nHBmPOFifsXyXozRE/CbdV5kF5yYEGhpMOM5gKZxZgv8pHGx02Lm KMzU9WNC22b4oTt7GTswLHygL1/eAxkTBbM6NUAwHYaVjSO4gJ3gV4OOEvAm2Fl4DRcClwA0 zQwQwqAG8FVlzkpiD9QOfhXZr8AYb1ij9xfoA7CnTk3Zacish4OTG+w0tgQL6oswgRbDq1kS wb0Vjut05Grt6PTsymkszMzoFwkPVAJgjWWMVAP34v9ldwCoAK6cipdHcfwOBXfOj5fJeZUi yi8iXq4FS5+r87dh5hnQ/zrbAhgaSNeJowsk4RJClsSnyFsApDGpszj0slO4RBwpS0nllPGn lao4jm8BG2lc6ipOW2MJkzBRskQuluMSOOWqKqId3NJBsO/NbxG4VeXx3rAtNcbHVuozN89l GBZ4trElsq8qNtsiO7nbtVl6+eq9pueTIHltyYmAjkXv4tB5U5dX8Evzvje2hbD8T4dCbBeD G3V7j2gKlbZcLPXL8amQ2ne7km+El/dmHTusqlbU/yRdggJfZHq6nPlh9dK6t+fJz8f/OijF +WjZ9m2Ykpf9BUrA5FdYAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRmVeSWpSXmKPExsVy+t/xe7r75grHGLy+IWNxa905VovecyeZ LDbOWM9qcXz3UkaLK1/fs1lMuj+BxeLFvYssFv2PXzNbnD+/gd3ibNMbdotNj6+xWlzeNYfN Ysb5fUwWa4/cZbdY+HEri8WDl/sZLe5OPsJoMWPySzYHIY95a6o9Nq3qZPPY/u0Bq8e8k4Ee 97uPM3lsXlLvcXzXLXaPvi2rGD0+b5IL4IzSsynKLy1JVcjILy6xVYo2tDDSM7S00DMysdQz NDaPtTIyVdK3s0lJzcksSy3St0vQy7jx8z9LwX6NipYJq9kbGM8rdjFyckgImEhMP/2CvYuR i0NIYCmjxLQlM5ghEjIS8872sUHYwhJ/rnWxQRR9YpRY0TeZCSTBJmAqcfvuJ7AiEQFlib8T VzGCFDELHGOVmPh+FTtIQlggSKLv5HQgm4ODRUBV4s4MMZAwr4C7RMuWq1DL5CRunusEszkF PCSW7VrCCGILAdW8mvmFcQIj3wJGhlWMIqmlxbnpucVGesWJucWleel6yfm5mxiBUbTt2M8t Oxi73gUfYhTgYFTi4T0wRShGiDWxrLgy9xCjBAezkghvWKtwjBBvSmJlVWpRfnxRaU5q8SFG U6CbJjJLiSbnAyM8ryTe0NTQ3MLS0NzY3NjMQkmc97xBZZSQQHpiSWp2ampBahFMHxMHp1QD o/Nc43SZ1teND+serjRxFQ9VyOUyNOgRlD6brsf810VVNz70anu5etvhAPYDa7RYV/6UjD+k /O7u9rNvwrgMYiWvbTi22/LO1Qem6as+fVtSOk1GMudCobBuw5mAT1V7KyYb+C6fKlFvdT5+ kSWrkrTgx8rLk5eY2d6V+uNRcFnRYnbSjXU1SizFGYmGWsxFxYkApMsaXrgCAAA= X-CMS-MailID: 20181214121038eucas1p20a2aec53761cacb8e4ee57f9f2aa1167 X-Msg-Generator: CA X-RootMTR: 20181214121038eucas1p20a2aec53761cacb8e4ee57f9f2aa1167 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214121038eucas1p20a2aec53761cacb8e4ee57f9f2aa1167 References: <1544789421-5265-1-git-send-email-c.manszewski@samsung.com> X-Mailman-Approved-At: Mon, 17 Dec 2018 07:52:24 +0000 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: Maxime Ripard , linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Christoph Manszewski , Seung-Woo Kim , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , David Airlie , Kyungmin Park , Kukjin Kim , Sean Paul , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Mixer hardware supports RGB input buffers with full and limited range. Set the csc matrix accordingly to chosen range. Note that range setting has to be equal for both graphic layers. Signed-off-by: Christoph Manszewski --- drivers/gpu/drm/exynos/exynos_mixer.c | 57 ++++++++++++++++++++++++++++++++--- drivers/gpu/drm/exynos/regs-mixer.h | 2 ++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 895c6268025d..035d635188d7 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -35,6 +35,8 @@ #include #include +#include +#include #include "exynos_drm_drv.h" #include "exynos_drm_crtc.h" @@ -133,7 +135,9 @@ static const struct exynos_drm_plane_config plane_configs[MIXER_WIN_NR] = { .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE | EXYNOS_DRM_PLANE_CAP_ZPOS | EXYNOS_DRM_PLANE_CAP_PIX_BLEND | - EXYNOS_DRM_PLANE_CAP_WIN_BLEND, + EXYNOS_DRM_PLANE_CAP_WIN_BLEND | + EXYNOS_DRM_PLANE_CAP_RANGE, + .range = DRM_COLOR_FULL_RANGE, }, { .zpos = 1, .type = DRM_PLANE_TYPE_CURSOR, @@ -142,7 +146,9 @@ static const struct exynos_drm_plane_config plane_configs[MIXER_WIN_NR] = { .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE | EXYNOS_DRM_PLANE_CAP_ZPOS | EXYNOS_DRM_PLANE_CAP_PIX_BLEND | - EXYNOS_DRM_PLANE_CAP_WIN_BLEND, + EXYNOS_DRM_PLANE_CAP_WIN_BLEND | + EXYNOS_DRM_PLANE_CAP_RANGE, + .range = DRM_COLOR_FULL_RANGE, }, { .zpos = 2, .type = DRM_PLANE_TYPE_OVERLAY, @@ -389,13 +395,19 @@ static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, struct drm_display_mode if (format == HDMI_COLORIMETRY_ITU_601) { val = MXR_CFG_RGB601; + + mixer_reg_write(ctx, MXR_CM_COEFF_Y, + MXR_CSC_CT( 0.257, 0.504, 0.098)); + mixer_reg_write(ctx, MXR_CM_COEFF_CB, + MXR_CSC_CT(-0.148, -0.291, 0.439)); + mixer_reg_write(ctx, MXR_CM_COEFF_CR, + MXR_CSC_CT( 0.439, -0.368, -0.071)); } else { val = MXR_CFG_RGB709; /* Configure the BT.709 CSC matrix for full range RGB. */ mixer_reg_write(ctx, MXR_CM_COEFF_Y, - MXR_CSC_CT( 0.184, 0.614, 0.063) | - MXR_CM_COEFF_RGB_FULL); + MXR_CSC_CT( 0.184, 0.614, 0.063)); mixer_reg_write(ctx, MXR_CM_COEFF_CB, MXR_CSC_CT(-0.102, -0.338, 0.440)); mixer_reg_write(ctx, MXR_CM_COEFF_CR, @@ -560,6 +572,20 @@ static void mixer_layer_update(struct mixer_context *ctx) mixer_reg_writemask(ctx, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE); } +static void mixer_set_input_buffer_range(struct mixer_context *ctx, + struct exynos_drm_plane *plane) +{ + u32 cm_coeff; + + if (plane->base.state->color_range == DRM_COLOR_LIMITED_RANGE) + cm_coeff = MXR_CM_COEFF_RGB_LIMITED; + else + cm_coeff = MXR_CM_COEFF_RGB_FULL; + + mixer_reg_writemask(ctx, MXR_CM_COEFF_Y, cm_coeff, + MXR_CM_COEFF_RGB_RANGE_MASK); +} + static void mixer_graph_buffer(struct mixer_context *ctx, struct exynos_drm_plane *plane) { @@ -647,6 +673,9 @@ static void mixer_graph_buffer(struct mixer_context *ctx, ctx->mxr_ver == MXR_VER_128_0_0_184) mixer_layer_update(ctx); + /* set the input buffer rgb range */ + mixer_set_input_buffer_range(ctx, plane); + spin_unlock_irqrestore(&ctx->reg_slock, flags); mixer_regs_dump(ctx); @@ -917,6 +946,25 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc) mixer_reg_writemask(mixer_ctx, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); } +static int mixer_atomic_check(struct exynos_drm_crtc *crtc, + struct drm_crtc_state *state) +{ + const struct drm_plane_state *pstate; + enum drm_color_range range_val[2]; + struct drm_plane *plane; + unsigned int cnt = 0; + + drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) { + if (plane->color_range_property && cnt < 2) { + range_val[cnt] = pstate->color_range; + ++cnt; + } + } + if (cnt == 2 && range_val[0] != range_val[1]) + return -EINVAL; + return 0; +} + static void mixer_atomic_begin(struct exynos_drm_crtc *crtc) { struct mixer_context *mixer_ctx = crtc->ctx; @@ -1096,6 +1144,7 @@ static const struct exynos_drm_crtc_ops mixer_crtc_ops = { .disable = mixer_disable, .enable_vblank = mixer_enable_vblank, .disable_vblank = mixer_disable_vblank, + .atomic_check = mixer_atomic_check, .atomic_begin = mixer_atomic_begin, .update_plane = mixer_update_plane, .disable_plane = mixer_disable_plane, diff --git a/drivers/gpu/drm/exynos/regs-mixer.h b/drivers/gpu/drm/exynos/regs-mixer.h index 5ff095b0c1b3..7d558e3dd46c 100644 --- a/drivers/gpu/drm/exynos/regs-mixer.h +++ b/drivers/gpu/drm/exynos/regs-mixer.h @@ -158,7 +158,9 @@ #define MXR_LAYER_CFG_VP_MASK MXR_LAYER_CFG_VP_VAL(~0) /* bits for MXR_CM_COEFF_Y */ +#define MXR_CM_COEFF_RGB_LIMITED (0 << 30) #define MXR_CM_COEFF_RGB_FULL (1 << 30) +#define MXR_CM_COEFF_RGB_RANGE_MASK (1 << 30) #endif /* SAMSUNG_REGS_MIXER_H */