backend-drm: Clear out the the fb handles

This is purely cosmetic but we do this in other parts as well, when
releasing the GEM handles. Use the macro for no of planes as well when
going over them.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2025-02-03 14:16:07 +02:00
parent 3d5772fb06
commit 94dd926b99

View file

@ -384,9 +384,10 @@ drm_fb_destroy_dmabuf(struct drm_fb *fb)
* If we imported the dmabuf into a scanout device, we are responsible
* for closing the GEM handle.
*/
for (i = 0; i < 4; i++)
if (fb->scanout_device && fb->handles[i] != 0)
for (i = 0; i < MAX_DMABUF_PLANES; i++) {
if (fb->scanout_device && fb->handles[i] != 0) {
gem_handle_put(fb->scanout_device, fb->handles[i]);
fb->handles[i] = 0;
}
}