From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7855606A69A for ; Fri, 4 Dec 2026 08:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=OmTWl3gT; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=hX3CHJRe; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.a=rsa-sha256 header.s=google header.b=QrL5AeiW DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=2fy5lrN4V81QAXtLuVmAb7BJ4ciF4TMxAmQrPMPIqRs=; b=OmTWl3gTitp2wSlQOn0/7rJNwX gBofNFJeAelK+6PTXPGiNxXE/KaTdtFWuxv1MN7nRkRiKg6gzXeUuARGCQCzZvZhoDSZciCxrLIHp cwVfOf0YxeWShXpFpRvsib/X/aWXXGL4ChnSQHIxDXzrhkPMAXKJfCAYtyZMiByk1xay4dpo4Fr6S xMprOzjDra+36K6/yBDgbJLRYul7MlbPfyqnsAjCgVmELS1VKzDyJmqQlwKkhHHunaBi/MGDsd3xC 2bDUqQl0EJxzq7LEebsLbuKwyUR4fYFz383LQGF82IUtHHohfx78QWUNNTamvKAbh4pV+sbIPJRCo 51YwyOlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZONp-0000000H3BX-1ckb; Fri, 04 Dec 2026 08:11:09 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZONn-0000000H39k-4Ahe for linux-amlogic@bombadil.infradead.org; Fri, 04 Dec 2026 08:11:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=0p1y73sNTLAOr/hjJn/qC8VoERy84tCMgMacPCazhW0=; b=hX3CHJRepRu4AGCi9pRsZmcgnj /fbFPTaKsf85LKixfQZHY9vLpWN0zzLKLgkC7OLD9dfrxLymP1zltHltX3xHWB2WqzwBtjsZrB7ue 0wZD0XvQv4iT4QRHyCGVCqSW+07Hw6YxckrBujjIoCtYLzCduOjG3UwB8EEdY6+KbYbx2FHqR1hjV T0KY11uM5YEzQoiMrWILwIwG0S3iEiqkCjh9HHKHVLgKucR/ap/Rxj7J9UQae6iC6tClQs6d5W8YJ yHmw7B+5jbe83CNxtxZ0dXcpxrrXKeMxVFMchiJjzBdeoQfkX3lIzBDv91S6DCnIPVciuXunGFIGh mdQpM28g==; Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by desiato.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZONk-0000000E9M3-1WOt for linux-amlogic@lists.infradead.org; Fri, 04 Dec 2026 08:11:06 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-c4cac7a7d3cso114144266b.3 for ; Fri, 04 Dec 2026 00:11:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1796371862; x=1796976662; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=0p1y73sNTLAOr/hjJn/qC8VoERy84tCMgMacPCazhW0=; b=QrL5AeiWPz5NHuD7cMT7aaBSFYWkYrzXjBSUDVKSi8RUHO6EoZK0iR74fHVFdqC5Jd iFOMkSTi2HPJNhNZDvEH70jz7430TxlQcUkXP7NlmOp+lu53ogEqSkJPxhWat+4RIDz1 o7hC07IdkJWKARCLs1UM8XUIPaOPycoO0I7BKdbnD6yGiDoIPyU423Q6NWMmMA/ibQ5S 4RRTY0UZYVOznlR9jeweDot/jgPCYj28FCoXT4M4NjiYeH+TZcf4AYNKCpEuDVhGmQMl 7n9AHquY4rPz+BeU3McZkBf8BeEAlye3lW3KUIhY9MCkD3iseXRcx7mMYtM4WujYS7fP BjNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796371862; x=1796976662; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0p1y73sNTLAOr/hjJn/qC8VoERy84tCMgMacPCazhW0=; b=xlRVpgL18CNxsDmO5QqJKefJHX7w5rHzZq0Yo5lQi9rspKVKuk5i4UJXM5tG2k2MvB iB3bp3TDAj4Pm/XyMnSeIUjNBy1+lKbxwx9h4os6L+FlWycTlXWtGIFeRU/4/qeB+zu4 Ym4w560gHd2VLZ/vsmy6EadpHao72poxbL3MdIrYoFYMPc2RHY1WUeYF0dx9R4slBJe/ 1GPjGRg/ZfW8T73WZmdXuvEBz3/7/i+jZ5+z0yidDygYDZe8ivlWkdGmf1r3Qsz7sXF/ ZFNSFcQES8At646bYbDoz+fj2AIY2c7gtnS3SsqsRBr4RCAVLJGUvaUEK/a2Dqeh5kSB SUbw== X-Forwarded-Encrypted: i=1; AL+hErFUWNuuk00oyuRxRdVeU0z9s5ffh1uDgiXkKfhwhHEUNpivT0Qk1st9Mu43vw30MHY01WSBhU0TNXM3XTjD@lists.infradead.org X-Gm-Message-State: APuU4Z/+um87Vs5lhrm20xpg5RDg1dgRILHEdTyDYN5Xpy3ZkQX0Jzuq EHuQSmQ0xkCbS56YsoMFAztEWAZjDGpmi10vmsI8D1Zw7PAcnkwkI8GeLMxKrwPk8IU= X-Gm-Gg: AZFdTZf6D2JMTgMIb1RjcN2AXBqITkA5bYGbVVBUJAoN+S4d9v947zzaSel4nh4hcwY tREf+hWJwhtiyQ/15Y/lmDi2HAt3jbaXVRH15D3aP5GAWG3T38voNoTKRGI/pxeSjYv6fpBwmpO aFmJptCffrRT12upWkv3RE2LwuwsWMGApvTDyHujYlj2ZL1kIn+6Zsu1n5mgOOo3sCCZePSbdZ1 CUT7lvbNJhEyrPiQp8BUBOtVhoecQChY6pChhOMNBQmpvbE7bZ2HVMm9dxyJ/FRmelNss/b1h3y KSLL3Q12qSacv2ngS8i+V7b7gFRZcaGm3+f2ZNxFA6pNbTT2KstJc3fosaBKXmYyvvcKOrjqS9X EQEdLE7QChCy2afNp+lyQGfJENUWc6QnZrSIrswxi9QpF7F/xCZXpsoy8yJuzx7gCBuF4GSJsg+ FrCgpGKnbK3Gh/DRxQUO2FL5nPVLFUJRLZ6RqB500lAtJGOhDrDUNB7Upy0wFjcitmdWL7o1vBQ uhHXNQKZnC6+/veb7l69qH9RMEw72/A660fGTPLj3pPLWjYXEH/PNBeszI676usvapQMenDPEsI CdEgBMb9G3371S53Xn+aRpUxR/Qr7f9jkk1vbXqaxX7x83mycts= X-Received: by 2002:a17:907:961e:b0:c4c:ddd1:d006 with SMTP id a640c23a62f3a-c52624aba97mr71620266b.38.1796371862450; Fri, 04 Dec 2026 00:11:02 -0800 (PST) Received: from [127.0.1.1] ([2a01:e0a:e50:3860::e1d1:d182]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d17445284esm4107729f8f.44.2026.12.04.00.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 00:11:02 -0800 (PST) From: Guillaume La Roque Date: Fri, 04 Dec 2026 09:08:03 +0100 Subject: [PATCH v4 2/9] drm/meson: isolate primary plane scaler setup X-Archived-By: MIME-Version: 1.0 Message-Id: <20261204-meson-g12a-osd2-v4-2-ad356340dbd6@baylibre.com> References: <20261204-meson-g12a-osd2-v4-0-ad356340dbd6@baylibre.com> In-Reply-To: <20261204-meson-g12a-osd2-v4-0-ad356340dbd6@baylibre.com> To: Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Simona Vetter , linux-kernel@vger.kernel.org, Guillaume La Roque X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1796371859; l=9126; i=glaroque@baylibre.com; s=20261019; h=from:subject:message-id; bh=eB3OiIUPfHUKWEj4SaH5Zll1LRm+7XgCYHT6rZ4KnQs=; b=mh6yWgjt1gKpj9+o+8snngBZFcGiNyGDVUoq8XwE7Uzs5RG9OWu+r+VnjaCYgh3QUonhY7ok0 hs5tNeKU1tEAswwCj3cYJs1ZnjWcS0s9B1dwHjCnnK29KhFnXCJa3S8 X-Developer-Key: i=glaroque@baylibre.com; a=ed25519; pk=nMpSg4NT6M6q143E089emouMc+MXpHO9CWmnEUfjhjI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_081104_905106_FFAA5994 X-CRM114-Status: GOOD ( 16.95 ) X-Spam-Score: -0.2 (/) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Separate the OSD1 scaler from format, buffer and geometry handling so another RGB plane can reuse scanout setup without changing the primary scaler state. Keep the primary blender dimensions based on crtc_w and crtc_h, including the existing height division for interlaced modes. Signed-off-by: Guillaume La Roque --- drivers/gpu/drm/meson/meson_plane.c | 224 +++++++++++++++++++----------------- 1 file changed, 119 insertions(+), 105 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index 30afeadc7e01..9976809ecaa7 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -148,6 +148,118 @@ static u32 meson_g12a_afbcd_line_stride(struct meson_drm *priv) return ((line_stride + 1) >> 1) << 1; } +static void meson_plane_setup_scaler(struct meson_drm *priv, + struct drm_plane_state *new_state, + struct drm_rect *dest) +{ + int vsc_ini_rcv_num, vsc_ini_rpt_p0_num; + int vsc_bot_rcv_num, vsc_bot_rpt_p0_num; + int hsc_ini_rcv_num, hsc_ini_rpt_p0_num; + int hf_phase_step, vf_phase_step; + int src_w, src_h, dst_w, dst_h; + int bot_ini_phase; + int hf_bank_len; + int vf_bank_len; + + /* Default scaler parameters */ + vsc_bot_rcv_num = 0; + vsc_bot_rpt_p0_num = 0; + hf_bank_len = 4; + vf_bank_len = 4; + + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { + vsc_bot_rcv_num = 6; + vsc_bot_rpt_p0_num = 2; + } + + hsc_ini_rcv_num = hf_bank_len; + vsc_ini_rcv_num = vf_bank_len; + hsc_ini_rpt_p0_num = (hf_bank_len / 2) - 1; + vsc_ini_rpt_p0_num = (vf_bank_len / 2) - 1; + + src_w = fixed16_to_int(new_state->src_w); + src_h = fixed16_to_int(new_state->src_h); + dst_w = new_state->crtc_w; + dst_h = new_state->crtc_h; + + /* + * When the output is interlaced, the OSD must switch between + * each field using the INTERLACE_SEL_ODD (0) of VIU_OSD1_BLK0_CFG_W0 + * at each vsync. + * But the vertical scaler can provide such funtionnality if + * is configured for 2:1 scaling with interlace options enabled. + */ + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { + dest->y1 /= 2; + dest->y2 /= 2; + dst_h /= 2; + } + + hf_phase_step = ((src_w << 18) / dst_w) << 6; + vf_phase_step = (src_h << 20) / dst_h; + + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) + bot_ini_phase = ((vf_phase_step / 2) >> 4); + else + bot_ini_phase = 0; + + vf_phase_step = (vf_phase_step << 4); + + /* In interlaced mode, scaler is always active */ + if (src_h != dst_h || src_w != dst_w) { + priv->viu.osd_sc_i_wh_m1 = SCI_WH_M1_W(src_w - 1) | + SCI_WH_M1_H(src_h - 1); + priv->viu.osd_sc_o_h_start_end = SCO_HV_START(dest->x1) | + SCO_HV_END(dest->x2 - 1); + priv->viu.osd_sc_o_v_start_end = SCO_HV_START(dest->y1) | + SCO_HV_END(dest->y2 - 1); + /* Enable OSD Scaler */ + priv->viu.osd_sc_ctrl0 = SC_CTRL0_PATH_EN | SC_CTRL0_SEL_OSD1; + } else { + priv->viu.osd_sc_i_wh_m1 = 0; + priv->viu.osd_sc_o_h_start_end = 0; + priv->viu.osd_sc_o_v_start_end = 0; + priv->viu.osd_sc_ctrl0 = 0; + } + + /* In interlaced mode, vertical scaler is always active */ + if (src_h != dst_h) { + priv->viu.osd_sc_v_ctrl0 = + VSC_BANK_LEN(vf_bank_len) | + VSC_TOP_INI_RCV_NUM(vsc_ini_rcv_num) | + VSC_TOP_RPT_L0_NUM(vsc_ini_rpt_p0_num) | + VSC_VERTICAL_SCALER_EN; + + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) + priv->viu.osd_sc_v_ctrl0 |= + VSC_BOT_INI_RCV_NUM(vsc_bot_rcv_num) | + VSC_BOT_RPT_L0_NUM(vsc_bot_rpt_p0_num) | + VSC_PROG_INTERLACE; + + priv->viu.osd_sc_v_phase_step = SC_PHASE_STEP(vf_phase_step); + priv->viu.osd_sc_v_ini_phase = VSC_INI_PHASE_BOT(bot_ini_phase); + } else { + priv->viu.osd_sc_v_ctrl0 = 0; + priv->viu.osd_sc_v_phase_step = 0; + priv->viu.osd_sc_v_ini_phase = 0; + } + + /* Horizontal scaler is only used if width does not match */ + if (src_w != dst_w) { + priv->viu.osd_sc_h_ctrl0 = + HSC_BANK_LENGTH(hf_bank_len) | + HSC_INI_RCV_NUM0(hsc_ini_rcv_num) | + HSC_RPT_P0_NUM0(hsc_ini_rpt_p0_num) | + HSC_HORIZ_SCALER_EN; + priv->viu.osd_sc_h_phase_step = SC_PHASE_STEP(hf_phase_step); + priv->viu.osd_sc_h_ini_phase = 0; + } else { + priv->viu.osd_sc_h_ctrl0 = 0; + priv->viu.osd_sc_h_phase_step = 0; + priv->viu.osd_sc_h_ini_phase = 0; + } +} + static void meson_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_commit *state) { @@ -159,14 +271,6 @@ static void meson_plane_atomic_update(struct drm_plane *plane, struct drm_framebuffer *fb = new_state->fb; struct drm_gem_dma_object *gem; unsigned long flags; - int vsc_ini_rcv_num, vsc_ini_rpt_p0_num; - int vsc_bot_rcv_num, vsc_bot_rpt_p0_num; - int hsc_ini_rcv_num, hsc_ini_rpt_p0_num; - int hf_phase_step, vf_phase_step; - int src_w, src_h, dst_w, dst_h; - int bot_ini_phase; - int hf_bank_len; - int vf_bank_len; u8 canvas_id_osd1; /* @@ -258,103 +362,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, /* Use the pixel's alpha */ priv->viu.osd1_ctrl_stat2 &= ~OSD_REPLACE_EN; - /* Default scaler parameters */ - vsc_bot_rcv_num = 0; - vsc_bot_rpt_p0_num = 0; - hf_bank_len = 4; - vf_bank_len = 4; - - if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { - vsc_bot_rcv_num = 6; - vsc_bot_rpt_p0_num = 2; - } - - hsc_ini_rcv_num = hf_bank_len; - vsc_ini_rcv_num = vf_bank_len; - hsc_ini_rpt_p0_num = (hf_bank_len / 2) - 1; - vsc_ini_rpt_p0_num = (vf_bank_len / 2) - 1; - - src_w = fixed16_to_int(new_state->src_w); - src_h = fixed16_to_int(new_state->src_h); - dst_w = new_state->crtc_w; - dst_h = new_state->crtc_h; - - /* - * When the output is interlaced, the OSD must switch between - * each field using the INTERLACE_SEL_ODD (0) of VIU_OSD1_BLK0_CFG_W0 - * at each vsync. - * But the vertical scaler can provide such funtionnality if - * is configured for 2:1 scaling with interlace options enabled. - */ - if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) { - dest.y1 /= 2; - dest.y2 /= 2; - dst_h /= 2; - } - - hf_phase_step = ((src_w << 18) / dst_w) << 6; - vf_phase_step = (src_h << 20) / dst_h; - - if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) - bot_ini_phase = ((vf_phase_step / 2) >> 4); - else - bot_ini_phase = 0; - - vf_phase_step = (vf_phase_step << 4); - - /* In interlaced mode, scaler is always active */ - if (src_h != dst_h || src_w != dst_w) { - priv->viu.osd_sc_i_wh_m1 = SCI_WH_M1_W(src_w - 1) | - SCI_WH_M1_H(src_h - 1); - priv->viu.osd_sc_o_h_start_end = SCO_HV_START(dest.x1) | - SCO_HV_END(dest.x2 - 1); - priv->viu.osd_sc_o_v_start_end = SCO_HV_START(dest.y1) | - SCO_HV_END(dest.y2 - 1); - /* Enable OSD Scaler */ - priv->viu.osd_sc_ctrl0 = SC_CTRL0_PATH_EN | SC_CTRL0_SEL_OSD1; - } else { - priv->viu.osd_sc_i_wh_m1 = 0; - priv->viu.osd_sc_o_h_start_end = 0; - priv->viu.osd_sc_o_v_start_end = 0; - priv->viu.osd_sc_ctrl0 = 0; - } - - /* In interlaced mode, vertical scaler is always active */ - if (src_h != dst_h) { - priv->viu.osd_sc_v_ctrl0 = - VSC_BANK_LEN(vf_bank_len) | - VSC_TOP_INI_RCV_NUM(vsc_ini_rcv_num) | - VSC_TOP_RPT_L0_NUM(vsc_ini_rpt_p0_num) | - VSC_VERTICAL_SCALER_EN; - - if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) - priv->viu.osd_sc_v_ctrl0 |= - VSC_BOT_INI_RCV_NUM(vsc_bot_rcv_num) | - VSC_BOT_RPT_L0_NUM(vsc_bot_rpt_p0_num) | - VSC_PROG_INTERLACE; - - priv->viu.osd_sc_v_phase_step = SC_PHASE_STEP(vf_phase_step); - priv->viu.osd_sc_v_ini_phase = VSC_INI_PHASE_BOT(bot_ini_phase); - } else { - priv->viu.osd_sc_v_ctrl0 = 0; - priv->viu.osd_sc_v_phase_step = 0; - priv->viu.osd_sc_v_ini_phase = 0; - } - - /* Horizontal scaler is only used if width does not match */ - if (src_w != dst_w) { - priv->viu.osd_sc_h_ctrl0 = - HSC_BANK_LENGTH(hf_bank_len) | - HSC_INI_RCV_NUM0(hsc_ini_rcv_num) | - HSC_RPT_P0_NUM0(hsc_ini_rpt_p0_num) | - HSC_HORIZ_SCALER_EN; - priv->viu.osd_sc_h_phase_step = SC_PHASE_STEP(hf_phase_step); - priv->viu.osd_sc_h_ini_phase = 0; - } else { - priv->viu.osd_sc_h_ctrl0 = 0; - priv->viu.osd_sc_h_phase_step = 0; - priv->viu.osd_sc_h_ini_phase = 0; - } + meson_plane_setup_scaler(priv, new_state, &dest); /* * The format of these registers is (x2 << 16 | x1), @@ -371,6 +379,12 @@ static void meson_plane_atomic_update(struct drm_plane *plane, priv->viu.osd1_blk0_cfg[4] = ((dest.y2 - 1) << 16) | dest.y1; if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) { + int dst_w = new_state->crtc_w; + int dst_h = new_state->crtc_h; + + if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) + dst_h /= 2; + priv->viu.osd_blend_din0_scope_h = ((dest.x2 - 1) << 16) | dest.x1; priv->viu.osd_blend_din0_scope_v = ((dest.y2 - 1) << 16) | dest.y1; priv->viu.osb_blend0_size = dst_h << 16 | dst_w; -- 2.34.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic