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 kernel, where "oops I got it wrong because it > > > was too clever" is bad. > > > > > > > > Yes the macro we have is also not nice, but at least it's a screaming > > > > > macro since it's all uppercase, so options are all a bit sucky. Which > > > > > leads me to think we have a bit a https://xkcd.com/927/ situation going > > > > > on. > > > > > > > > > > I think minimally we should have one way to do this. > > > > > > > > Well, there is no one way atm. All you can do is hand roll all the > > > > boilerplate (and likely get it slightly wrong) if you don't want > > > > lock_all. > > > > > > > > The current macros only help with lock_all, and IMO the hidden gotos > > > > are even uglier than a hidden for loop. Fernando already hit a case > > > > where he couldn't use the macros twice due to conflicting goto > > > > labels. With this for loop thing I think it would have just worked(tm). > > > > > > I'm totally ok with repainting the shed, I just don't want some 80s > > > multicolor flash show. > > > > You have a better idea in mind? > > Sorry, I completely forgot this discussion was going on and I just published V4 > of my patch set here: > > https://lore.kernel.org/dri-devel/20211013204846.90026-1-greenfoo@xxxxxx/ > > Please, feel free to let me know (ideally, as a reply to the corresponding i915 > patch from that set) if you rather me not to modify i915 files for now. My request is that we only have one way of doing this drm_modeset lock retry business. So either this one here proposed by Ville, or the one Sean Paul merged. I honestly don't care which color we pick, as long as it's consistent across the board. Please all you, figure this out. Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch