All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Rob Clark <robdclark@gmail.com>, Jyri Sarha <jsarha@ti.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v4 15/22] drm/tilcdc: Get rid of complex ping-pong mechanism
Date: Thu, 25 Feb 2016 08:55:24 +0200	[thread overview]
Message-ID: <56CEA55C.2000306@ti.com> (raw)
In-Reply-To: <CAF6AEGsw7DdKiidkQ0u5qgtPyaA=Ebt1GgX9t4JRgdpP-bVurw@mail.gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2496 bytes --]



On 24/02/16 22:31, Rob Clark wrote:
> On Wed, Feb 24, 2016 at 11:48 AM, Jyri Sarha <jsarha@ti.com> wrote:
>> From: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>
>> Get rid of complex ping-pong mechanism and replace it with simpler
>> single buffer flipping code.
>>
>> The LCDC HW appears to be designed mainly static framebuffers in
>> mind. There are two modes of operation, either static single buffer,
>> or ping pong double buffering with two static buffers switching back
>> and forth. Luckily the framebuffer start address is fetched only in
>> the beginning of the frame and changing the address after that only
>> takes effect after the next vertical blank. The page flipping code can
>> simply write the address of the new framebuffer and the page is
>> flipped automatically after the next vertical blank. Using the ping
>> pong double buffering makes the flipping code way more complex and it
>> does not provide any benefit, so it is better to switch to single
>> buffer operation.
>>
>> There is still one problem in updating the framebuffer dma address on
>> the fly. There are two registers defining the framebuffer dma area and
>> things may break if the dma address is fetched in while the registers
>> are are being updated.
> 
> Just curious, but does this mean you need to avoid writing the reg's
> too near to vblank?  (I think there are other drivers which do not

Yes.

> have double buffered registers and must do this.. but it's a pain..)
> 
> The ping-pong mode is super-wonky, and would be nice to get rid of..
> but with this scheme I'm not quite sure what happens if a pageflip
> comes in too close to vblank..

It's the same problem with both single and double buffer (ping-pong)
modes. The HW is designed to have a static configuration of one or two
buffers, never changed at runtime. If you change the buffers at runtime,
and change them exactly at the bad time during vblank when the HW starts
using the start and end addresses, you end up with broken display.

In other words, using the double buffering mode only adds extra
complexity to the driver, without any benefit. In fact, with the
double-buffering mode I think it's impossible to make the system
reliable. The driver cannot reliably track which of those two buffers
are currently shown on the screen, so when you do a page flip, you could
flip the wrong buffer.

The next patch adds some safety margin for the "page-flip near vblank"
issue.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-02-25  6:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 16:48 [PATCH v4 00/22] drm/ticdc: Accumulated fixes over the past couple of years Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 01/22] drm/tilcdc: rewrite pixel clock calculation Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 02/22] drm/tilcdc: verify fb pitch Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 03/22] drm/tilcdc: adopt pinctrl support Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 04/22] drm/tilcdc: fix kernel panic on suspend when no hdmi monitor connected Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 05/22] drm/tilcdc: make frame_done interrupt active at all times Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 06/22] drm/tilcdc: disable the lcd controller/dma engine when suspend invoked Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 07/22] drm/tilcdc: Implement dma-buf support for tilcdc Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 08/22] drm/tilcdc: fix build error when !CONFIG_CPU_FREQ Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 09/22] drm/tilcdc: Allocate register storage based on the actual number registers Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 10/22] drm/tilcdc: cleanup runtime PM handling Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 11/22] drm/tilcdc: disable crtc on unload Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 12/22] drm/tilcdc: split reset to a separate function Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 13/22] drm/tilcdc: remove broken error handling Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 14/22] drm/tilcdc: cleanup irq handling Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 15/22] drm/tilcdc: Get rid of complex ping-pong mechanism Jyri Sarha
2016-02-24 20:31   ` Rob Clark
2016-02-25  6:55     ` Tomi Valkeinen [this message]
2016-02-25 13:37       ` Rob Clark
2016-02-24 16:48 ` [PATCH v4 16/22] drm/tilcdc: Do not update the next frame buffer close to vertical blank Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 17/22] drm/tilcdc: Fix interrupt enable/disable code for version 2 tilcdc Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 18/22] drm/tilcdc: Remove the duplicate LCDC_INT_ENABLE_SET_REG in registers[] Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 19/22] drm/tilcdc: Add prints on sync lost and FIFO underrun interrupts Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 20/22] drm/tilcdc: Disable sync lost interrupt if it fires on every frame Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 21/22] drm/tilcdc: Initialize crtc->port Jyri Sarha
2016-02-24 16:48 ` [PATCH v4 22/22] drm/tilcdc: Use devm_kzalloc() and devm_kcalloc() for private data Jyri Sarha
2016-02-25 10:22 ` [PATCH v4 00/22] drm/ticdc: Accumulated fixes over the past couple of years Tomi Valkeinen

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=56CEA55C.2000306@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=robdclark@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.