Re: Why does Java (XWayland / Weston) resize a Window to 1x1 pixel when HDMI is unplugged (and does not resize back when HDMI is plugged)

2023-06-09 Thread Pekka Paalanen
On Thu, 8 Jun 2023 19:13:39 +0200
Martin Petzold  wrote:

> Am 08.06.23 um 14:45 schrieb Martin Petzold:
> > Hi Pekka,
> >
> > Am 08.06.23 um 14:37 schrieb Pekka Paalanen:  
> >> On Thu, 8 Jun 2023 14:21:31 +0200
> >> Martin Petzold  wrote:
> >>  
> >>> I am fixed to this Kernel, will be hard to get Weston 12 running.  
> >> Hi,
> >>
> >> why would you say that? Did you try? Or do you mean that building
> >> Weston and a few dependencies (not kernel, not Mesa) from source is too
> >> much?  
> >
> > We are compiling our own kernel version for embedded i.MX8. Also the 
> > Debian is our custom build and we are able to adjust to other packages 
> > or compile parts. We know how to do that. However, we are fixed to 
> > 5.10.52 for several reasons. And I need to cross-compile Weston then, 
> > which is maybe challenging?
> >
> > I can try to compile on device and test. But which dependencies also 
> > need to be compiled then? XWayland? Wayland? Libraries?
> >  
> >>
> >> FWIW, when you unplug the last display, leaving none, then there is no
> >> display area. Weston does not pretend a fake display, there just is
> >> none. I don't know how Xwayland reacts to that, and how that Java suite
> >> reacts to what Xwayland does. Those would be something to look into, if
> >> Weston upgrade does not help.  
> > Yes, it must be XWayland. Maybe there is any configuration to fix it?  
> >>
> >> Xwayland might have a fake something when all real displays are gone,
> >> and maybe nothing then re-associates your app window from the fake
> >> monitor to a real monitor once a real monitor appears again? No idea.
> >>
> >> Maybe check what xrandr says while you have no displays connected? That
> >> might give a clue, assuming the Java stack listens to RandR.
> >>  
> >  
> Interesting: It changes from XWAYLAND0 to XWAYLAND1 to XWAYLAND2 and 
> also if I have it UNPLUGGED the screen is there.
> 
> HDMI PLUGGED (on boot)
> 
> xrandr --current
> Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
> XWAYLAND0 connected 1920x1080+0+0 (normal left inverted right x axis y 
> axis) 1110mm x 620mm
>     1920x1080 59.96*+
> 
> HDMI UNPLUGGED
> 
> xrandr --current
> Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
> XWAYLAND1 connected 1920x1080+0+0 (normal left inverted right x axis y 
> axis) 1150mm x 650mm
>     1920x1080 59.96*+
> 
> HDMI RE-PLUGGED
> 
> xrandr --current
> Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
> XWAYLAND2 connected 1920x1080+0+0 (normal left inverted right x axis y 
> axis) 1110mm x 620mm
>     1920x1080 59.96*+

This is interesting, but does not look like a problem in itself: the
desktop size remains reasonable at all times, even when nothing is
connected.

If upgrading to more recent upstream versions does not help, then there
are two possibilities:
- Java stack reacts strangely to the above
- Weston's XWM resizes the window strangely

We could at least confirm the Weston behaviour then.


Thanks,
pq


pgp9GchdjXzCT.pgp
Description: OpenPGP digital signature


Re: Why does Java (XWayland / Weston) resize a Window to 1x1 pixel when HDMI is unplugged (and does not resize back when HDMI is plugged)

2023-06-09 Thread Michel Dänzer
On 6/8/23 19:13, Martin Petzold wrote:
> Am 08.06.23 um 14:45 schrieb Martin Petzold:
>> Am 08.06.23 um 14:37 schrieb Pekka Paalanen:
>>>
>>> FWIW, when you unplug the last display, leaving none, then there is no
>>> display area. Weston does not pretend a fake display, there just is
>>> none. I don't know how Xwayland reacts to that, and how that Java suite
>>> reacts to what Xwayland does. Those would be something to look into, if
>>> Weston upgrade does not help.
>> Yes, it must be XWayland. Maybe there is any configuration to fix it?
>>>
>>> Xwayland might have a fake something when all real displays are gone,
>>> and maybe nothing then re-associates your app window from the fake
>>> monitor to a real monitor once a real monitor appears again? No idea.
>>>
>>> Maybe check what xrandr says while you have no displays connected? That
>>> might give a clue, assuming the Java stack listens to RandR.
>>>
>>
> Interesting: It changes from XWAYLAND0 to XWAYLAND1 to XWAYLAND2 [...]

FWIW, the RandR output name should be stable as of Xwayland 23.1, assuming 
Weston reports a stable output name via the xdg_output_v1 protocol.


-- 
Earthling Michel Dänzer|  https://redhat.com
Libre software enthusiast  | Mesa and Xwayland developer



Re: [RFC] Plane color pipeline KMS uAPI

2023-06-09 Thread Simon Ser
Hi Christopher,

On Friday, June 9th, 2023 at 17:52, Christopher Braga  
wrote:

> > The new COLOROP objects also expose a number of KMS properties. Each has a
> > type, a reference to the next COLOROP object in the linked list, and other
> > type-specific properties. Here is an example for a 1D LUT operation:
> >
> >  Color operation 42
> >  ├─ "type": enum {Bypass, 1D curve} = 1D curve
> >  ├─ "1d_curve_type": enum {LUT, sRGB, PQ, BT.709, HLG, …} = LUT
> The options sRGB / PQ / BT.709 / HLG would select hard-coded 1D
> curves? Will different hardware be allowed to expose a subset of these
> enum values?

Yes. Only hardcoded LUTs supported by the HW are exposed as enum entries.

> >  ├─ "lut_size": immutable range = 4096
> >  ├─ "lut_data": blob
> >  └─ "next": immutable color operation ID = 43
> >
> Some hardware has per channel 1D LUT values, while others use the same
> LUT for all channels.  We will definitely need to expose this in the
> UAPI in some form.

Hm, I was assuming per-channel 1D LUTs here, just like the existing GAMMA_LUT/
DEGAMMA_LUT properties work. If some hardware can't support that, it'll need
to get exposed as another color operation block.

> > To configure this hardware block, user-space can fill a KMS blob with
> > 4096 u32
> > entries, then set "lut_data" to the blob ID. Other color operation types
> > might
> > have different properties.
> >
> The bit-depth of the LUT is an important piece of information we should
> include by default. Are we assuming that the DRM driver will always
> reduce the input values to the resolution supported by the pipeline?
> This could result in differences between the hardware behavior
> and the shader behavior.
> 
> Additionally, some pipelines are floating point while others are fixed.
> How would user space know if it needs to pack 32 bit integer values vs
> 32 bit float values?

Again, I'm deferring to the existing GAMMA_LUT/DEGAMMA_LUT. These use a common
definition of LUT blob (u16 elements) and it's up to the driver to convert.

Using a very precise format for the uAPI has the nice property of making the
uAPI much simpler to use. User-space sends high precision data and it's up to
drivers to map that to whatever the hardware accepts.

Exposing the actual hardware precision is something we've talked about during
the hackfest. It'll probably be useful to some extent, but will require some
discussion to figure out how to design the uAPI. Maybe a simple property is
enough, maybe not (e.g. fully describing the precision of segmented LUTs would
probably be trickier).

I'd rather keep things simple for the first pass, we can always add more
properties for bit depth etc later on.

> > Here is another example with a 3D LUT:
> >
> >  Color operation 42
> >  ├─ "type": enum {Bypass, 3D LUT} = 3D LUT
> >  ├─ "lut_size": immutable range = 33
> >  ├─ "lut_data": blob
> >  └─ "next": immutable color operation ID = 43
> >
> We are going to need to expose the packing order here to avoid any
> programming uncertainty. I don't think we can safely assume all hardware
> is equivalent.

The driver can easily change the layout of the matrix and do any conversion
necessary when programming the hardware. We do need to document what layout is
used in the uAPI for sure.

> > And one last example with a matrix:
> >
> >  Color operation 42
> >  ├─ "type": enum {Bypass, Matrix} = Matrix
> >  ├─ "matrix_data": blob
> >  └─ "next": immutable color operation ID = 43
> >
> It is unclear to me what the default sizing of this matrix is. Any
> objections to exposing these details with an additional property?

The existing CTM property uses 9 uint64 (S31.32) values. Is there a case where
that wouldn't be enough?

> Dithering logic exists in some pipelines. I think we need a plan to
> expose that here as well.

Hm, I'm not too familiar with dithering. Do you think it would make sense to
expose as an additional colorop block? Do you think it would have more
consequences on the design?

I want to re-iterate that we don't need to ship all features from day 1. We
just need to come up with a uAPI design on which new features can be built on.

> > [Simon note: an alternative would be to split the color pipeline into
> > two, by
> > having two plane properties ("color_pipeline_pre_scale" and
> > "color_pipeline_post_scale") instead of a single one. This would be
> > similar to
> > the way we want to split pre-blending and post-blending. This could be less
> > expressive for drivers, there may be hardware where there are dependencies
> > between the pre- and post-scaling pipeline?]
> >
> As others have noted, breaking up the pipeline with immutable blocks
> makes the most sense to me here. This way we don't have to predict ahead
> of time every type of block that maybe affected by pipeline ordering.
> Splitting the pipeline into two properties now means future
> logical splits would require introduction of further plane properti