Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp347572rdb; Thu, 1 Feb 2024 10:06:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpiOH77HHNCVerIuZz0P1Ka1SrHwV9YoXgOzDB3xAX4Rq4dOphf/5erX3u0ZwSUooCHJCx X-Received: by 2002:aa7:84d0:0:b0:6de:20ba:648c with SMTP id x16-20020aa784d0000000b006de20ba648cmr6200934pfn.24.1706810768675; Thu, 01 Feb 2024 10:06:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706810768; cv=pass; d=google.com; s=arc-20160816; b=Ou2Le6Iy3gSxb1q0BU+s7kMZjPaCLfsPTpYiS3WTB9mBa+qXMDUYJU0OhV/yJovyPd BkzyucFAz0uKqLBERK/Q00h+HA3GuB3jG6MqI+ykqygbqdeC0UGvLYa8tz/m8vU2i3lQ czQ4aLqjbbVenL2AEtNr+MOmvJQBcHge2wdKkMnlZ+UEFI2AMrrkM/kB1knXMjT7Llvo cuNtD5ch9Ldljwna3YItUrYkQVgTqwybVPvMWNIiJRXe2ZZ1esm9+tk57JhX8vnxRkkk Li8DVf9TfZc9h1HhCK6mM5c2tnJ+JZTpcFCA6DShZN7h4SrbSnfYkfslZsTh6RGIJ1ak MofA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=V2KBXwj4NCjvyE4+0IyeJO23YI/n7DqRxLkdLjw4M2I=; fh=He381KCpTovZ6l3yvhXFsvWpLWkiKW79SjRFtvvojBI=; b=QubMj7bzyKdRdUJU5BaC5TUyVBHHaFvcwutkrclvUub5Kn+wYiA/W5reH6vsNaBqa/ UjhZVzbLFL/gGkk9Sg5W0YwM9nxZysBGPblTLcPPUUv+XiBC+EXHBF2byX46xCnIalNU +pfqmOWFQtMaTJKNQNZwqMK45tULTbmYMyYdjYboDFWrV10xTmgXVuA703jyeoLlJqi7 f5+3RnGc6loLnHplP+KJDfamTOG0TzM/fko9I8CeX/1aLsdbw/N3XFED+qRkXJJ9EOPh +dL6q6sJ5vFAhDOhd5ZpCG+WP1Exf71PppRj/tY75bAIfYXNsmG2u9Hdt6HqRhrxDge/ Rbvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YzY1cTmS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-48606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=1; AJvYcCXDL4o8pQpoPZR7R8zv9sU7hhC5ZyU0i5Ry1YiWno4csRYYjtA6LDIHbiNsCISgXVDhnEqCCI9I8DvY8C8fSmlpRPth2rWeX3CNjF+q5Q== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r26-20020aa79eda000000b006de0a16bcf0si40469pfq.167.2024.02.01.10.06.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:06:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YzY1cTmS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-48606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0F3FCB282E9 for ; Thu, 1 Feb 2024 17:39:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C36006FBB7; Thu, 1 Feb 2024 17:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="YzY1cTmS" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E30366FB80; Thu, 1 Feb 2024 17:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706809183; cv=none; b=EzEIcqwxCH53OPzyE+kNCO6a6X8QW5Ceu+Mri1iTlKJ08YJDITRwLCegaYSIlhgN8PdlrounEDhStTbc+yhTZRQv3yogUmnxhesWKgRZDQgBgdigzuEygT5/DSpJoRBm5yjSRDNqWBODiTq+26ZlOogn0X6wQrNQLFwiMd7oZmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706809183; c=relaxed/simple; bh=RWGyUTm81HR0yufwItYXvd5eIRRmFJnLjC1+iy6AijI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l3uKrOSrVnCyUl31mIfOyaFXj3EG8z3jIyX4JXuOuOO5jc+WifXt9Fxu4Fl/t/VPC4lP+fvO4TKZD+Wt8eJATj9gdP/TYBimtk46aiAvnE8oGLjgMAV3T4oVgAEcgn8/5Dl8lrkX9f/+ROyJGIr4SVodcphC3VwCS5KMbonZR60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=YzY1cTmS; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 4896A40006; Thu, 1 Feb 2024 17:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706809178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V2KBXwj4NCjvyE4+0IyeJO23YI/n7DqRxLkdLjw4M2I=; b=YzY1cTmSdDy0ffIMayCgOBcypcfMFD/Hvvfmyst5xxSR1Vg5PS4+95h2BDc+oz66xWiUgp ax/GemPF+x9OGVoXKrtTZkr6Ry4ajL99c58ko7eTVTAsc6dAD2QyZz/IgA6TphbY3iG8rz uV5w1IrlTydt64Wo3l3qVM+b8Vu77J7npywQtfl7Vp1WE6RDw9cEpve9UT1dse5ZJWGnN/ pIXAywFNqRQP6FTcBekTJ0LmmpNrPNSe2y/iWxAIU+myq04SxINmA0ZGEEtzfdSDpkVVl4 puibyhHuFDpBo756cSN2+AUrNMhhHHuqlfVgW3qKhqqHnFvvkeZl0iqQvnrZLw== Date: Thu, 1 Feb 2024 18:39:35 +0100 From: Louis Chauvet To: Arthur Grillo Cc: Daniel Vetter , David Airlie , Haneen Mohammed , Harry Wentland , Jonathan Corbet , Maarten Lankhorst , Maxime Ripard , =?iso-8859-1?Q?Ma=EDra?= Canal , Melissa Wen , Rodrigo Siqueira , Thomas Zimmermann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, nicolejadeyee@google.com, seanpaul@google.com, thomas.petazzoni@bootlin.com, miquel.raynal@bootlin.com Subject: Re: [PATCH v2 4/7] drm/vkms: Add chroma subsampling Message-ID: Mail-Followup-To: Arthur Grillo , Daniel Vetter , David Airlie , Haneen Mohammed , Harry Wentland , Jonathan Corbet , Maarten Lankhorst , Maxime Ripard , =?iso-8859-1?Q?Ma=EDra?= Canal , Melissa Wen , Rodrigo Siqueira , Thomas Zimmermann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, nicolejadeyee@google.com, seanpaul@google.com, thomas.petazzoni@bootlin.com, miquel.raynal@bootlin.com References: <20240110-vkms-yuv-v2-0-952fcaa5a193@riseup.net> <20240110-vkms-yuv-v2-4-952fcaa5a193@riseup.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240110-vkms-yuv-v2-4-952fcaa5a193@riseup.net> X-GND-Sasl: louis.chauvet@bootlin.com [...] > @@ -146,18 +149,23 @@ void vkms_compose_row(struct line_buffer *stage_buffer, struct vkms_plane_state > for (size_t x = 0; x < limit; x++) { > int x_pos = get_x_position(frame_info, limit, x); > > + bool shoud_inc = !((x + 1) % frame_format->num_planes); I think this line will break if the subsampling is not the same as the plane count. For NV12 it works only because there are two planes and hsub=2/vsub=2, but I believe NV24 will not work because of plane 2, as we need to increment x at the same speed on all planes. I have a proposal to solve this issue (see my patchset applying on top of yours). You probably at least need to use .hsub/vsub to increment/decrement properly src_pixels pointer. Currently the tests pass for it because it only use "horizontal lines" and "full color" pictures. In the series [1] I proposed to change the pattern to detect this kind of issue. [...] [1]: https://lore.kernel.org/dri-devel/20240201-yuv-v1-0-3ca376f27632@bootlin.com/T/#t -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com