staticinlineint pixfmt_to_stride(int pix_fmt)
{ switch (pix_fmt) { case PIXFMT_RGB565: case PIXFMT_BGR565: case PIXFMT_RGB1555: case PIXFMT_BGR1555: case PIXFMT_UYVY: case PIXFMT_VYUY: case PIXFMT_YUYV: return 2; case PIXFMT_RGB888UNPACK: case PIXFMT_BGR888UNPACK: case PIXFMT_RGBA888: case PIXFMT_BGRA888: return 4; case PIXFMT_RGB888PACK: case PIXFMT_BGR888PACK: return 3; case PIXFMT_YUV422P: case PIXFMT_YVU422P: case PIXFMT_YUV420P: case PIXFMT_YVU420P: case PIXFMT_PSEUDOCOLOR: return 1; default: return 0;
}
}
/* parameters used by path/overlay */ /* overlay related para: win/addr */ struct mmp_win { /* position/size of window */
u16 xsrc;
u16 ysrc;
u16 xdst;
u16 ydst;
u16 xpos;
u16 ypos;
u16 left_crop;
u16 right_crop;
u16 up_crop;
u16 bottom_crop; int pix_fmt; /* * pitch[0]: graphics/video layer line length or y pitch * pitch[1]/pitch[2]: video u/v pitch if non-zero
*/
u32 pitch[3];
};
/* path is main part of mmp-disp */ struct mmp_path { /* use node to register to list */ struct list_head node;
/* init data */ struct device *dev;
int id; constchar *name; int output_type; struct mmp_panel *panel; void *plat_data;
/* dynamic use */ struct mmp_mode mode;
/* state */ int open_count; int status; struct mutex access_ok;
struct mmp_path_ops ops;
/* layers */ int overlay_num; struct mmp_overlay overlays[] __counted_by(overlay_num);
};
externstruct mmp_path *mmp_get_path(constchar *name); staticinlinevoid mmp_path_set_mode(struct mmp_path *path, struct mmp_mode *mode)
{ if (path)
path->ops.set_mode(path, mode);
} staticinlinevoid mmp_path_set_onoff(struct mmp_path *path, int status)
{ if (path)
path->ops.set_onoff(path, status);
} staticinlineint mmp_path_get_modelist(struct mmp_path *path, struct mmp_mode **modelist)
{ if (path) return path->ops.get_modelist(path, modelist); return 0;
} staticinlinestruct mmp_overlay *mmp_path_get_overlay( struct mmp_path *path, int overlay_id)
{ if (path) return path->ops.get_overlay(path, overlay_id); return NULL;
} staticinlinevoid mmp_overlay_set_fetch(struct mmp_overlay *overlay, int fetch_id)
{ if (overlay)
overlay->ops->set_fetch(overlay, fetch_id);
} staticinlinevoid mmp_overlay_set_onoff(struct mmp_overlay *overlay, int status)
{ if (overlay)
overlay->ops->set_onoff(overlay, status);
} staticinlinevoid mmp_overlay_set_win(struct mmp_overlay *overlay, struct mmp_win *win)
{ if (overlay)
overlay->ops->set_win(overlay, win);
} staticinlineint mmp_overlay_set_addr(struct mmp_overlay *overlay, struct mmp_addr *addr)
{ if (overlay) return overlay->ops->set_addr(overlay, addr); return 0;
}
/* * driver data is set from each detailed ctrl driver for path usage * it defined a common interface that plat driver need to implement
*/ struct mmp_path_info { /* driver data, set when registed*/ constchar *name; struct device *dev; int id; int output_type; int overlay_num; void (*set_mode)(struct mmp_path *path, struct mmp_mode *mode); void (*set_onoff)(struct mmp_path *path, int status); conststruct mmp_overlay_ops *overlay_ops; void *plat_data;
};
/* defintions for platform data */ /* interface for buffer driver */ struct mmp_buffer_driver_mach_info { constchar *name; constchar *path_name; int overlay_id; int dmafetch_id; int default_pixfmt;
};
/* interface for controllers driver */ struct mmp_mach_path_config { constchar *name; int overlay_num; int output_type;
u32 path_config;
u32 link_config;
u32 dsi_rbswap;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.