From patchwork Sat Feb 10 01:35:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyun Kwon X-Patchwork-Id: 10210139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B641A6032D for ; Sat, 10 Feb 2018 01:36:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA9122950F for ; Sat, 10 Feb 2018 01:36:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F36D29517; Sat, 10 Feb 2018 01:36:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 482DF2950F for ; Sat, 10 Feb 2018 01:36:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 253686E1ED; Sat, 10 Feb 2018 01:36:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0076.outbound.protection.outlook.com [104.47.37.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id D07F56E1D9 for ; Sat, 10 Feb 2018 01:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BsNvwkMO1Ps4ExhuNkC2NX7t29Coe9eFvuSm75xTWGE=; b=ben4qIM+W5H3Uti79+zT+41IUaciQLkxADG4m0IjQMeTzeWUHsfxIeKeBgXwQnUY+w4wn7uAHDZLywCSVQ/KAj1Ew6yr5V9EHRijotX7zEf/8SxWez8htrmg/1ns2oXP+shIjPnPDgiNdCFx8CzEtjwAMehb76D02MK3sDnBZhE= Received: from CY4PR02CA0043.namprd02.prod.outlook.com (10.175.57.157) by BY2PR0201MB0774.namprd02.prod.outlook.com (10.160.125.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Sat, 10 Feb 2018 01:36:07 +0000 Received: from BL2NAM02FT010.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by CY4PR02CA0043.outlook.office365.com (2603:10b6:903:117::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.485.10 via Frontend Transport; Sat, 10 Feb 2018 01:36:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT010.mail.protection.outlook.com (10.152.77.53) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.444.13 via Frontend Transport; Sat, 10 Feb 2018 01:36:06 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:53644 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1ekK5F-0002RP-Cx; Fri, 09 Feb 2018 17:36:05 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ekK5F-00063u-6s; Fri, 09 Feb 2018 17:36:05 -0800 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w1A1a4ed029307; Fri, 9 Feb 2018 17:36:04 -0800 Received: from [172.19.2.244] (helo=xsjhyunkubuntu) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ekK5E-00063X-5l; Fri, 09 Feb 2018 17:36:04 -0800 Received: by xsjhyunkubuntu (Postfix, from userid 13638) id 2A7F22C695E; Fri, 9 Feb 2018 17:36:04 -0800 (PST) From: Hyun Kwon To: Subject: [PATCH RFC v3 5/6] drm: xlnx: zynqmp: Add XV15 and XV20 formats Date: Fri, 9 Feb 2018 17:35:55 -0800 Message-ID: <1518226556-7181-6-git-send-email-hyun.kwon@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518226556-7181-1-git-send-email-hyun.kwon@xilinx.com> References: <1518226556-7181-1-git-send-email-hyun.kwon@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(376002)(346002)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(52956003)(316002)(305945005)(186003)(51416003)(16586007)(356003)(107886003)(42186006)(63266004)(106002)(103686004)(2906002)(8676002)(81166006)(50226002)(54906003)(81156014)(39060400002)(8936002)(2351001)(76176011)(50466002)(90966002)(2950100002)(6916009)(48376002)(106466001)(6266002)(36756003)(478600001)(26005)(6666003)(59450400001)(336011)(47776003)(5660300001)(4326008)(107986001)(217873001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB0774; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT010; 1:0pfrQ+g7oUpjPJd0/G6qek/NAfl/2o5f69KqPn6If3RYTAZDACsVzfpN83fLb5esiACgPP33/08jjTdKTJxNhH0jGQjRwhO8nKRiZPQaWuiLyM3JSNPjHnPoT+R4lQDw MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 827fb898-ab03-40ef-172e-08d57026a765 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:BY2PR0201MB0774; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0774; 3:CNiUatQwptV80rr1GLUdwj7DhMKPUqXQjUqRPT7oWdundQ5UtMHuLbQl1CG0Ua6VjfMshGhILGGsbj8iZs9cdSjzU1IGwoCovrmM+Z+QJx06RHIlPGSSq7soZIqV0UQOyxvBmYeVyUqJWcLU1QERuSEAUlPI8nLnNPat26QqRB49X4X4HoIAYQucv+IJvnbi8zhnsqETpbJGjdfYe7dqGBn1NGOqk5eBTQ5ZlJATX9P5N+g9h/Rdfw+YX6NUflRBzWzBV3KdweVar4alpyaf/iylEZKJvjGVhGrKLrQ7fz85Oviv2X9DbHovlzSh9PVKoxJukEvQsTwMqVt70EfCsWT+RKNeFUYYgDshUy5tYpk=; 25:LP8G/dSobI68bxRKP9YlSsBQ75TUh8seK8evIvOr0DAm+exrOedMW3XmvnnCb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vnrUiBg6RPcAqBtE2XYExsI0LcBOc X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93004095)(3231101)(944501161)(10201501046)(3002001)(6055026)(6041288)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:BY2PR0201MB0774; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB0774; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0774; 4:LtG3hf6yKkM+SauM9xZYOWOnmBLE6DGK6L9ZEPS6E4sNP/i+2Oh81B4P4KINx+qOxa1EwlihxEXVb5l7BfH9QZF2aXSnRTUQaVcW5EokKKLi0w3MXDFAZBTCFuEHruOwZ0MIM+HV+MlESWIQi50Mia/WC9q4I5yDwpk7PHYuF/KNv2+7Xomu/dCJfoE3TlSJUiCo/DaaKRO6B9h8nVtw+/WWzCZYEya3uw/gNLjC9ktoQzaAHM/uRxwoGCHzbBMYeY/HjR8xje138gYsFRZEbVCbkmxO1euoCOZ6bO8DvjHsSa0wxcLo+V5dKt9civbg X-Forefront-PRVS: 057906460E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0201MB0774; 23:PxtF9+3ICHzQWLWM30d/7a8BAlqlePr6woQUKpv?= =?us-ascii?Q?IYr2nyNTdyhmK23ibVve8ZgmjdmZzMPdrLLqeQXRfshsacvIUV1PmgCp3gRQ?= =?us-ascii?Q?gwyZ0dIj8/d4Wg5KTEXs28sm81ht2JVpE811naHMeSjHhESRAky0IVfRv3Xe?= =?us-ascii?Q?fssVxcsUdhEI/LR+QsQ32vWfDCXh6Hp4MR6IudWf26Bg7xqGpVs1xOZ7xqPP?= =?us-ascii?Q?y771OBNozjO/SjvB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M X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2018 01:36:06.0406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 827fb898-ab03-40ef-172e-08d57026a765 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB0774 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: Hyun Kwon , Daniel Vetter , Emil Velikov , Michal Simek , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use drm_format_width_bytes() to support non-byte aligned formats. Signed-off-by: Hyun Kwon --- v3 - 2 patches are squashed --- --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index e47d77d..13053fc 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -968,6 +968,24 @@ static const struct zynqmp_disp_fmt av_buf_vid_fmts[] = { .sf[0] = ZYNQMP_DISP_AV_BUF_8BIT_SF, .sf[1] = ZYNQMP_DISP_AV_BUF_8BIT_SF, .sf[2] = ZYNQMP_DISP_AV_BUF_8BIT_SF, + }, { + .drm_fmt = DRM_FORMAT_XV15, + .disp_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV16CI_420_10, + .rgb = false, + .swap = false, + .chroma_sub = true, + .sf[0] = ZYNQMP_DISP_AV_BUF_10BIT_SF, + .sf[1] = ZYNQMP_DISP_AV_BUF_10BIT_SF, + .sf[2] = ZYNQMP_DISP_AV_BUF_10BIT_SF, + }, { + .drm_fmt = DRM_FORMAT_XV20, + .disp_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV16CI_10, + .rgb = false, + .swap = false, + .chroma_sub = true, + .sf[0] = ZYNQMP_DISP_AV_BUF_10BIT_SF, + .sf[1] = ZYNQMP_DISP_AV_BUF_10BIT_SF, + .sf[2] = ZYNQMP_DISP_AV_BUF_10BIT_SF, } }; @@ -2133,6 +2151,7 @@ static int zynqmp_disp_plane_mode_set(struct drm_plane *plane, for (i = 0; i < info->num_planes; i++) { unsigned int width = src_w / (i ? info->hsub : 1); unsigned int height = src_h / (i ? info->vsub : 1); + int width_bytes; paddr = drm_fb_cma_get_gem_addr(fb, plane->state, i); if (!paddr) { @@ -2141,7 +2160,8 @@ static int zynqmp_disp_plane_mode_set(struct drm_plane *plane, } layer->dma[i].xt.numf = height; - layer->dma[i].sgl[0].size = width * info->cpp[i]; + width_bytes = drm_format_plane_width_bytes(info, i, width); + layer->dma[i].sgl[0].size = width_bytes; layer->dma[i].sgl[0].icg = fb->pitches[i] - layer->dma[i].sgl[0].size; layer->dma[i].xt.src_start = paddr;