From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 788C725178C; Mon, 23 Jun 2025 13:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750685336; cv=none; b=Id2g6UsFiQH7jTVlNp8kgfjcu5Pipbq2QruaD6CqSD9xGb8mq+Hz2g6UVQUX0gSs5SLbJEE33nBpNAjxOPYgELJVXhYRtvTMou+4/rAzLA7e0OSlqEJLuwQ9y5hS1AzXyzdBJcbJ69VFRm+K9hvJWXaOqfF7PueSTPCn8m5IKVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750685336; c=relaxed/simple; bh=TK6/9lXwSJk+nIerwHpHZ0eHE07rtN1ty3rhaIKvNYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g/esDeTHazsn0IFNM+ox+vSpA+7/Qpm8R5LX1fk3qwFj0wNDIXdRWeJdoU3MQbweSSKHKzHvNnJhw9Amo0VxDM/Uo3Qlzen2cUT/BhEr6i/E/VAfy6c5twiCSyLfgn2KBfpdU4HgRWqVW09JjCEsbK9/zh9aCZpyV0IejhC2LWs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eEArihD3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="eEArihD3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D0EAC4CEF1; Mon, 23 Jun 2025 13:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750685336; bh=TK6/9lXwSJk+nIerwHpHZ0eHE07rtN1ty3rhaIKvNYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eEArihD3ngiT1tX+eXQkUsV7rbfmFKBZEdeAy/+J7Y5I/maB5YMykndAFlwbAMwyK j2G5Hj6AZrTs+6OX0oECf54ejqiwYlEh35m/mGCFG8XXK8TeIM3PhMtRgICDJAD796 KPZPLpLtxf5vwg4/CLTjIAcP2UEGdYJlIOo7C6Wo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Bee , Jonas Karlman , Nicolas Dufresne , Hans Verkuil , Sasha Levin Subject: [PATCH 5.15 028/411] media: rkvdec: Fix frame size enumeration Date: Mon, 23 Jun 2025 15:02:52 +0200 Message-ID: <20250623130633.846076693@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130632.993849527@linuxfoundation.org> References: <20250623130632.993849527@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonas Karlman [ Upstream commit f270005b99fa19fee9a6b4006e8dee37c10f1944 ] The VIDIOC_ENUM_FRAMESIZES ioctl should return all frame sizes (i.e. width and height in pixels) that the device supports for the given pixel format. It doesn't make a lot of sense to return the frame-sizes in a stepwise manner, which is used to enforce hardware alignments requirements for CAPTURE buffers, for coded formats. Instead, applications should receive an indication, about the maximum supported frame size for that hardware decoder, via a continuous frame-size enumeration. Fixes: cd33c830448b ("media: rkvdec: Add the rkvdec driver") Suggested-by: Alex Bee Signed-off-by: Jonas Karlman Reviewed-by: Nicolas Dufresne Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/staging/media/rkvdec/rkvdec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index 29b68a13674ee..9c85370fd81bc 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -188,8 +188,14 @@ static int rkvdec_enum_framesizes(struct file *file, void *priv, if (!fmt) return -EINVAL; - fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE; - fsize->stepwise = fmt->frmsize; + fsize->type = V4L2_FRMSIZE_TYPE_CONTINUOUS; + fsize->stepwise.min_width = 1; + fsize->stepwise.max_width = fmt->frmsize.max_width; + fsize->stepwise.step_width = 1; + fsize->stepwise.min_height = 1; + fsize->stepwise.max_height = fmt->frmsize.max_height; + fsize->stepwise.step_height = 1; + return 0; } -- 2.39.5