Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Debug failure to call create_buffer_object() on Intel iGPU #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

strohel
Copy link
Member

@strohel strohel commented Dec 15, 2023

Just some WIP debugging to see if I can get just-gl running on Intel iGPU with i915
driver.

Relates to #4.

Currently I'm getting:

prelude
[src/main.rs:89] gpu.get_driver().expect("Failed to get GPU driver info") = Driver {
    name: "i915",
    date: "20201103",
    desc: "Intel Graphics",
}
[src/main.rs:90] gpu.get_bus_id().expect("Failed to get GPU bus ID") = ""
Connectors:
        eDP-1, Connected=✅
        HDMI-A-1, Connected=❌
        DP-1, Connected=❌
        DP-2, Connected=❌
        DP-3, Connected=❌
        DP-4, Connected=❌
Using connector: eDP-1
Using mode: Mode { name: "1920x1200", clock: 156100, size: (1920, 1200), hsync: (1936, 1952, 2104), vsync: (1203, 1217, 1236), hskew: 0, vscan: 0, vrefresh: 60, mode_type: PREFERRED | DRIVER }
[src/main.rs:125] encoder = Info {
    handle: encoder::Handle(
        235,
    ),
    enc_type: TMDS,
    crtc: Some(
        crtc::Handle(
            80,
        ),
    ),
    pos_crtcs: 15,
    pos_clones: 1,
}
[src/main.rs:132] crtc = Info {
    handle: crtc::Handle(
        80,
    ),
    position: (
        0,
        0,
    ),
    mode: Some(
        Mode {
            name: "1920x1200",
            clock: 156100,
            size: (
                1920,
                1200,
            ),
            hsync: (
                1936,
                1952,
                2104,
            ),
            vsync: (
                1203,
                1217,
                1236,
            ),
            hskew: 0,
            vscan: 0,
            vrefresh: 60,
            mode_type: PREFERRED | DRIVER,
        },
    ),
    fb: Some(
        framebuffer::Handle(
            289,
        ),
    ),
    gamma_length: 256,
}
Is AB24 format supported for SCANOUT | WRITE usage: true
Is AR24 format supported for SCANOUT | WRITE usage: true
Is BG24 format supported for SCANOUT | WRITE usage: false
Is BA24 format supported for SCANOUT | WRITE usage: false
Is BX24 format supported for SCANOUT | WRITE usage: false
Is RG24 format supported for SCANOUT | WRITE usage: false
Is R8A8 format supported for SCANOUT | WRITE usage: false
Is RA24 format supported for SCANOUT | WRITE usage: false
Is RX24 format supported for SCANOUT | WRITE usage: false
Is XB24 format supported for SCANOUT | WRITE usage: true
Is XR24 format supported for SCANOUT | WRITE usage: true
gbm.create_buffer_object(width: 1920, height: 1200, format: AR24, usage: SCANOUT | WRITE)
thread 'main' panicked at src/main.rs:155:90:
called `Result::unwrap()` on an `Err` value: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }

Which puzzles me, because the format and usage combination is claimed to be supported.

@mbernat
Copy link
Collaborator

mbernat commented Dec 15, 2023

Yeah, I don't think the formats are the issue here, we're probably not initializing something else correctly.

It would be nice to get more debug info from DRM/GBM when something goes wrong. With strace you can see a bit more but I'm afraid we'd have to read kernel code to figure out what goes wrong.

src/main.rs Show resolved Hide resolved
@PabloMansanet
Copy link

Just to add another data point, I'm having this exact same issue. Will investigate as well!

@strohel strohel changed the title Debug failure to call create_buffer_object() on Intel iGPU WIP: Debug failure to call create_buffer_object() on Intel iGPU Dec 18, 2023
@PabloMansanet
Copy link

I've looked into this for a bit and I didn't really get anywhere. libgbm is a bit underdocumented, and from the examples I find it looks like we should be able to call gbm_bo_create pretty much exactly as we're doing. I might try an equivalent C example tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants