rulimine/common/lib/fb.h

41 lines
846 B
C
Raw Normal View History

2021-03-02 08:21:05 +03:00
#ifndef __LIB__FB_H__
#define __LIB__FB_H__
#include <stdint.h>
#include <stddef.h>
#include <drivers/edid.h>
2021-03-02 08:21:05 +03:00
struct resolution {
2022-05-22 07:38:34 +03:00
uint64_t width;
uint64_t height;
uint16_t bpp;
};
2021-03-02 08:21:05 +03:00
struct fb_info {
2022-05-22 07:38:34 +03:00
uint64_t framebuffer_pitch;
uint64_t framebuffer_width;
uint64_t framebuffer_height;
2021-03-02 08:21:05 +03:00
uint16_t framebuffer_bpp;
uint8_t memory_model;
uint8_t red_mask_size;
uint8_t red_mask_shift;
uint8_t green_mask_size;
uint8_t green_mask_shift;
uint8_t blue_mask_size;
uint8_t blue_mask_shift;
uint64_t framebuffer_addr;
struct edid_info_struct *edid;
uint64_t mode_count;
struct fb_info *mode_list;
2021-03-02 08:21:05 +03:00
};
void fb_init(struct fb_info **ret, size_t *_fbs_count,
2022-05-22 07:38:34 +03:00
uint64_t target_width, uint64_t target_height, uint16_t target_bpp);
2021-03-02 08:21:05 +03:00
2021-04-04 05:02:05 +03:00
void fb_clear(struct fb_info *fb);
2021-03-02 08:21:05 +03:00
#endif