public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Val Packett <val@packett.cool>
To: "Heiko Stübner" <heiko@sntech.de>
Cc: stable@vger.kernel.org, Sandy Huang <hjc@rock-chips.com>,
	Andy Yan <andy.yan@rock-chips.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank on RK3066
Date: Mon, 27 May 2024 19:13:59 -0300	[thread overview]
Message-ID: <BF06ES.TD22854ZPLB92@packett.cool> (raw)
In-Reply-To: <1817371.3VsfAaAtOV@diego>



On Mon, May 27 2024 at 22:43:18 +02:00:00, Heiko Stübner 
<heiko@sntech.de> wrote:
> Hi Val,
> 
> Am Montag, 27. Mai 2024, 09:16:33 CEST schrieb Val Packett:
>>  On the RK3066, there is a bit that must be cleared, otherwise
>>  the picture does not show up
>> on the display (at least for RGB).
>> 
>>  Fixes: f4a6de8 ("drm: rockchip: vop: add rk3066 vop definitions")
>>  Cc: stable@vger.kernel.org
>>  Signed-off-by: Val Packett <val@packett.cool>
>>  ---
>>  v2: doing this on vblank makes more sense; added fixes tag
> 
> can you give a rationale for this please?
> 
> I.e. does this dma-stop bit need to be set on each vblank that happens
> to push this frame to the display somehow?


The only things I'm 100% sure about:

- that bit is called dma_stop in the Android kernel's header;
- without ever setting that bit to 1, it was getting set to 1 by the 
chip itself, as logging the register on flush was showing a 1 in that 
position (it was the only set bit - I guess others aren't readable 
after cfg_done?);
- without clearing it "between" frames, the whole screen is always 
filled with noise, the picture is not visible.

The rest is at least a bit (ha) speculative:

As I understand from what the name implies, the hardware sets it to 
indicate that it has scanned out the frame and is waiting for 
acknowledgment (clearing) to be able to scan out the next frame. I 
guess it's a redundant synchronization mechanism that was removed in 
later iterations of the VOP hardware block.

I've been trying to see if moving where I clear the bit affects the 
sort-of-tearing-but-vertical glitches that sometimes happen, especially 
early on after the system has just booted, but that seems to be 
completely unrelated pixel clock craziness (the Android kernel runs the 
screen at 66 fps, interestingly).

I'm fairly confident that both places are "correct". The reason I'm 
more on the side of vblank now is that it made logical sense to me when 
I thought about it more: acknowledging that the frame has been scanned 
out is a reaction to the frame having been scanned out. It's a 
consequence of *that* that the acknowledgment is required for the next 
frame to be drawn.

Unless we can get the opinion of someone closely familiar with this 
decade-old hardware, we only have this reasoning to go off of :)

~val
> 



  reply	other threads:[~2024-05-27 22:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-19  7:31 [PATCH 1/2] drm/rockchip: vop: clear DMA stop bit on flush on RK3066 Val Packett
2024-05-19  7:31 ` [PATCH 2/2] drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB " Val Packett
2024-05-19  7:59   ` Greg KH
2024-05-19  7:59 ` [PATCH 1/2] drm/rockchip: vop: clear DMA stop bit on flush " Greg KH
2024-05-19  8:38   ` Val Packett
2024-05-19  8:54     ` Greg KH
2024-05-27  7:16       ` [PATCH v2 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank " Val Packett
2024-05-27  7:16         ` [PATCH v2 2/2] drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB " Val Packett
2024-05-27 20:43         ` [PATCH v2 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank " Heiko Stübner
2024-05-27 22:13           ` Val Packett [this message]
2024-05-27 22:51             ` Heiko Stübner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BF06ES.TD22854ZPLB92@packett.cool \
    --to=val@packett.cool \
    --cc=airlied@gmail.com \
    --cc=andy.yan@rock-chips.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox