Message ID | 7b6ffa43307522833103fe29ec6a084b7d621a16.1687423204.git.geert+renesas@glider.be |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4943108vqr; Thu, 22 Jun 2023 02:48:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7FIgk/EMynIpdfj8f6Me6dDtYg42x6BBkgOfD97fh0Uc11XzB+FmegCI4S/dGrq9SVRP1F X-Received: by 2002:a17:90a:d310:b0:25e:b5ba:8bb9 with SMTP id p16-20020a17090ad31000b0025eb5ba8bb9mr13270078pju.5.1687427300065; Thu, 22 Jun 2023 02:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687427300; cv=none; d=google.com; s=arc-20160816; b=z3nPOgPG9nhgVts9I2jSx5HLIctxvnfSGFMxN92SUfZz4lyoss7RA1Ybg1S2pA2D1O jRAUR5XcMCUZs9LIUp2cwHdNxqeb/YJ0rOvywmmnU7gNBQP2lTZdZYaXVy4FV8ZUJ41C 0VMoHM9cWhQOh26cjnKPy6eJcrDCgxdySe11zCE+l8Sxuk5WsYScwnCrPmpQEm6N+o9X h0UqQp6R4llXCoKjGSFIoFL8QCnlHc/xIMzjJRLZti7g8Wjck5dNAkEph2HbgS0TRjZ5 jUB+4h7qkbYEpp8qIA6Qs6aZ6hIP2b5HCFq2titL4JtTiqohvLRxjGzumKsjfgcXO3et 1Gbw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=RQlvKbIAoL2lVHIN6LuQ4WY6vWg2Dre2AR8smly8FFc=; b=0nSgiph5gzdKENHsCDkoYKeFb+tSCpt8SCaEYoVQBOJQ+m6pOlOQXXw3HN3ZgfRLEx UkldGgdiucEf4k8n31ZBtlvBBGiTdoH69Dx9WqjKQ3tr6SS3aTKjLFnLlICVF8l3K4mE cidBI6H90rbf0lgQWlW2vLV6itjaNR5KLL8Qkbf8oSgJL9/ZBhvPAQi0r7KxaE7vIhq8 y30C0kR1lCTUzjkEPw88MH5RQxH3n3ifvHRaMNPsK1x4fIIJAh+gr/LmhSetBJsFckDr 0vImGRrsQ7yknjktfkN5yQVCXZFGquBndtPosPDBYkA04quUBF3RPgBDGIo3BD8FwuRm Z8KQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nh16-20020a17090b365000b00256551043fdsi6277798pjb.72.2023.06.22.02.48.01; Thu, 22 Jun 2023 02:48:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbjFVJbE (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Thu, 22 Jun 2023 05:31:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232330AbjFVJ3t (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Jun 2023 05:29:49 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D61E54EC1 for <linux-kernel@vger.kernel.org>; Thu, 22 Jun 2023 02:22:47 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:991a:a831:ea4b:6058]) by xavier.telenet-ops.be with bizsmtp id C9Nj2A00P1yfRTD019NjEe; Thu, 22 Jun 2023 11:22:44 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qCGWY-000Bx4-28; Thu, 22 Jun 2023 11:22:43 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qCGWZ-003Vxm-LQ; Thu, 22 Jun 2023 11:22:43 +0200 From: Geert Uytterhoeven <geert+renesas@glider.be> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Thomas Zimmermann <tzimmermann@suse.de>, Magnus Damm <magnus.damm@gmail.com> Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert+renesas@glider.be> Subject: [PATCH 28/39] drm: renesas: shmobile: Use drm_crtc_handle_vblank() Date: Thu, 22 Jun 2023 11:21:40 +0200 Message-Id: <7b6ffa43307522833103fe29ec6a084b7d621a16.1687423204.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1687423204.git.geert+renesas@glider.be> References: <cover.1687423204.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769395768792898907?= X-GMAIL-MSGID: =?utf-8?q?1769395768792898907?= |
Series |
drm: renesas: shmobile: Atomic conversion + DT support
|
|
Commit Message
Geert Uytterhoeven
June 22, 2023, 9:21 a.m. UTC
Replace the call to the legacy drm_handle_vblank() function with a call
to the new drm_crtc_handle_vblank() helper.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Geert, Thank you for the patch. On Thu, Jun 22, 2023 at 11:21:40AM +0200, Geert Uytterhoeven wrote: > Replace the call to the legacy drm_handle_vblank() function with a call > to the new drm_crtc_handle_vblank() helper. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > index c98e2bdd888c3274..6eaf2c5a104f451a 100644 > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > @@ -86,7 +86,7 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg) > spin_unlock_irqrestore(&sdev->irq_lock, flags); > > if (status & LDINTR_VES) { > - drm_handle_vblank(dev, 0); > + drm_crtc_handle_vblank(&sdev->crtc.base); > shmob_drm_crtc_finish_page_flip(&sdev->crtc); > } >
Hi, I'm fine with this patch but I I don't see the benefit. This reply is more about my personal question. On 2023/6/22 17:21, Geert Uytterhoeven wrote: > Replace the call to the legacy drm_handle_vblank() function with a call > to the new drm_crtc_handle_vblank() helper. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn> > --- > drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > index c98e2bdd888c3274..6eaf2c5a104f451a 100644 > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > @@ -86,7 +86,7 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg) > spin_unlock_irqrestore(&sdev->irq_lock, flags); > > if (status & LDINTR_VES) { > - drm_handle_vblank(dev, 0); > + drm_crtc_handle_vblank(&sdev->crtc.base); After switching to drm_crtc_handle_vblank(), your driver need another deference to the pointer of 'struct drm_crtc' to get the pointer of 'struct drm_device'; Plus another call to get the index(display pipe) of the CRTC by calling drm_crtc_index(crtc). Consider that shmob-drm support only one display pipe, is it that the switching is less straight forward than the original implement ? ``` /** * drm_crtc_handle_vblank - handle a vblank event * @crtc: where this event occurred * * Drivers should call this routine in their vblank interrupt handlers to * update the vblank counter and send any signals that may be pending. * * This is the native KMS version of drm_handle_vblank(). * * Note that for a given vblank counter value drm_crtc_handle_vblank() * and drm_crtc_vblank_count() or drm_crtc_vblank_count_and_time() * provide a barrier: Any writes done before calling * drm_crtc_handle_vblank() will be visible to callers of the later * functions, if the vblank count is the same or a later one. * * See also &drm_vblank_crtc.count. * * Returns: * True if the event was successfully handled, false on failure. */ bool drm_crtc_handle_vblank(struct drm_crtc *crtc) { return drm_handle_vblank(crtc->dev, drm_crtc_index(crtc)); } ``` Is it that drm_crtc_handle_vblank() function is preferred over drm_handle_vblank() in the future? I'm fine with this question answered. > shmob_drm_crtc_finish_page_flip(&sdev->crtc); > } >
Hi Sui, On Sat, Jun 24, 2023 at 11:33 AM Sui Jingfeng <suijingfeng@loongson.cn> wrote: > I'm fine with this patch but I I don't see the benefit. > > This reply is more about my personal question. > > On 2023/6/22 17:21, Geert Uytterhoeven wrote: > > Replace the call to the legacy drm_handle_vblank() function with a call > > to the new drm_crtc_handle_vblank() helper. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn> > > --- > > drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > > index c98e2bdd888c3274..6eaf2c5a104f451a 100644 > > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > > @@ -86,7 +86,7 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg) > > spin_unlock_irqrestore(&sdev->irq_lock, flags); > > > > if (status & LDINTR_VES) { > > - drm_handle_vblank(dev, 0); > > + drm_crtc_handle_vblank(&sdev->crtc.base); > > > After switching to drm_crtc_handle_vblank(), > > your driver need another deference to the pointer of 'struct drm_crtc' > to get the pointer of 'struct drm_device'; > > Plus another call to get the index(display pipe) of the CRTC by calling > drm_crtc_index(crtc). That is correct. > Consider that shmob-drm support only one display pipe, > > is it that the switching is less straight forward than the original > implement ? > > > ``` > > /** > * drm_crtc_handle_vblank - handle a vblank event > * @crtc: where this event occurred > * > * Drivers should call this routine in their vblank interrupt handlers to > * update the vblank counter and send any signals that may be pending. > * > * This is the native KMS version of drm_handle_vblank(). > * > * Note that for a given vblank counter value drm_crtc_handle_vblank() > * and drm_crtc_vblank_count() or drm_crtc_vblank_count_and_time() > * provide a barrier: Any writes done before calling > * drm_crtc_handle_vblank() will be visible to callers of the later > * functions, if the vblank count is the same or a later one. > * > * See also &drm_vblank_crtc.count. > * > * Returns: > * True if the event was successfully handled, false on failure. > */ > bool drm_crtc_handle_vblank(struct drm_crtc *crtc) > { > return drm_handle_vblank(crtc->dev, drm_crtc_index(crtc)); > } > > ``` > > Is it that drm_crtc_handle_vblank() function is preferred over > drm_handle_vblank() in the future? > > I'm fine with this question answered. I think the native KMS version is preferred over the legacy version, cfr. /** * drm_handle_vblank - handle a vblank event [...] * This is the legacy version of drm_crtc_handle_vblank(). */ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe) Gr{oetje,eeting}s, Geert
diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c index c98e2bdd888c3274..6eaf2c5a104f451a 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c @@ -86,7 +86,7 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg) spin_unlock_irqrestore(&sdev->irq_lock, flags); if (status & LDINTR_VES) { - drm_handle_vblank(dev, 0); + drm_crtc_handle_vblank(&sdev->crtc.base); shmob_drm_crtc_finish_page_flip(&sdev->crtc); }