Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp542819pxb; Thu, 5 Nov 2020 06:52:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbFk4f64Ii8OvepFIv4/q+hXc4aoqyzt46bCmuQmTR+kO5dAQci9hq6IdHHqZcTsBN6nbB X-Received: by 2002:a17:906:4d93:: with SMTP id s19mr2700511eju.271.1604587953129; Thu, 05 Nov 2020 06:52:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1604587953; cv=pass; d=google.com; s=arc-20160816; b=OgbFY2hgXXIS8eS9kathFIxQEwuydnIaBQ0dbBdnZt0xmD8y4n/A8TUkJT5xGAX2hf 1HMUryrS0pxMsxkx68W1FCqZHQ812kcQqp6D8a2DGGIud4HENzz9POPmK2hxS7M1EoP+ nBSmU4l2EQeE3yhhtdHxHG0LwUlfKY9CueQht1smU3p2ZTq3MChUmgjyLUA306xK/f/7 WxBhu5zBrLbdj+caZ462msTKVCrl9Seyku/z1Mwax1+IqPWiUl0JeylDlems/r8P3gfA FhslMlTtKKdlgdXkh6lLrYNmZ5Req1rOGKR3OyAgDTGmF1QQO8ZNn48BaXiG2pW9xVRN MIfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=j15SjDF9aLjGIPxBcDlHgRAxxK6JsizXt3CeJttpP0g=; b=zV8VhyiY3ysOOC0v4brf7z4FlL8SAE7iYhW+4zpYWovc0sP1VgWLoZlR8EYYbVby1v iQ+OcgX3QmNIWcSDhvnVj9OkWkw3E6OZAXyoC3wtOsF1kNwv+GD+JfGujww6MX4Ffhq9 1A6sG/WMIbYfVmLIJ2SWCQNFGn0zulqHIRkFqXZz8vW5BwnK7qmAXpNBDq9ujwnHMcXh +mFlzsu3nHu3GibOZKg6jqw/2U7GtJAE6xifTdwwFI5VDAk21BI6hdfeb+qYYp79wW8Q G6XzF/7FZaa43eJcRVIwG50aF919/MmkSHK2gCpPRwzMVPW8GjANspV7mBMA/DVLpmoi CTMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="Om2yd/gG"; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d22si1176882ejz.82.2020.11.05.06.52.10; Thu, 05 Nov 2020 06:52:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="Om2yd/gG"; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731006AbgKEOux (ORCPT + 99 others); Thu, 5 Nov 2020 09:50:53 -0500 Received: from mail-vi1eur05on2047.outbound.protection.outlook.com ([40.107.21.47]:39777 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730721AbgKEOuv (ORCPT ); Thu, 5 Nov 2020 09:50:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jRroRlpiI4RnQSZKfJabuBJCl1DklsiMIgE4+KYQsUMSjukrSXyBaF4z9I0eg0nhpzIg08qZV9Lx4LjjbQhWpC1+TlSnC6s2wC+7TY3FkKbITOY6o+xAg8XhnnNgLtAkTI0rUdT0hXvMFF1U9cbonHbie9rvAlWuRCuXQ+l7Do9/dS2VMsCymx4q8Iq14jUVtM3qFJMBS0z+7L1WXXPmohOjtAo8UcJqYkYFaXccRXs+9gLz7XypG9Odft/2RQeQhptbB8AZFHkqVE1ASK2tSCHq8kKBMW1C7ue46VRLo1KnUz9tmMke6AKVOJxgSj2E9EYpgqkTu20E9nW5XH8Uzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j15SjDF9aLjGIPxBcDlHgRAxxK6JsizXt3CeJttpP0g=; b=B4VtUrP8YidYS496cqCu+RufeWDW0oGhraO59VuzaOa8whEv+mVzpIJtDN380WH+tRJ68EHrtdDAln8SRUggR2jVEDO3bEVCcznpNKy9J20KaArob5iEgzTa3aff8j0bya0FYhz/6pOvXxU4JfyS9KC9TrWUeycNgNchpwmgNNeiZLwEZ/jDQNTkfOJ5xGnH+/LJH6DNWI972V7KD/H7nqaJQmh8kIgp3e5OInMzq7rSe2g9bxiwWWEihPbKPurA431AciJsgqmAqyPckowHqgjz6JzDBK/WCGiMr53QJqRzPjvRKHViMgSd3254Yekk7tfkJCOIfpJjq3uVMP/6lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j15SjDF9aLjGIPxBcDlHgRAxxK6JsizXt3CeJttpP0g=; b=Om2yd/gG0FLY7q1h+nDtNcZLlNBLoVIXxLhxjBCeZMq/Gra0PcQ/IqQd3GKoOxDqwHNiBtc/v4A8+SNo17wLqnuGhw1jq2RqKI62z+C1hYwLqT85ywr4d0C28/pr/hT8uVzTozDcU3E8Pv6NtkejesBle+9D2Toz9KukeDR1kMI= Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none;pengutronix.de; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR0402MB3902.eurprd04.prod.outlook.com (2603:10a6:803:22::27) by VE1PR04MB6495.eurprd04.prod.outlook.com (2603:10a6:803:11d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.22; Thu, 5 Nov 2020 14:50:47 +0000 Received: from VI1PR0402MB3902.eurprd04.prod.outlook.com ([fe80::f000:d709:509:bb5]) by VI1PR0402MB3902.eurprd04.prod.outlook.com ([fe80::f000:d709:509:bb5%3]) with mapi id 15.20.3499.032; Thu, 5 Nov 2020 14:50:47 +0000 From: Laurentiu Palcu To: Lucas Stach , Philipp Zabel , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: Laurentiu Palcu , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/imx/dcss: allow using nearest neighbor interpolation scaling Date: Thu, 5 Nov 2020 16:50:18 +0200 Message-Id: <20201105145018.27255-1-laurentiu.palcu@oss.nxp.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain; charset="us-ascii" X-Originating-IP: [83.217.231.2] X-ClientProxiedBy: AM0PR03CA0101.eurprd03.prod.outlook.com (2603:10a6:208:69::42) To VI1PR0402MB3902.eurprd04.prod.outlook.com (2603:10a6:803:22::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from fsr-ub1864-141.ea.freescale.net (83.217.231.2) by AM0PR03CA0101.eurprd03.prod.outlook.com (2603:10a6:208:69::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21 via Frontend Transport; Thu, 5 Nov 2020 14:50:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 47c2cff4-8a32-4914-2147-08d8819a2df1 X-MS-TrafficTypeDiagnostic: VE1PR04MB6495: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zp+Owf++aSJe9b38E+Yaw8qGPc+X0Ft7N65S0K+SexUXwyyVTBIojJ3G0ySLhrM/6D2N6gCvaUV7w7ZfpLLJQGX+9+rZTznjRg/TmImguDpai3I00uvw09WcM0sk1BtSo8oAVIEsnXkr/Zerw0tlauDk+GoEFyNo43U72a65mnwexu0rs6yuzh0Y6wT0w/ASiLryN3F6Ucl5waV1fouBCzM3a5RflHgn2DPvyKAtU8yR+uhqx0lFO05h9m9goWCYA4Uav6za4LHJ4pY8czlagzWotrZ2AaLYTCWSL2oiRrkvWTjQ64agcXi9VIrrDI5Y X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR0402MB3902.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(346002)(396003)(39860400002)(136003)(366004)(66476007)(66556008)(2906002)(8676002)(8936002)(6486002)(6512007)(66946007)(83380400001)(6666004)(86362001)(110136005)(478600001)(2616005)(956004)(7416002)(44832011)(52116002)(1076003)(186003)(4326008)(316002)(6506007)(5660300002)(16526019)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: JNv6rEFMF3tgV8akulWD+LcyC0pZWF7/vOIBmyN0Ke3ZYtMhSBGaWfw5r7xvK0Ha6W2iK8lzPJ9gytMqNO12ZY6899/GhW9hvqo8VSw51L75+t44sosAoBKXBG7NsOgRvRFttzaYcqle6ccZojTLFL9RLzEIZMRH1dadrDkv6BcW1tLEmV9ZXnHxGtMeD99p29cDxNZwOJHR/ow8Ft1ViPPagcYddT2Y0s+MB4volB47FdDp/SbsSYhtQuEz5Ev2T1SUuXW8AHiHs0qRPuVhhyDc0lKu/HjgX/bMtDcxHLUF2nN+AUV2i0P3liA1uscH+8aOngDSvRQ709TMCtBe2sC9sAaoYxT8tG62K6Tgdaq8EV/dENCrcbKrLBE6n8z9SdOLND+RI9g54q4/6RS1bCO+7N4Uoa1ssxsZGyLQcGgohSy42ER64uabXvCg4Dnvopbi2elKatj0hM0yjmp90iSJZ5lSp28wl50P6rkrOOD4qZQgB5uBSRFTOBbzogJqIKbzxCRDn1qvcO7p9l+7myei9v7TYEehTsVhxl1mnkPiVy5s7FbywGM0y2FC4mG15UWhVTo2VfKXC77smrBRvJEL6/ob0xDdYzNHxvFvF+cOcKeD940PVkC8kvBlx//Qiehw/LwrEz3sgZKX+hAPjg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47c2cff4-8a32-4914-2147-08d8819a2df1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3902.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2020 14:50:47.1419 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g6gYG9GXJsD3IahANBZrtvEZaF66ALFGcj61nisCHWBbhjCzexKyPSKGB+ukg+yw7fRA4PTsGXXm8k81WgSvKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6495 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds support for using NN interpolation scaling by setting the SCALING_FILTER plane property to 1. Otherwise, the default method is used. Signed-off-by: Laurentiu Palcu --- I had no retro pixel art games to test this with, so I used modetest to see the results: To test, I used a 240x135 buffer, upscaled 8 times to 1920x1080: * default scaling method using gaussian filter: /usr/bin/modetest -M imx-dcss -w 33:SCALING_FILTER:0 -P 33@38:240x135*8@XR24 * NN interpolation method: /usr/bin/modetest -M imx-dcss -w 33:SCALING_FILTER:1 -P 33@38:240x135*8@XR24 Thanks, laurentiu drivers/gpu/drm/imx/dcss/dcss-dev.h | 3 ++ drivers/gpu/drm/imx/dcss/dcss-plane.c | 10 +++++- drivers/gpu/drm/imx/dcss/dcss-scaler.c | 47 +++++++++++++++++++++----- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.h b/drivers/gpu/drm/imx/dcss/dcss-dev.h index c642ae17837f..1e582270c6ea 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-dev.h +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.h @@ -7,6 +7,7 @@ #define __DCSS_PRV_H__ #include +#include #include #include