From patchwork Thu May 16 06:13:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lowry Li (Arm Technology China)" X-Patchwork-Id: 10945735 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 69C0E1395 for ; Thu, 16 May 2019 06:13:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54AFB28A61 for ; Thu, 16 May 2019 06:13:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4441028AA0; Thu, 16 May 2019 06:13:14 +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 ECBA428A61 for ; Thu, 16 May 2019 06:13:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E764891C3; Thu, 16 May 2019 06:13:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40083.outbound.protection.outlook.com [40.107.4.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4376E891C3 for ; Thu, 16 May 2019 06:13:11 +0000 (UTC) Received: from DB7PR08MB3530.eurprd08.prod.outlook.com (20.177.120.80) by DB7PR08MB3788.eurprd08.prod.outlook.com (20.178.84.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.24; Thu, 16 May 2019 06:13:09 +0000 Received: from DB7PR08MB3530.eurprd08.prod.outlook.com ([fe80::e41c:9e3c:80bf:25c6]) by DB7PR08MB3530.eurprd08.prod.outlook.com ([fe80::e41c:9e3c:80bf:25c6%5]) with mapi id 15.20.1900.010; Thu, 16 May 2019 06:13:09 +0000 From: "Lowry Li (Arm Technology China)" To: Liviu Dudau , "james qian wang (Arm Technology China)" , "maarten.lankhorst@linux.intel.com" , "seanpaul@chromium.org" , "airlied@linux.ie" , Brian Starkey Subject: [PATCH v1 1/2] drm/komeda: Update HW up-sampling on D71 Thread-Topic: [PATCH v1 1/2] drm/komeda: Update HW up-sampling on D71 Thread-Index: AQHVC65u2tprcwPR+EKKtDTG4grT0g== Date: Thu, 16 May 2019 06:13:09 +0000 Message-ID: <1557987170-24032-2-git-send-email-lowry.li@arm.com> References: <1557987170-24032-1-git-send-email-lowry.li@arm.com> In-Reply-To: <1557987170-24032-1-git-send-email-lowry.li@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: HK2PR0401CA0007.apcprd04.prod.outlook.com (2603:1096:202:2::17) To DB7PR08MB3530.eurprd08.prod.outlook.com (2603:10a6:10:49::16) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 1.9.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a802f8ce-735a-4314-dc5e-08d6d9c5912f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB7PR08MB3788; x-ms-traffictypediagnostic: DB7PR08MB3788: nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-forefront-prvs: 0039C6E5C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(346002)(39860400002)(376002)(189003)(199004)(486006)(6512007)(36756003)(8676002)(6436002)(26005)(81156014)(73956011)(66446008)(64756008)(66556008)(66476007)(81166006)(66946007)(7736002)(6636002)(186003)(305945005)(11346002)(2616005)(6486002)(476003)(446003)(8936002)(50226002)(66066001)(478600001)(316002)(55236004)(25786009)(102836004)(15650500001)(2201001)(386003)(52116002)(71190400001)(76176011)(86362001)(71200400001)(6506007)(3846002)(72206003)(2906002)(2501003)(68736007)(6116002)(14454004)(53936002)(4326008)(54906003)(5660300002)(256004)(14444005)(99286004)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR08MB3788; H:DB7PR08MB3530.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: H/EvwJngq/q3fVk1xgXvpTfc9GKC8lxWLwOvet5Uh840wAvklG7LkeSdjwxfhxpTD+iu0yil8GNsWzIWcsPj7NzDS2cUhXQWPC1e7vmb8el76QvaJvY55rKUac2nlYz41pKikXN6nnvNEf7f1WGdscQI6osHaLj0d9siGBJgJ913u2ySLRTfkeatn7SyhoGA0B7gtCCaCm4DlzcIWvM/RHGtSTQOXPY8U03hE0/pGrt1XQ1zj2KabjT/qUcWwKvmuSZ2JldAAysngqZ33bSLUr40NC5pAe6WQN5TICA32DSuYs8WgNhJeQYa6eqs4O2FbcHaceIUwcPpOEK4s4H6Lk0DNQtWduCRyNBpwZPlFarnkluB7XM1qzyAko2QEIBEeF+5m08+/xQAFKiSsr3ctf5zYjXZ0BBnd4fvf7itQjc= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: a802f8ce-735a-4314-dc5e-08d6d9c5912f X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2019 06:13:09.1658 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3788 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b3F4ErHRqgXkDldi8UKWdQb75CrjG+6mTe5gROo47t0=; b=edbEwp0MoJUjVQhLW7MaAE52Y+0qWyYRX1FzKrOTDNyhPtgpX7SclsqAjunLlZYQryuS5YyxWm06BuoR82SnIzqVj+YoAEIjuqza9sOCyUswPVI/VqnDDBbIdWTL8axJw0kDcD6jJDUDTAyYpCxCCRNwzdwhUBZcoSgu6vY8IQs= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Lowry.Li@arm.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ayan Halder , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , nd Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Updates HW up-sampling method according to the format type. Signed-off-by: Lowry Li (Arm Technology China) Reviewed-by: James Qian Wang (Arm Technology China) --- .../gpu/drm/arm/display/komeda/d71/d71_component.c | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c index f8846c6..dfc70f5 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c @@ -212,6 +212,35 @@ static void d71_layer_update(struct komeda_component *c, malidp_write32(reg, BLK_P1_PTR_HIGH, upper_32_bits(addr)); } + if (fb->format->is_yuv) { + u32 upsampling = 0; + + switch (kfb->format_caps->fourcc) { + case DRM_FORMAT_YUYV: + upsampling = fb->modifier ? LR_CHI422_BILINEAR : + LR_CHI422_REPLICATION; + break; + case DRM_FORMAT_UYVY: + upsampling = LR_CHI422_REPLICATION; + break; + case DRM_FORMAT_NV12: + case DRM_FORMAT_YUV420_8BIT: + case DRM_FORMAT_YUV420_10BIT: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_P010: + /* these fmt support MPGE/JPEG both, here perfer JPEG*/ + upsampling = LR_CHI420_JPEG; + break; + case DRM_FORMAT_X0L2: + upsampling = LR_CHI420_JPEG; + break; + default: + break; + } + + malidp_write32(reg, LAYER_R_CONTROL, upsampling); + } + malidp_write32(reg, LAYER_FMT, kfb->format_caps->hw_id); malidp_write32(reg, BLK_IN_SIZE, HV_SIZE(st->hsize, st->vsize));