Short summary of fixes pull:

* nouveau: Lockdep workaround
  * fbdev/g364fb: Build fix
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAmT/IXUACgkQaA3BHVML
 eiPE5AgAozyuIXbYUELKqwICWi8DXLOXH+OTuUHJgbtKfuRclyuJ29xpnP7CBhpJ
 DIUIYvkz6jHW5gR5Sqm2+vwmywG5bgTYliRXONl9GH+Hwwc77NlU8N1397uce+Sb
 CVKHypPeiMPs8K4UAy4wQ707pr2ZrErGHi8EEL1Y2w/i+5lbkghG3g5Mnihm3SDp
 eF1nnfruhXbKny5Lfk0mbqTf3TSQ57VenC+vxYHUHi3sWBk0PWqjdoMpj0WpUrK0
 TqfGcrQXDKuBDlOhnoZdCSarWXN0UlJuHtiA8KHedZZ0gZ+4ixDm8SRYf3ItizJg
 Hliau+72RBfeWsI6Tt1K/FL8DPO5AQ==
 =MBnp
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-fixes-2023-09-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

Short summary of fixes pull:

 * nouveau: Lockdep workaround
 * fbdev/g364fb: Build fix

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230911141915.GA983@linux-uq9g
This commit is contained in:
Daniel Vetter 2023-09-11 16:23:42 +02:00
commit afaf2b3802
2 changed files with 32 additions and 5 deletions

View File

@ -56,7 +56,7 @@ static void drm_exec_unlock_all(struct drm_exec *exec)
struct drm_gem_object *obj;
unsigned long index;
drm_exec_for_each_locked_object(exec, index, obj) {
drm_exec_for_each_locked_object_reverse(exec, index, obj) {
dma_resv_unlock(obj->resv);
drm_gem_object_put(obj);
}

View File

@ -51,6 +51,20 @@ struct drm_exec {
struct drm_gem_object *prelocked;
};
/**
* drm_exec_obj() - Return the object for a give drm_exec index
* @exec: Pointer to the drm_exec context
* @index: The index.
*
* Return: Pointer to the locked object corresponding to @index if
* index is within the number of locked objects. NULL otherwise.
*/
static inline struct drm_gem_object *
drm_exec_obj(struct drm_exec *exec, unsigned long index)
{
return index < exec->num_objects ? exec->objects[index] : NULL;
}
/**
* drm_exec_for_each_locked_object - iterate over all the locked objects
* @exec: drm_exec object
@ -59,10 +73,23 @@ struct drm_exec {
*
* Iterate over all the locked GEM objects inside the drm_exec object.
*/
#define drm_exec_for_each_locked_object(exec, index, obj) \
for (index = 0, obj = (exec)->objects[0]; \
index < (exec)->num_objects; \
++index, obj = (exec)->objects[index])
#define drm_exec_for_each_locked_object(exec, index, obj) \
for ((index) = 0; ((obj) = drm_exec_obj(exec, index)); ++(index))
/**
* drm_exec_for_each_locked_object_reverse - iterate over all the locked
* objects in reverse locking order
* @exec: drm_exec object
* @index: unsigned long index for the iteration
* @obj: the current GEM object
*
* Iterate over all the locked GEM objects inside the drm_exec object in
* reverse locking order. Note that @index may go below zero and wrap,
* but that will be caught by drm_exec_obj(), returning a NULL object.
*/
#define drm_exec_for_each_locked_object_reverse(exec, index, obj) \
for ((index) = (exec)->num_objects - 1; \
((obj) = drm_exec_obj(exec, index)); --(index))
/**
* drm_exec_until_all_locked - loop until all GEM objects are locked