mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: linux-kernel@vger.kernel.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH v4 03/14] drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths
Date: Wed, 12 Jul 2017 09:47:27 +0200	[thread overview]
Message-ID: <45e64660-b903-6f2b-42f9-55a42e478810@axentia.se> (raw)
In-Reply-To: <20170712070352.gyjgnlpngocshuiw@phenom.ffwll.local>

On 2017-07-12 09:03, Daniel Vetter wrote:
> On Tue, Jul 11, 2017 at 02:12:26PM +0200, Peter Rosin wrote:
>> On 2017-07-11 10:10, Daniel Vetter wrote:
>>> Tiny nit you might want to improve (since you need to respin for my naming
>>> bikeshed of the property_replace_blob function anyway): Properties are
>>> refcounting and invariant, which means you can just create the property
>>> once, and then use it for all the CRTC. Slightly cleaner code.
>>
>> Yes, I thought about that, but ended up not. The reason is that as far
>> as I could tell, all involved crtc need not have the same original
>> gamma_lut. Sure, if all crtc have the same history, that should be the
>> case, but isn't it possible to tie things together one way first and
>> set some clut, then "rewire" things so that the crtc no longer have the
>> same history?
>>
>> But if you in the light of that still think it's wise to set the same
>> clut for all crtc I will factor that part out of the loop.
> 
> Blob properties are invariant, if you want to change a lut you _have_ to
> create a new blob property. They're also reference-counted, which means
> users of a blob property can come&go as they wish, it will only get freed
> when the last one is released.
> 
> So even when you change the lut of 1 CRTC the other CRTCs will be able to
> keep using the existing lut blob property unchanged. That's the beauty of
> having refcounted objects with invariant data over their lifetime, makes a
> lot of things a lot simpler. drm_framebuffer work the same (only their
> metadata is invariant, the data of the actual backing storage can change
> ofc, but not where that backing storage is). Allows you to do simple
> pointer comparison of objects to check whether their equal or something
> has changed.
> 
> tldr; sharing blobs is perfectly safe and how this is designed to work.

Yes, I get that, but that wasn't my problem. At all.

Say that you have a driver with two crtc, A and B. Then this happens:

1. A gets a clut with, say, only various red colors.
2. B gets a different clut with various green colors.
3. Someone ties things up so that one fbdev is used on both A and B.
   I don't know if this is possible, but if it is, the two crtc now
   have different cluts.
4. Via fbdev, only part of the clut is updated for this A/B combo.

If A and B starts sharing clut in 4, the part that is not updated is
clobbered for either crtc A or B.
  
(updating only part of the clut is only possible with fbdev, AFAICT)

Yes, it's a fringe thing to cater to...

Cheers,
Peter

  reply	other threads:[~2017-07-12  7:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 12:20 [PATCH v4 00/14] improve the fb_setcmap helper Peter Rosin
2017-07-06 12:20 ` [PATCH v4 01/14] drm/atomic: export drm_atomic_replace_property_blob Peter Rosin
2017-07-11  8:01   ` Daniel Vetter
2017-07-11 12:06     ` Peter Rosin
2017-07-06 12:20 ` [PATCH v4 02/14] drm/atomic-helper: update lut props directly in ..._legacy_gamma_set Peter Rosin
2017-07-11  8:02   ` Daniel Vetter
2017-07-11 13:08     ` Peter Rosin
2017-07-06 12:20 ` [PATCH v4 03/14] drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths Peter Rosin
2017-07-11  8:10   ` Daniel Vetter
2017-07-11 12:12     ` Peter Rosin
2017-07-12  7:03       ` Daniel Vetter
2017-07-12  7:47         ` Peter Rosin [this message]
2017-07-13 12:42           ` Daniel Vetter
2017-07-06 12:20 ` [PATCH v4 04/14] drm: amd: remove dead code and pointless local lut storage Peter Rosin
2017-07-06 12:20 ` [PATCH v4 05/14] drm: armada: remove dead empty functions Peter Rosin
2017-07-06 12:20 ` [PATCH v4 06/14] drm: ast: remove dead code and pointless local lut storage Peter Rosin
2017-07-06 12:20 ` [PATCH v4 07/14] drm: cirrus: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 08/14] drm: gma500: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 09/14] drm: i915: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 10/14] drm: mgag200: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 11/14] drm: nouveau: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 12/14] drm: radeon: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 13/14] drm: stm: " Peter Rosin
2017-07-06 12:20 ` [PATCH v4 14/14] drm: remove unused and redundant callbacks Peter Rosin
2017-07-11  8:13   ` Daniel Vetter
2017-07-11 12:13     ` Peter Rosin

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=45e64660-b903-6f2b-42f9-55a42e478810@axentia.se \
    --to=peda@axentia.se \
    --cc=boris.brezillon@free-electrons.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®