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 5DEC1EB64DC for ; Tue, 11 Jul 2023 01:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbjGKBo1 convert rfc822-to-8bit (ORCPT ); Mon, 10 Jul 2023 21:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjGKBo0 (ORCPT ); Mon, 10 Jul 2023 21:44:26 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D151A4; Mon, 10 Jul 2023 18:44:24 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 5D45A24DE03; Tue, 11 Jul 2023 09:44:16 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 11 Jul 2023 09:44:16 +0800 Received: from [192.168.60.133] (180.164.60.184) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 11 Jul 2023 09:44:15 +0800 Message-ID: <560ca37f-74c3-8f36-c118-eb17f92e20b3@starfivetech.com> Date: Tue, 11 Jul 2023 09:44:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 7/9] drm/verisilicon: Add drm plane funcs Content-Language: en-US To: Shengyu Qu , , , , , , CC: David Airlie , Daniel Vetter , "Rob Herring" , Krzysztof Kozlowski , Conor Dooley , "Emil Renner Berthing" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , Sumit Semwal , , Bjorn Andersson , "Heiko Stuebner" , Shawn Guo , Jagan Teki , Chris Morgan , Jack Zhu , Shengyang Chen , Changhuang Liang References: <20230602074043.33872-1-keith.zhao@starfivetech.com> <20230602074043.33872-8-keith.zhao@starfivetech.com> From: Keith Zhao In-Reply-To: Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [180.164.60.184] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX061.cuchost.com (172.16.6.61) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On 2023/7/11 0:46, Shengyu Qu wrote: > Hello Keith, >> + >> +static void vs_plane_atomic_update(struct drm_plane *plane, >> +                   struct drm_atomic_state *state) >> +{ >> +    struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, >> +                                       plane); >> +    unsigned char i, num_planes; >> +    struct drm_framebuffer *fb; >> +    struct vs_plane *vs_plane = to_vs_plane(plane); >> +    //struct drm_plane_state *state = plane->state; >> +    struct vs_crtc *vs_crtc = to_vs_crtc(new_state->crtc); >> +    struct vs_plane_state *plane_state = to_vs_plane_state(new_state); >> +    //struct drm_format_name_buf *name = &plane_state->status.format_name; >> + >> +    if (!new_state->fb || !new_state->crtc) >> +        return; >> + >> +    fb = new_state->fb; >> + >> +    num_planes = vs_get_plane_number(fb); >> + >> +    for (i = 0; i < num_planes; i++) { >> +        struct vs_gem_object *vs_obj; >> + >> +        vs_obj = vs_fb_get_gem_obj(fb, i); >> +        vs_plane->dma_addr[i] = vs_obj->iova + fb->offsets[i]; > > There is a dcache flush operation here in downstream driver. Is that a cache coherence problem? > > Best regards, > > Shengyu > >> +    } >> + >> +    plane_state->status.src = drm_plane_state_src(new_state); >> +    plane_state->status.dest = drm_plane_state_dest(new_state); >> + >> +    vs_plane->funcs->update(vs_crtc->dev, vs_plane, plane, state); >> +} >>yes , You can find that the current situation is very professional. This problem exists at present, but the dma interface is not perfect at now, and the dma_sync_single_for_device interface needs to be implemented later. I will consider repairing this problem in the form of patch