Coreboot implements framebuffer support via simple-framebuffer. Provide a dedicated DRM driver. Keep the simple-framebuffer code for now.
For each firmware's provided framebuffer, we prefer a dedicated DRM driver tailored towards the platform's feature set. The coreboot framebuffer device currently creates a simple-framebuffer device for the provided framebuffer aperture. But simple-framebuffer is for DeviceTree nodes; not for coreboot. The simple-framebuffer infrastructure should be phased out for non-DT use cases. Coreboot is one of the final users of the code (besides n64). Patches 1 to 5 start by fixing problems in the coreboot framebuffer implementation. There is a possible dangling pointer, the memory is marked as busy, the device hierarchy is incorrect, and a few minor things. Patches 6 to 9 prepare the coreboot support for use by external drivers. Specifically, structures for the entries os the coreboot payload table have to be exported. Patches 10 to 12 add corebootdrm, a DRM driver for the new coreboot-framebuffer platform device. Corebootdrm follows the pattern established by similar drivers. It also uses the same sysfb helpers. It is therefore fairly small. With patch 11, it has feature parity with simpledrm on the old simple-framebuffer. Patch 12 adds support for panel- orientation flags that coreboot makes available. Tested on an HP Chromebook with MrChromebox 4.16. Runs with Weston and fbcon. Xorg requires an additional patch available at [1]. v2: - keep design of coreboot framebuffer code intact (Julius) - fix bugs in the coreboot framebuffer code - rewrite corebootdrm as platform device - support panel orientation [1] https://gitlab.freedesktop.org/tzimmermann/xserver/-/commit/0b326aad28549762ed2b0e2bedf8f8a42f1f6b3b Thomas Zimmermann (12): firmware: google: framebuffer: Do not unregister platform device firmware: google: framebuffer: Do not mark framebuffer as busy firmware: google: framebuffer: Init memory resource with helper macro firmware: google: framebuffer: Tie platform device to PCI hardware firmware: google: framebuffer: Fix dependencies firmware: google: Init coreboot bus with subsys_initcall() firmware: google: Clean up include statements in coreboot_table.h firmware: google: Export coreboot table entries firmware: google: Pack structures for coreboot table entries drm/sysfb: Generalize pixel-format matching drm/sysfb: corebootdrm: Add DRM driver for coreboot framebuffers drm/corebotdrm: Support panel orientation MAINTAINERS | 1 + drivers/firmware/google/Kconfig | 5 +- drivers/firmware/google/cbmem.c | 1 + drivers/firmware/google/coreboot_table.c | 13 +- drivers/firmware/google/coreboot_table.h | 59 +-- .../firmware/google/framebuffer-coreboot.c | 122 +++-- drivers/firmware/google/memconsole-coreboot.c | 1 + drivers/firmware/google/vpd.c | 1 + drivers/gpu/drm/sysfb/Kconfig | 16 + drivers/gpu/drm/sysfb/Makefile | 1 + drivers/gpu/drm/sysfb/corebootdrm.c | 434 ++++++++++++++++++ drivers/gpu/drm/sysfb/drm_sysfb.c | 24 + drivers/gpu/drm/sysfb/drm_sysfb_helper.h | 8 +- drivers/gpu/drm/sysfb/drm_sysfb_screen_info.c | 30 -- drivers/gpu/drm/sysfb/efidrm.c | 8 +- drivers/gpu/drm/sysfb/vesadrm.c | 8 +- include/linux/coreboot.h | 80 ++++ 17 files changed, 689 insertions(+), 123 deletions(-) create mode 100644 drivers/gpu/drm/sysfb/corebootdrm.c create mode 100644 include/linux/coreboot.h base-commit: d5b0278e4bea2fb27de6d12b7f865a74072af677 prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24 prerequisite-patch-id: a5a973e527c88a5b47053d7a72aefe0b550197cb prerequisite-patch-id: 719d09751d38f5da743beed6266585ee063e1e29 -- 2.52.0
