Hi all,

On Wed, Sep 30, 2026 at 2:48 AM Thomas Zimmermann wrote:
> Those buffers should have been allocated on the v3d side.

Ah! Now I think I see what's happening. Some context on where I'm
coming from, since I think I explained it badly.

My program opens the panel's card and lets Mesa handle the buffers.

    fd   = open("/dev/dri/card2", O_RDWR);        /* ssd130x */
    gbm  = gbm_create_device(fd);
    surf = gbm_surface_create(gbm, 128, 32, GBM_FORMAT_XRGB8888,
                              GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
    bo = gbm_surface_lock_front_buffer(surf);

On a Pi 4/5 Mesa hands me dumb buffers from ssd130x with v3d drawing
into them. On a Pi 0-3 it goes the other way, the GPU makes the
buffers and ssd130x imports them, and that works fine.

Reading this thread convinced me that what I was doing was wrong for
my use case, and that my program should own the buffers itself. So now
it does the producer-consumer thing:

    gpu = gbm_create_device(open("/dev/dri/renderD128", O_RDWR)); /* v3d */
    bo  = gbm_bo_create(gpu, 128, 32, GBM_FORMAT_XRGB8888,
                        GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR);
    drmPrimeFDToHandle(fd, gbm_bo_get_fd(bo), &handle);
    /* AddFB2 with that handle, draw into bo through an EGLImage, page flip */

That's clean on a stock kernel and stock Mesa.

By the way, I found one other report that looks like the same thing,
from March 2024: https://github.com/notro/gud/issues/22

Thanks,
Fabio/

Reply via email to