mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-08-17 23:24:50 +08:00
style: format code with clang-format
This commit is contained in:
@@ -123,7 +123,7 @@ static rt_err_t plane_fb_pan_display(struct rt_graphic_plane *plane,
|
||||
}
|
||||
|
||||
offset = rect->y * plane->line_length + rect->x * byte_per_pixel;
|
||||
span = (rect->height - 1) * plane->line_length + row_bytes;
|
||||
span = (rect->height - 1) * plane->line_length + row_bytes;
|
||||
|
||||
if (offset <= plane->framebuffer_len && span <= plane->framebuffer_len - offset)
|
||||
{
|
||||
@@ -214,7 +214,7 @@ static rt_err_t _graphic_control(rt_device_t dev, int cmd, void *args)
|
||||
{
|
||||
rt_err_t err = RT_EOK;
|
||||
rt_bool_t need_schedule = RT_FALSE;
|
||||
rt_bool_t wait_vsync = RT_FALSE;
|
||||
rt_bool_t wait_vsync = RT_FALSE;
|
||||
struct rt_graphic_device *gdev = raw_to_graphic(dev);
|
||||
|
||||
_retry:
|
||||
@@ -567,8 +567,8 @@ _retry:
|
||||
var->yres = plane->height;
|
||||
var->xres_virtual = plane->width;
|
||||
var->yres_virtual = plane->height * (plane->framebuffer_len / plane->screen_len);
|
||||
var->xoffset = plane->x;
|
||||
var->yoffset = plane->y;
|
||||
var->xoffset = plane->x;
|
||||
var->yoffset = plane->y;
|
||||
var->bits_per_pixel = plane->bits_per_pixel;
|
||||
|
||||
if (plane == gdev->primary_plane)
|
||||
|
||||
@@ -41,13 +41,13 @@
|
||||
#define FBIO_WAITFORVSYNC 0x4620
|
||||
|
||||
/* fb_var_screeninfo.activate */
|
||||
#define FB_ACTIVATE_NOW 0
|
||||
#define FB_ACTIVATE_NXTOPEN 1
|
||||
#define FB_ACTIVATE_TEST 2
|
||||
#define FB_ACTIVATE_MASK 15
|
||||
#define FB_ACTIVATE_VBL 16
|
||||
#define FB_ACTIVATE_ALL 64
|
||||
#define FB_ACTIVATE_FORCE 128
|
||||
#define FB_ACTIVATE_NOW 0
|
||||
#define FB_ACTIVATE_NXTOPEN 1
|
||||
#define FB_ACTIVATE_TEST 2
|
||||
#define FB_ACTIVATE_MASK 15
|
||||
#define FB_ACTIVATE_VBL 16
|
||||
#define FB_ACTIVATE_ALL 64
|
||||
#define FB_ACTIVATE_FORCE 128
|
||||
|
||||
struct fb_bitfield
|
||||
{
|
||||
|
||||
@@ -226,10 +226,10 @@ rt_err_t graphic_start(const char *gdev, int count)
|
||||
{
|
||||
rt_err_t err;
|
||||
rt_uint8_t *vfb, *fb, *pixel, bpp;
|
||||
rt_size_t frame_len, page_count, front_page;
|
||||
struct rt_device_rect_info rect;
|
||||
rt_size_t frame_len, page_count, front_page;
|
||||
struct rt_device_rect_info rect;
|
||||
struct rt_device_graphic_info info;
|
||||
struct fb_var_screeninfo var;
|
||||
struct fb_var_screeninfo var;
|
||||
struct rt_device *dev = rt_device_find(gdev);
|
||||
void (*conv_func)(rt_uint8_t r, rt_uint8_t g, rt_uint8_t b, void *pixel);
|
||||
|
||||
@@ -253,7 +253,7 @@ rt_err_t graphic_start(const char *gdev, int count)
|
||||
goto _end;
|
||||
}
|
||||
|
||||
frame_len = (rt_size_t)info.pitch * info.height;
|
||||
frame_len = (rt_size_t)info.pitch * info.height;
|
||||
page_count = frame_len ? info.smem_len / frame_len : 0;
|
||||
|
||||
if (!page_count)
|
||||
@@ -310,21 +310,21 @@ rt_err_t graphic_start(const char *gdev, int count)
|
||||
{
|
||||
front_page = (front_page + 1) % page_count;
|
||||
rt_memcpy((rt_uint8_t *)info.framebuffer + front_page * frame_len,
|
||||
vfb, frame_len);
|
||||
vfb, frame_len);
|
||||
|
||||
var.xoffset = 0;
|
||||
var.yoffset = front_page * info.height;
|
||||
var.xoffset = 0;
|
||||
var.yoffset = front_page * info.height;
|
||||
var.activate = FB_ACTIVATE_VBL;
|
||||
err = rt_device_control(dev, FBIOPAN_DISPLAY, &var);
|
||||
err = rt_device_control(dev, FBIOPAN_DISPLAY, &var);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_memcpy(info.framebuffer, vfb, frame_len);
|
||||
rect.x = 0;
|
||||
rect.y = 0;
|
||||
rect.width = info.width;
|
||||
rect.x = 0;
|
||||
rect.y = 0;
|
||||
rect.width = info.width;
|
||||
rect.height = info.height;
|
||||
err = rt_device_control(dev, RTGRAPHIC_CTRL_RECT_UPDATE, &rect);
|
||||
err = rt_device_control(dev, RTGRAPHIC_CTRL_RECT_UPDATE, &rect);
|
||||
|
||||
if (!err)
|
||||
{
|
||||
|
||||
+123
-121
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user