Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4643329pxj; Wed, 12 May 2021 09:55:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytCU4vHIEZVGrSEqX7RGwsr5qPG01UQbNSg6z1EFjnIJi5MI+gFk2s4zIz14mTDRerfOSF X-Received: by 2002:a05:6402:7c7:: with SMTP id u7mr44244686edy.2.1620838521427; Wed, 12 May 2021 09:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620838521; cv=none; d=google.com; s=arc-20160816; b=fWTibuYrW9CPLyWgMEBfDZGVG9vr4wfJJTPBDzdPONLt7ANS+3+39UHp8rnmGo0hUU vJmc7/ODo5BYDT7g9JLeUpeFxLD/ng5Q+lZACzrkna319LaxFlWjxlyFWTT0dp6i1k+z i8ydZVqiW1vdA/XWiI59i378CtQzsKds+/wDari0R1Gjfg6ayOklrb7aQyi/U7ADsCkb psDydnjiQUIhP5dlKkTRonsLbbrxPngjaVQJQ/OCSwDfVaCbo30mBgctKaLwEWo/J/AY /eYAkl39aUchGBLb1thXTyC9N+d1dz1glggRi5OdyhPVto39co3C5ulnuuQws68BmFmD skiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VqS3zRLSkZXhBByncNjh67T9/Ow07N+4Puechd3/3mk=; b=Ax0tnySK0iYI91xGDBN2HAMLa4799HD84rSQ6FV2DGLjmgJQZT3Njd+xE7wjhQjXV2 nj8YM7snIn6c/ptP/rqkfY7iYdnnn9dvjtGZWe++YEVZGiIHvZlSmgMmxgjODSRtHJOb wI5cYUBkIiyrbgG7jwsnvz12ulJILiIdoZ4bZG8Dce5h2uQqyxzkPY0AOPlZpng4MRzo 37z4lUeN5e21OnQNyEZT8Tux8iTk8r3BX+jMa9wwKUT/Sz6Yg7v49NmMh2kLAR8KHJub ukQmZRINgXLTBSgbeLBPROT8w/G7lR0DGyN+8anHZhH8kypH5wvrhykge02AKQXfZWSv Fowg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dB+7r7UR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 26si184877ejx.371.2021.05.12.09.54.51; Wed, 12 May 2021 09:55:21 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=dB+7r7UR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343653AbhELQxW (ORCPT + 99 others); Wed, 12 May 2021 12:53:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:51030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233960AbhELPxJ (ORCPT ); Wed, 12 May 2021 11:53:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B36A361A0F; Wed, 12 May 2021 15:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833216; bh=z1n+Wp0xewqMxcGI+T2+ktYQ36uKpi2LdlmtLEyajmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dB+7r7UREiP0LR7wR2r5b2dAj0+SmRaONHPMn87fS90YZ94O5T99rNdkF80c5NPsI rLe91iqT30IwDzDWivEZtUi9qKL1B/dS+r+DgQOCgyvoZKM/xOiUqrSJu2o6ooElUI Xentrx5ZAou0wmeZ6cB1/4flpKFVTdK9uvzyufQM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Cercueil , Daniel Vetter , "H. Nikolaus Schaller" Subject: [PATCH 5.11 063/601] drm/ingenic: Fix non-OSD mode Date: Wed, 12 May 2021 16:42:20 +0200 Message-Id: <20210512144829.892781591@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144827.811958675@linuxfoundation.org> References: <20210512144827.811958675@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Cercueil commit 7b4957684e5d813fcbdc98144e3cc5c4467b3e2e upstream. Even though the JZ4740 did not have the OSD mode, it had (according to the documentation) two DMA channels, but there is absolutely no information about how to select the second DMA channel. Make the ingenic-drm driver work in non-OSD mode by using the foreground0 plane (which is bound to the DMA0 channel) as the primary plane, instead of the foreground1 plane, which is the primary plane when in OSD mode. Fixes: 3c9bea4ef32b ("drm/ingenic: Add support for OSD mode") Cc: # v5.8+ Signed-off-by: Paul Cercueil Acked-by: Daniel Vetter Tested-by: H. Nikolaus Schaller Link: https://patchwork.freedesktop.org/patch/msgid/20210124085552.29146-5-paul@crapouillou.net Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -553,7 +553,7 @@ static void ingenic_drm_plane_atomic_upd height = state->src_h >> 16; cpp = state->fb->format->cpp[0]; - if (priv->soc_info->has_osd && plane->type == DRM_PLANE_TYPE_OVERLAY) + if (!priv->soc_info->has_osd || plane->type == DRM_PLANE_TYPE_OVERLAY) hwdesc = &priv->dma_hwdescs->hwdesc_f0; else hwdesc = &priv->dma_hwdescs->hwdesc_f1; @@ -809,6 +809,7 @@ static int ingenic_drm_bind(struct devic const struct jz_soc_info *soc_info; struct ingenic_drm *priv; struct clk *parent_clk; + struct drm_plane *primary; struct drm_bridge *bridge; struct drm_panel *panel; struct drm_encoder *encoder; @@ -923,9 +924,11 @@ static int ingenic_drm_bind(struct devic if (soc_info->has_osd) priv->ipu_plane = drm_plane_from_index(drm, 0); - drm_plane_helper_add(&priv->f1, &ingenic_drm_plane_helper_funcs); + primary = priv->soc_info->has_osd ? &priv->f1 : &priv->f0; - ret = drm_universal_plane_init(drm, &priv->f1, 1, + drm_plane_helper_add(primary, &ingenic_drm_plane_helper_funcs); + + ret = drm_universal_plane_init(drm, primary, 1, &ingenic_drm_primary_plane_funcs, priv->soc_info->formats_f1, priv->soc_info->num_formats_f1, @@ -937,7 +940,7 @@ static int ingenic_drm_bind(struct devic drm_crtc_helper_add(&priv->crtc, &ingenic_drm_crtc_helper_funcs); - ret = drm_crtc_init_with_planes(drm, &priv->crtc, &priv->f1, + ret = drm_crtc_init_with_planes(drm, &priv->crtc, primary, NULL, &ingenic_drm_crtc_funcs, NULL); if (ret) { dev_err(dev, "Failed to init CRTC: %i\n", ret);