Coder Social home page Coder Social logo

drm-framebuffer's People

Contributors

eichenberger avatar stolk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

drm-framebuffer's Issues

Could not get master role for DRM

.../home/drm-framebuffer # dd if=/dev/urandom | ./drm-framebuffer -d /dev/dri/card0 -c DSI-1
Could not get master role for DRM.

and How to use ffmpeg? To get image or videos off of a drm based device such as my phone

could not find referred resolution

$ ./drm-framebuffer -d /dev/dri/by-path/platform-gpu-card -c HMDI-A-1
Could not find preferred resolution

when I use -r:

$ ./drm-framebuffer -d /dev/dri/by-path/platform-gpu-card -c HMDI-A-1 -r
1280x720

Cool stuff for drm connectors on same framebuffer

Hey there,

I ran into your code by chance, compiled it for my pi, it works great!

Reason why I'm here: I have 2 displays on a headless raspberry pi, I just couldn't get fbi to send its output to a specific drm connector, as both screens appear under the same framebuffer with the default raspberry pi driver. Your code did the trick.

I was thinking, wouldn't it be nice if drm-framebuffer could refresh the framebuffer as soon as a new image is passed to it? Right now it collects the framebuffer data, displays it, and then wait until it gets killed. I'll try to see if I can tweak your code and do a pull when I get a chance.

Thanks.

Use of initialized data can cause crash.

I had a crash in release_framebuffer() when I try to use an unconnected connector.

Using valgrind, I tracked it down to the use of uninitialized data. I will provide a pull-request with a simple fix.

$ valgrind ./drm-framebuffer -d /dev/dri/card0 -c HDMI-A-1
==51253== Memcheck, a memory error detector
==51253== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==51253== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==51253== Command: ./drm-framebuffer -d /dev/dri/card0 -c HDMI-A-1
==51253== 
Could not find preferred resolution
==51253== Conditional jump or move depends on uninitialised value(s)
==51253==    at 0x10AF0E: release_framebuffer (framebuffer.c:49)
==51253==    by 0x10B523: get_framebuffer (framebuffer.c:189)
==51253==    by 0x10AE84: main (main.c:276)

Cross compiling

Does this require a specific version of the kernel? I'm trying to XCC but no luck so far.

make
aarch64-poky-linux-gcc -march=armv8-a+crc+crypto -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/armv8a-poky-linux -I "../opt/fsl-imx-wayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/include/" -c main.c -O2 -pipe -g -feliminate-unused-debug-types
aarch64-poky-linux-gcc -march=armv8-a+crc+crypto -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/armv8a-poky-linux -O2 -pipe -g -feliminate-unused-debug-types -o drm-framebuffer -I "../opt/fsl-imx-wayland/5.15-kirkstone/sysroots/armv8a-poky-linux/usr/include/" main.o framebuffer.o -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: main.o: in function fill_framebuffer_from_stdin': /home/serstech/drm-framebuffer/main.c:194: undefined reference to drmSetMaster'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:200: undefined reference to drmModeSetCrtc' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:201: undefined reference to drmModeSetCrtc'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:202: undefined reference to drmDropMaster' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: main.o: in function get_resolution':
/home/serstech/drm-framebuffer/main.c:123: undefined reference to drmModeGetResources' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:134: undefined reference to drmModeGetConnectorCurrent'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:144: undefined reference to drmModeFreeConnector' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: main.o: in function list_resources':
/home/serstech/drm-framebuffer/main.c:59: undefined reference to drmModeGetResources' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:71: undefined reference to drmModeGetConnectorCurrent'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:79: undefined reference to drmModeGetEncoder' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:85: undefined reference to drmModeFreeEncoder'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:86: undefined reference to drmModeFreeConnector' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:105: undefined reference to drmModeFreeResources'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: main.o: in function get_resolution': /home/serstech/drm-framebuffer/main.c:170: undefined reference to drmModeFreeConnector'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/main.c:171: undefined reference to drmModeFreeResources' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: framebuffer.o: in function release_framebuffer':
/home/serstech/drm-framebuffer/framebuffer.c:51: undefined reference to drmSetMaster' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:54: undefined reference to drmModeSetCrtc'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:55: undefined reference to drmModeFreeCrtc' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:61: undefined reference to drmModeFreeConnector'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:58: undefined reference to drmModeGetFB' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:58: undefined reference to drmModeFreeFB'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: framebuffer.o: in function get_framebuffer': /home/serstech/drm-framebuffer/framebuffer.c:86: undefined reference to drmModeGetResources'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:97: undefined reference to drmModeGetConnectorCurrent' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:107: undefined reference to drmModeFreeConnector'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:141: undefined reference to drmModeAddFB' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:148: undefined reference to drmModeGetEncoder'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:156: undefined reference to drmModeGetCrtc' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:163: undefined reference to drmIoctl'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:177: undefined reference to drmDropMaster' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:186: undefined reference to drmModeFreeEncoder'
/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:186: undefined reference to drmModeFreeEncoder' /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.2.0/real-ld: /home/serstech/drm-framebuffer/framebuffer.c:186: undefined reference to drmModeFreeEncoder'
collect2: error: ld returned 1 exit status
make: *** [Makefile:14: all] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.