From patchwork Thu Nov 5 14:50:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Palcu X-Patchwork-Id: 11884549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AFBAC4741F for ; Thu, 5 Nov 2020 14:50:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 93EDA21D81 for ; Thu, 5 Nov 2020 14:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="Om2yd/gG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93EDA21D81 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42C726ED8A; Thu, 5 Nov 2020 14:50:51 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2083.outbound.protection.outlook.com [40.107.21.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 50DD96ED84 for ; Thu, 5 Nov 2020 14:50:50 +0000 (UTC) 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 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurentiu Palcu , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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