Commit 5de1345f authored by Rafaël Carré's avatar Rafaël Carré

vout_fb: only store the pitch in vout_display_sys_t

parent 8cc373ed
...@@ -129,7 +129,6 @@ struct vout_display_sys_t { ...@@ -129,7 +129,6 @@ struct vout_display_sys_t {
int fd; /* device handle */ int fd; /* device handle */
struct fb_var_screeninfo old_info; /* original mode information */ struct fb_var_screeninfo old_info; /* original mode information */
struct fb_var_screeninfo var_info; /* current mode information */ struct fb_var_screeninfo var_info; /* current mode information */
struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
bool has_pan; /* does device supports panning ? */ bool has_pan; /* does device supports panning ? */
struct fb_cmap fb_cmap; /* original colormap */ struct fb_cmap fb_cmap; /* original colormap */
uint16_t *palette; /* original palette */ uint16_t *palette; /* original palette */
...@@ -138,6 +137,7 @@ struct vout_display_sys_t { ...@@ -138,6 +137,7 @@ struct vout_display_sys_t {
/* Video information */ /* Video information */
uint32_t width; uint32_t width;
uint32_t height; uint32_t height;
uint32_t line_length;
int bytes_per_pixel; int bytes_per_pixel;
/* Video memory */ /* Video memory */
...@@ -308,7 +308,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count) ...@@ -308,7 +308,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
memset(&rsc, 0, sizeof(rsc)); memset(&rsc, 0, sizeof(rsc));
rsc.p[0].p_pixels = sys->video_ptr; rsc.p[0].p_pixels = sys->video_ptr;
rsc.p[0].i_lines = sys->var_info.yres; rsc.p[0].i_lines = sys->var_info.yres;
rsc.p[0].i_pitch = sys->fix_info.line_length; rsc.p[0].i_pitch = sys->line_length;
sys->picture = picture_NewFromResource(&vd->fmt, &rsc); sys->picture = picture_NewFromResource(&vd->fmt, &rsc);
if (!sys->picture) if (!sys->picture)
...@@ -521,8 +521,9 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution) ...@@ -521,8 +521,9 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
return VLC_EGENERIC; return VLC_EGENERIC;
} }
struct fb_fix_screeninfo fix_info;
/* Get some information again, in the definitive configuration */ /* Get some information again, in the definitive configuration */
if (ioctl(sys->fd, FBIOGET_FSCREENINFO, &sys->fix_info) || if (ioctl(sys->fd, FBIOGET_FSCREENINFO, &fix_info) ||
ioctl(sys->fd, FBIOGET_VSCREENINFO, &sys->var_info)) { ioctl(sys->fd, FBIOGET_VSCREENINFO, &sys->var_info)) {
msg_Err(vd, "cannot get additional fb info (%m)"); msg_Err(vd, "cannot get additional fb info (%m)");
...@@ -544,6 +545,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution) ...@@ -544,6 +545,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
sys->height = sys->var_info.yres; sys->height = sys->var_info.yres;
sys->width = sys->var_info.xres_virtual ? sys->var_info.xres_virtual : sys->width = sys->var_info.xres_virtual ? sys->var_info.xres_virtual :
sys->var_info.xres; sys->var_info.xres;
sys->line_length = fix_info.line_length;
/* FIXME: if the image is full-size, it gets cropped on the left /* FIXME: if the image is full-size, it gets cropped on the left
* because of the xres / xres_virtual slight difference */ * because of the xres / xres_virtual slight difference */
...@@ -554,7 +556,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution) ...@@ -554,7 +556,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
sys->width, sys->height); sys->width, sys->height);
sys->palette = NULL; sys->palette = NULL;
sys->has_pan = (sys->fix_info.ypanstep || sys->fix_info.ywrapstep); sys->has_pan = (fix_info.ypanstep || fix_info.ywrapstep);
switch (sys->var_info.bits_per_pixel) { switch (sys->var_info.bits_per_pixel) {
case 8: case 8:
...@@ -603,7 +605,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution) ...@@ -603,7 +605,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
return VLC_EGENERIC; return VLC_EGENERIC;
} }
sys->video_size = sys->fix_info.line_length * sys->var_info.yres_virtual; sys->video_size = sys->line_length * sys->var_info.yres_virtual;
/* Map a framebuffer at the beginning */ /* Map a framebuffer at the beginning */
sys->video_ptr = mmap(NULL, sys->video_size, sys->video_ptr = mmap(NULL, sys->video_size,
...@@ -628,8 +630,8 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution) ...@@ -628,8 +630,8 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
msg_Dbg(vd, msg_Dbg(vd,
"framebuffer type=%d, visual=%d, ypanstep=%d, ywrap=%d, accel=%d", "framebuffer type=%d, visual=%d, ypanstep=%d, ywrap=%d, accel=%d",
sys->fix_info.type, sys->fix_info.visual, fix_info.type, fix_info.visual,
sys->fix_info.ypanstep, sys->fix_info.ywrapstep, sys->fix_info.accel); fix_info.ypanstep, fix_info.ywrapstep, fix_info.accel);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment