From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 174AAC636CC for ; Sat, 18 Feb 2023 11:06:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjBRLGP (ORCPT ); Sat, 18 Feb 2023 06:06:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbjBRLGO (ORCPT ); Sat, 18 Feb 2023 06:06:14 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B4401A4B1 for ; Sat, 18 Feb 2023 03:06:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F041F60B45 for ; Sat, 18 Feb 2023 11:06:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 159ECC433EF; Sat, 18 Feb 2023 11:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676718372; bh=b/mQEWwfOl4RL5m516pU3IxWKO+/gQVlxGsW1/XxReU=; h=Subject:To:Cc:From:Date:From; b=DrYBG0qNo7IIwvZQ2PbKS4MGQV7OkcoCAq3BFSFmTaBqUdejz6PoQhdU0Vtb+kAWG SfBaNVKVL0SjKGzi4+NoLFoizfaWpHmglcJsPW09gBfWC8P8aq5hfHG7cWSeckxKmi 3B1GIwe4Jf7ithWwIfw/XqIBb1eyAbdQ4Uhg+9dI= Subject: FAILED: patch "[PATCH] drm/vc4: Fix YUV plane handling when planes are in different" failed to apply to 5.10-stable tree To: dave.stevenson@raspberrypi.com, maxime@cerno.tech Cc: From: Date: Sat, 18 Feb 2023 12:06:07 +0100 Message-ID: <167671836713570@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Possible dependencies: 6b77b16de75a ("drm/vc4: Fix YUV plane handling when planes are in different buffers") 8c30eecc6769 ("drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}") 4a83c26a1d87 ("drm/gem: rename GEM CMA helpers to GEM DMA helpers") 6bcfe8eaeef0 ("drm/fb: rename FB CMA helpers to FB DMA helpers") 5e8bf00ea915 ("drm/fb: remove unused includes of drm_fb_cma_helper.h") a4d847df8b44 ("drm/fsl-dcu: Use drm_plane_helper_destroy()") 254e5e8829a9 ("drm: Remove unnecessary include statements of drm_plane_helper.h") 382fc1f68132 ("drm/atomic-helper: Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers") b7345c9799da ("drm/vc4: txp: Protect device resources") e23a5e14aa27 ("Backmerge tag 'v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 6b77b16de75a6efc0870b1fa467209387cbee8f3 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 27 Jan 2023 16:57:08 +0100 Subject: [PATCH] drm/vc4: Fix YUV plane handling when planes are in different buffers YUV images can either be presented as one allocation with offsets for the different planes, or multiple allocations with 0 offsets. The driver only ever calls drm_fb_[dma|cma]_get_gem_obj with plane index 0, therefore any application using the second approach was incorrectly rendered. Correctly determine the address for each plane, removing the assumption that the base address is the same for each. Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.") Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230127155708.454704-1-maxime@cerno.tech diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 8b92a45a3c89..bd5acc4a8687 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -340,7 +340,7 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) { struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); struct drm_framebuffer *fb = state->fb; - struct drm_gem_dma_object *bo = drm_fb_dma_get_gem_obj(fb, 0); + struct drm_gem_dma_object *bo; int num_planes = fb->format->num_planes; struct drm_crtc_state *crtc_state; u32 h_subsample = fb->format->hsub; @@ -359,8 +359,10 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) if (ret) return ret; - for (i = 0; i < num_planes; i++) + for (i = 0; i < num_planes; i++) { + bo = drm_fb_dma_get_gem_obj(fb, i); vc4_state->offsets[i] = bo->dma_addr + fb->offsets[i]; + } /* * We don't support subpixel source positioning for scaling,