AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Li <sunpeng.li-5C7GfCeVMHo@public.gmane.org>
To: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Cc: harry.wentland-5C7GfCeVMHo@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH xf86-video-amdgpu 00/13] Enabling Color Management - Round 2
Date: Thu, 17 May 2018 17:43:50 -0400	[thread overview]
Message-ID: <62c350eb-8634-5bab-e14e-6d75315e3f56@amd.com> (raw)
In-Reply-To: <b3a7fcde-fe69-5944-1857-c2b43fa068de-otUistvHUpPR7s880joybQ@public.gmane.org>



On 2018-05-16 01:06 PM, Michel Dänzer wrote:
> On 2018-05-03 08:31 PM, sunpeng.li@amd.com wrote:
>>
>> 3. The three color management properties (Degamma LUT, Color Transform Matrix
>>     (CTM), and Gamma LUT) are hard-coded into the DDX driver, to be listed (as
>>     disabled) regardless of whether a CRTC is attached on the output, or whether
>>     the kernel driver supports it.
>>
>>      * If kernel driver does not support color management, the properties will
>>        remain disabled. A `xrandr --set` will then error.
> 
> Is it really useful to expose these properties to clients if the kernel
> doesn't support them?
> 

I left them exposed mainly for simplicity. I can see how it would
confuse a client.

It should be simpler to hide these properties once the color property
IDs are cached somewhere (maybe on the AMDGPUInfo struct?) during
pre_init. It'll provide a easy way to determine if there's kernel
support within other functions.

> 
>> 4. Color properties are now *staged* inside the driver-private CRTC object.
>>     This allows us to *push* the properties into kernel DRM (and consequently
>>     into hardware) whenever there is a need.
>>
>>      * Along with staging and pushing, an *update* function is used to notify
>>        RandR to update the color properties listed on outputs. This can be used
>>        when `xrandr --auto` enables a CRTC on an output, and the output need to
>>        reflect the CRTC's color properties.
> 
> I feel like some of this is a bit more complicated than necessary. This
> is how I'd envision it working:
> 
> In drmmode_crtc_init, query the properties from the kernel, more or less
> as done in this series.
> 
> In drmmode_output_create_resources, create the output properties (or
> not, per above) based on output->crtc, or if that is NULL, based on
> xf86_config->crtc[0].

What are the contents of xf86_config->crtc[0] initialized to? I'm not
too familiar with how that's setup. Does it stay the same throughout?

> 
> In drmmode_output_get_property, if output->crtc != NULL, update the
> RandR property value from it, otherwise set it to a dummy value.
> 

Feeling kind of stupid that I skipped over this :) I assumed it wasn't
useful since it's currently a no-op. This should eliminate the need for
the cm_update function, assuming it's called every time a client
requests for the properties.

This should work even if one CRTC is attached to multiple outputs,
correct? Since it would first update the RandR property with the
attached CRTC before returning it.

> In drmmode_output_set_property, if output->crtc != NULL, update its
> property value, otherwise do nothing.
> 
> Push the CRTC's property values to the kernel in
> drmmode_crtc_gamma_do_set and drmmode_output_set_property (or maybe just
> call the former from the latter when one of these properties are changed).
> 
> Is that feasible?
> 

Sounds feasible, and much better actually. Assuming it also works well
with 1 crtc on >1 outputs, and I don't see why it wouldn't. Thanks for
the pointers.

> 
> If patch 13 still exists after this, can you squash it into the earlier
> patches adding the code?
> 
> 
>> * When using libXrandr to set the CTM property, 16bit format is used. Ideally
>>    we should use 64bit format, since the CTM consists of 9x64bit fixed-point
>>    values. However, it isn't recognized by XRRChangeOutputProperty as a valid
>>    format. 32 bit could work, since the CTM values are S31.32 fixed-point.
>>    However, using this format corrupts the data once it gets to xserver. On
>>    first glance, it may be the cast to long within XRRChangeOutputProperty, in
>>    addition to compiling 64 bit (shouldn't it use int32_t instead?).
> 
> For historical reasons, Xlib uses long for 32-bit values, so you have to
> pad each 32-bit value to a long. XCB shouldn't be affected by this.
> 

Noted.

Leo

> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-05-17 21:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 18:31 [PATCH xf86-video-amdgpu 00/13] Enabling Color Management - Round 2 sunpeng.li-5C7GfCeVMHo
     [not found] ` <1525372315-28462-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 01/13] Add color management properties to driver-private CRTC object sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1525372315-28462-2-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-16 17:07       ` Michel Dänzer
     [not found]         ` <0dda7c80-2bdc-52a7-8dcf-ad5a7f6e9346-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-17 21:43           ` Leo Li
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 02/13] Push color properties to kernel DRM on CRTC init sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1525372315-28462-3-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-16 17:08       ` Michel Dänzer
     [not found]         ` <a2b8ff58-edcc-bb95-f630-1926b1a8874b-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-17 21:43           ` Leo Li
     [not found]             ` <db641905-9dea-015d-24d2-fa25d136abfc-5C7GfCeVMHo@public.gmane.org>
2018-05-18  7:52               ` Michel Dänzer
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 03/13] List disabled color properties on RandR outputs without a CRTC sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1525372315-28462-4-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-16 17:09       ` Michel Dänzer
     [not found]         ` <62d1f2e3-d271-658a-7bf4-88b41b080266-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-17 21:43           ` Leo Li
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 04/13] Use CRTC's color properties if output has a CRTC attached sunpeng.li-5C7GfCeVMHo
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 05/13] Enable setting of color properties though RandR sunpeng.li-5C7GfCeVMHo
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 06/13] Compose non-legacy with legacy gamma LUT before pushing to kernel DRM sunpeng.li-5C7GfCeVMHo
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 07/13] Also compose LUT when setting legacy gamma sunpeng.li-5C7GfCeVMHo
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 08/13] Set driver-private CRTC's dpms mode on disable sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1525372315-28462-9-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-16 17:09       ` Michel Dänzer
     [not found]         ` <12553d4f-c171-112b-bad6-6f53d47aa8e3-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-17 21:43           ` Leo Li
     [not found]             ` <6cf602ed-b43d-d446-74a0-a39d35042f5a-5C7GfCeVMHo@public.gmane.org>
2018-05-18 10:35               ` Michel Dänzer
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 09/13] Move drmmode_do_crtc_dpms sunpeng.li-5C7GfCeVMHo
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 10/13] Push staged color properties when DPMS state toggles On sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1525372315-28462-11-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-16 17:10       ` Michel Dänzer
     [not found]         ` <23a9fe2a-df1c-6ecb-b60e-bdcb22d8179c-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-17 21:44           ` Leo Li
     [not found]             ` <f323d1de-d517-805f-d373-a7310ec6496c-5C7GfCeVMHo@public.gmane.org>
2018-05-18  8:01               ` Michel Dänzer
     [not found]                 ` <6500b993-624a-45aa-6310-958ca8c1f21b-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-24 19:01                   ` Leo Li
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 11/13] Push staged color properties on output detect sunpeng.li-5C7GfCeVMHo
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 12/13] Update color properties on modeset major sunpeng.li-5C7GfCeVMHo
2018-05-03 18:31   ` [PATCH xf86-video-amdgpu 13/13] Refactor pushing color management properties into a function sunpeng.li-5C7GfCeVMHo
2018-05-14 13:38   ` [PATCH xf86-video-amdgpu 00/13] Enabling Color Management - Round 2 Leo Li
2018-05-14 14:17   ` Michel Dänzer
2018-05-16 17:06   ` Michel Dänzer
     [not found]     ` <b3a7fcde-fe69-5944-1857-c2b43fa068de-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-17 21:43       ` Leo Li [this message]
     [not found]         ` <62c350eb-8634-5bab-e14e-6d75315e3f56-5C7GfCeVMHo@public.gmane.org>
2018-05-18  8:10           ` Michel Dänzer
     [not found]             ` <8fe3423f-8d9e-120c-32e1-7a6a7fd81606-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-24 20:29               ` Leo Li
     [not found]                 ` <7c183caf-d2de-cf56-ed31-7922b24d3a8e-5C7GfCeVMHo@public.gmane.org>
2018-05-25  7:51                   ` Michel Dänzer

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=62c350eb-8634-5bab-e14e-6d75315e3f56@amd.com \
    --to=sunpeng.li-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=harry.wentland-5C7GfCeVMHo@public.gmane.org \
    --cc=michel-otUistvHUpPR7s880joybQ@public.gmane.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