Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
> > > diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c > > > b/drivers/gpu/drm/vkms/vkms_crtc.c > > > index a40295c18b48..780681ea77e4 100644 > > > --- a/drivers/gpu/drm/vkms/vkms_crtc.c > > > +++ b/drivers/gpu/drm/vkms/vkms_crtc.c > > > @@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_cr

[PATCH v2 0/2] drm/ttm: Add an option to report graphics memory OOM

2024-10-03 Thread Thomas Hellström
Some graphics APIs differentiate between out-of-graphics-memory and out-of-host-memory (system memory). Add a device init flag to have -ENOSPC propagated from the resource managers instead of being converted to -ENOMEM, to aid driver stacks in determining what error code to return or whether correc

Re: [PATCH v2 1/2] drm/ttm: Change ttm_device_init to use a struct instead of multiple bools

2024-10-03 Thread Thomas Hellström
On Wed, 2024-10-02 at 14:45 +0200, Christian König wrote: > Am 02.10.24 um 14:24 schrieb Thomas Hellström: > > The ttm_device_init funcition uses multiple bool arguments. That > > means > > readability in the caller becomes poor, and all callers need to > > change if > > yet another bool is added.

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
Le 02/10/24 - 21:22, Ville Syrjala a écrit : > From: Ville Syrjälä > > Atomic drivers shouldn't be using the legacy state stored > directly under drm_crtc. Move that junk into a 'legacy' sub > structure to highlight the offenders, of which there are > quite a few unfortunately. Hi, Do we need t

Re: [PATCH v2 1/2] drm/ttm: Change ttm_device_init to use a struct instead of multiple bools

2024-10-03 Thread Zack Rusin
On Wed, Oct 2, 2024 at 8:24 AM Thomas Hellström wrote: > > The ttm_device_init funcition uses multiple bool arguments. That means > readability in the caller becomes poor, and all callers need to change if > yet another bool is added. > > Instead use a struct with multiple single-bit flags. This a

[PATCH v2 1/2] drm/ttm: Change ttm_device_init to use a struct instead of multiple bools

2024-10-03 Thread Thomas Hellström
The ttm_device_init funcition uses multiple bool arguments. That means readability in the caller becomes poor, and all callers need to change if yet another bool is added. Instead use a struct with multiple single-bit flags. This addresses both problems. Prefer it over using defines or enums with

[PATCH v2 2/2] drm/ttm: Add a device flag to propagate -ENOSPC on OOM

2024-10-03 Thread Thomas Hellström
Some graphics APIs differentiate between out-of-graphics-memory and out-of-host-memory (system memory). Add a device init flag to have -ENOSPC propagated from the resource managers instead of being converted to -ENOMEM, to aid driver stacks in determining what error code to return or whether correc

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
ommit_modeset_disables`, which call > > `drm_atomic_helper_calc_timestamping_constants` which call > > `drm_calc_timestamping_constants` for every CRTC. > > Slightly odd place for it, but I think that's just because it was > originally part of drm_atomic_helper_updat

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Ville Syrjälä
On Thu, Oct 03, 2024 at 05:07:35PM +0200, Louis Chauvet wrote: > > > > > diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c > > > > b/drivers/gpu/drm/vkms/vkms_crtc.c > > > > index a40295c18b48..780681ea77e4 100644 > > > > --- a/drivers/gpu/drm/vkms/vkms_crtc.c > > > > +++ b/drivers/gpu/drm/vkms/vkms_

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Ville Syrjälä
On Thu, Oct 03, 2024 at 02:38:35PM +0200, Louis Chauvet wrote: > Le 02/10/24 - 21:22, Ville Syrjala a écrit : > > From: Ville Syrjälä > > > > Atomic drivers shouldn't be using the legacy state stored > > directly under drm_crtc. Move that junk into a 'legacy' sub > > structure to highlight the of