Re: [Intel-gfx] [PATCH 1/4] drm: Introduce drm_modeset_lock_ctx_retry()

2021-10-14 Thread Daniel Vetter
On Wed, Oct 13, 2021 at 11:00:35PM +0200, Fernando Ramos wrote: > On 21/10/13 03:06PM, Ville Syrjälä wrote: > > > And yes C is dangerous, but also C is verbose. I think one lesson from igt > > > is that too many magic block constructs are bad, it's just not how C > > > works. Definitely not in the

Re: [Intel-gfx] [PATCH 1/4] drm: Introduce drm_modeset_lock_ctx_retry()

2021-10-13 Thread Fernando Ramos
On 21/10/13 03:06PM, Ville Syrjälä wrote: > > And yes C is dangerous, but also C is verbose. I think one lesson from igt > > is that too many magic block constructs are bad, it's just not how C > > works. Definitely not in the kernel, where "oops I got it wrong because it > > was too clever" is

Re: [Intel-gfx] [PATCH 1/4] drm: Introduce drm_modeset_lock_ctx_retry()

2021-10-13 Thread Ville Syrjälä
On Wed, Oct 13, 2021 at 01:59:47PM +0200, Daniel Vetter wrote: > On Mon, Oct 04, 2021 at 02:15:51PM +0300, Ville Syrjälä wrote: > > On Tue, Jul 20, 2021 at 03:44:49PM +0200, Daniel Vetter wrote: > > > On Thu, Jul 15, 2021 at 09:49:51PM +0300, Ville Syrjala wrote: > > > > From: Ville Syrjälä > > >

Re: [Intel-gfx] [PATCH 1/4] drm: Introduce drm_modeset_lock_ctx_retry()

2021-10-13 Thread Daniel Vetter
On Mon, Oct 04, 2021 at 02:15:51PM +0300, Ville Syrjälä wrote: > On Tue, Jul 20, 2021 at 03:44:49PM +0200, Daniel Vetter wrote: > > On Thu, Jul 15, 2021 at 09:49:51PM +0300, Ville Syrjala wrote: > > > From: Ville Syrjälä > > > > > > Quite a few places are hand rolling the modeset lock backoff

Re: [Intel-gfx] [PATCH 1/4] drm: Introduce drm_modeset_lock_ctx_retry()

2021-10-04 Thread Ville Syrjälä
On Tue, Jul 20, 2021 at 03:44:49PM +0200, Daniel Vetter wrote: > On Thu, Jul 15, 2021 at 09:49:51PM +0300, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > Quite a few places are hand rolling the modeset lock backoff dance. > > Let's suck that into a helper macro that is easier to use

Re: [Intel-gfx] [PATCH 1/4] drm: Introduce drm_modeset_lock_ctx_retry()

2021-07-20 Thread Daniel Vetter
On Thu, Jul 15, 2021 at 09:49:51PM +0300, Ville Syrjala wrote: > From: Ville Syrjälä > > Quite a few places are hand rolling the modeset lock backoff dance. > Let's suck that into a helper macro that is easier to use without > forgetting some steps. > > The main downside is probably that the

[Intel-gfx] [PATCH 1/4] drm: Introduce drm_modeset_lock_ctx_retry()

2021-07-15 Thread Ville Syrjala
From: Ville Syrjälä Quite a few places are hand rolling the modeset lock backoff dance. Let's suck that into a helper macro that is easier to use without forgetting some steps. The main downside is probably that the implementation of drm_with_modeset_lock_ctx() is a bit harder to read than a