diff options
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm.h | 2 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 53 | ||||
-rw-r--r-- | include/drm/drm_mode.h | 16 | ||||
-rw-r--r-- | include/drm/exynos_drm.h | 262 |
4 files changed, 241 insertions, 92 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h index 64ff02d..5b831df 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -730,6 +730,8 @@ struct drm_prime_handle { #define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) #define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) #define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) +#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) +#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) /** * Device specific ioctls should only be in their respective headers diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index e250eda..0592714 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -36,6 +36,7 @@ struct drm_device; struct drm_mode_set; struct drm_framebuffer; +struct drm_object_properties; #define DRM_MODE_OBJECT_CRTC 0xcccccccc @@ -50,6 +51,14 @@ struct drm_framebuffer; struct drm_mode_object { uint32_t id; uint32_t type; + struct drm_object_properties *properties; +}; + +#define DRM_OBJECT_MAX_PROPERTY 16 +struct drm_object_properties { + int count; + uint32_t ids[DRM_OBJECT_MAX_PROPERTY]; + uint64_t values[DRM_OBJECT_MAX_PROPERTY]; }; /* @@ -297,7 +306,8 @@ struct drm_plane; * @mode_fixup: fixup proposed mode * @mode_set: set the desired mode on the CRTC * @gamma_set: specify color ramp for CRTC - * @destroy: deinit and free object. + * @destroy: deinit and free object + * @set_property: called when a property is changed * * The drm_crtc_funcs structure is the central CRTC management structure * in the DRM. Each CRTC controls one or more connectors (note that the name @@ -341,6 +351,9 @@ struct drm_crtc_funcs { int (*page_flip)(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event); + + int (*set_property)(struct drm_crtc *crtc, + struct drm_property *property, uint64_t val); }; /** @@ -360,6 +373,7 @@ struct drm_crtc_funcs { * @framedur_ns: precise line timing * @pixeldur_ns: precise pixel timing * @helper_private: mid-layer private data + * @properties: property tracking for this CRTC * * Each CRTC may have one or more connectors associated with it. This structure * allows the CRTC to be controlled. @@ -395,6 +409,8 @@ struct drm_crtc { /* if you are using the helper */ void *helper_private; + + struct drm_object_properties properties; }; @@ -451,7 +467,6 @@ struct drm_encoder_funcs { }; #define DRM_CONNECTOR_MAX_UMODES 16 -#define DRM_CONNECTOR_MAX_PROPERTY 16 #define DRM_CONNECTOR_LEN 32 #define DRM_CONNECTOR_MAX_ENCODER 3 @@ -520,8 +535,7 @@ enum drm_connector_force { * @funcs: connector control functions * @user_modes: user added mode list * @edid_blob_ptr: DRM property containing EDID if present - * @property_ids: property tracking for this connector - * @property_values: value pointers or data for properties + * @properties: property tracking for this connector * @polled: a %DRM_CONNECTOR_POLL_<foo> value for core driven polling * @dpms: current dpms state * @helper_private: mid-layer private data @@ -565,8 +579,7 @@ struct drm_connector { struct list_head user_modes; struct drm_property_blob *edid_blob_ptr; - u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; - uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; + struct drm_object_properties properties; uint8_t polled; /* DRM_CONNECTOR_POLL_* */ @@ -595,6 +608,7 @@ struct drm_connector { * @update_plane: update the plane configuration * @disable_plane: shut down the plane * @destroy: clean up plane resources + * @set_property: called when a property is changed */ struct drm_plane_funcs { int (*update_plane)(struct drm_plane *plane, @@ -605,6 +619,9 @@ struct drm_plane_funcs { uint32_t src_w, uint32_t src_h); int (*disable_plane)(struct drm_plane *plane); void (*destroy)(struct drm_plane *plane); + + int (*set_property)(struct drm_plane *plane, + struct drm_property *property, uint64_t val); }; /** @@ -622,6 +639,7 @@ struct drm_plane_funcs { * @enabled: enabled flag * @funcs: helper functions * @helper_private: storage for drver layer + * @properties: property tracking for this plane */ struct drm_plane { struct drm_device *dev; @@ -644,6 +662,8 @@ struct drm_plane { const struct drm_plane_funcs *funcs; void *helper_private; + + struct drm_object_properties properties; }; /** @@ -898,6 +918,12 @@ extern int drm_connector_property_set_value(struct drm_connector *connector, extern int drm_connector_property_get_value(struct drm_connector *connector, struct drm_property *property, uint64_t *value); +extern int drm_object_property_set_value(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t val); +extern int drm_object_property_get_value(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t *value); extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev); extern void drm_framebuffer_set_object(struct drm_device *dev, unsigned long handle); @@ -910,14 +936,21 @@ extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); extern bool drm_crtc_in_use(struct drm_crtc *crtc); -extern int drm_connector_attach_property(struct drm_connector *connector, - struct drm_property *property, uint64_t init_val); +extern void drm_connector_attach_property(struct drm_connector *connector, + struct drm_property *property, uint64_t init_val); +extern void drm_object_attach_property(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t init_val); extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, const char *name, int num_values); extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags, const char *name, const struct drm_prop_enum_list *props, int num_values); +struct drm_property *drm_property_create_bitmask(struct drm_device *dev, + int flags, const char *name, + const struct drm_prop_enum_list *props, + int num_values); struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, const char *name, uint64_t min, uint64_t max); @@ -1023,6 +1056,10 @@ extern int drm_mode_mmap_dumb_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); +extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); +extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, int *bpp); diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 2a2acda..3190dfe 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h @@ -228,6 +228,7 @@ struct drm_mode_get_connector { #define DRM_MODE_PROP_IMMUTABLE (1<<2) #define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ #define DRM_MODE_PROP_BLOB (1<<4) +#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ struct drm_mode_property_enum { __u64 value; @@ -252,6 +253,21 @@ struct drm_mode_connector_set_property { __u32 connector_id; }; +struct drm_mode_obj_get_properties { + __u64 props_ptr; + __u64 prop_values_ptr; + __u32 count_props; + __u32 obj_id; + __u32 obj_type; +}; + +struct drm_mode_obj_set_property { + __u64 value; + __u32 prop_id; + __u32 obj_id; + __u32 obj_type; +}; + struct drm_mode_get_blob { __u32 blob_id; __u32 length; diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h index f5d8a38..e8aa254 100644 --- a/include/drm/exynos_drm.h +++ b/include/drm/exynos_drm.h @@ -111,6 +111,19 @@ struct drm_exynos_gem_info { }; /** + * A structure to userptr limited information. + * + * @userptr_limit: maximum size to userptr buffer. + * the buffer could be allocated by unprivileged user using malloc() + * and the size of the buffer would be limited as userptr_limit value. + * @pad: just padding to be 64-bit aligned. + */ +struct drm_exynos_user_limit { + unsigned int userptr_limit; + unsigned int pad; +}; + +/** * A structure for user connection request of virtual display. * * @connection: indicate whether doing connetion or not by user. @@ -211,16 +224,14 @@ enum e_drm_exynos_gem_mem_type { * P.S. it SHOULD BE user space. * @size: buffer size for cache operation. * @flags: select cache unit and cache operation. + * @gem_handle: a handle to a gem object. + * this gem handle is needed for cache range operation to L2 cache. */ struct drm_exynos_gem_cache_op { uint64_t usr_addr; unsigned int size; unsigned int flags; -}; - -struct drm_exynos_plane_set_zpos { - __u32 plane_id; - __s32 zpos; + unsigned int gem_handle; }; struct drm_exynos_g2d_get_ver { @@ -256,99 +267,129 @@ struct drm_exynos_g2d_exec { __u32 reserved; }; -enum drm_exynos_rot_flip { - ROT_FLIP_NONE, - ROT_FLIP_VERTICAL, - ROT_FLIP_HORIZONTAL, +/* definition of operations types */ +enum drm_exynos_ops_id { + EXYNOS_DRM_OPS_SRC, + EXYNOS_DRM_OPS_DST, + EXYNOS_DRM_OPS_MAX, +}; + +/* definition of size */ +struct drm_exynos_sz { + __u32 hsize; + __u32 vsize; +}; + +/* definition of position */ +struct drm_exynos_pos { + __u32 x; + __u32 y; + __u32 w; + __u32 h; }; -enum drm_exynos_rot_degree { - ROT_DEGREE_0, - ROT_DEGREE_90, - ROT_DEGREE_180, - ROT_DEGREE_270, +/* definition of flip */ +enum drm_exynos_flip { + EXYNOS_DRM_FLIP_NONE = (0 << 0), + EXYNOS_DRM_FLIP_VERTICAL = (1 << 0), + EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1), }; -#define DRM_EXYNOS_ROT_MAX_BUF 3 +/* definition of rotation degree */ +enum drm_exynos_degree { + EXYNOS_DRM_DEGREE_0, + EXYNOS_DRM_DEGREE_90, + EXYNOS_DRM_DEGREE_180, + EXYNOS_DRM_DEGREE_270, +}; + +/* definition of planar */ +enum drm_exynos_planer { + EXYNOS_DRM_PLANAR_Y, + EXYNOS_DRM_PLANAR_CB, + EXYNOS_DRM_PLANAR_CR, + EXYNOS_DRM_PLANAR_MAX, +}; /** - * A structure for rotator buffer + * A structure for ipp config. * - * @src_handle: Source GEM handles. - * @dst_handle: Destination GEM handles. - * - *_handle[0] : For RGB or Y buffer. - * - *_handle[1] : For CbCr or Cb buffer. - * - *_handle[2] : For Cr buffer. - * @src_cnt: Number of source GEM handles. - * @dst_cnt: Number of destination GEM handles. - * @src_w: Source Buffer width. - * @src_h: Source Buffer height. - * @dst_w: Destination Buffer width. - * @dst_h: Destination Buffer height. + * @ops_id: property of operation directions. + * @flip: property of mirror, flip. + * @degree: property of rotation degree. + * @fmt: property of image format. + * @sz: property of image size. + * @pos: property of image position(src-cropped,dst-scaler). */ -struct drm_exynos_rot_buffer { - __u32 src_handle[DRM_EXYNOS_ROT_MAX_BUF]; - __u32 dst_handle[DRM_EXYNOS_ROT_MAX_BUF]; - __u32 src_cnt; - __u32 dst_cnt; - __u32 src_w; - __u32 src_h; - __u32 dst_w; - __u32 dst_h; +struct drm_exynos_ipp_config { + enum drm_exynos_ops_id ops_id; + enum drm_exynos_flip flip; + enum drm_exynos_degree degree; + __u32 fmt; + struct drm_exynos_sz sz; + struct drm_exynos_pos pos; +}; + +/* command of ipp operations */ +enum drm_exynos_ipp_cmd { + IPP_CMD_NONE, + IPP_CMD_M2M, + IPP_CMD_WB, + IPP_CMD_OUTPUT, + IPP_CMD_MAX, }; /** - * A structure for rotator control. + * A structure for ipp property. * - * @img_fmt: Source / destination buffer (image)format. - * - fourcc code from drm_fourcc.h - * - DRM_FORMAT_RGB888 - * - DRM_FORMAT_RGB565 - * - DRM_FORMAT_YUYV : YUV 4:2:2 packed, YCbYCr - * - DRM_FORMAT_NV12M : YUV 4:2:0 non-contiguous 2-plane, Y/CbCr - * - DRM_FORMAT_YUV420M : YUV 4:2:0 non-contiguous 3-plane, Y/Cb/Cr - * @flip: Flip operation value. - * @degree: Rotation operation degree value. + * @config: source, destination config. + * @cmd: command type. + * @ipp_id: id of ipp driver. + * @prop_id: id of property. */ -struct drm_exynos_rot_control { - __u32 img_fmt; - enum drm_exynos_rot_flip flip; - enum drm_exynos_rot_degree degree; - __u32 reserved; +struct drm_exynos_ipp_property { + struct drm_exynos_ipp_config config[EXYNOS_DRM_OPS_MAX]; + enum drm_exynos_ipp_cmd cmd; + __u32 ipp_id; + __u32 prop_id; + __u32 reserved; +}; + +/* definition of buffer control */ +enum drm_exynos_ipp_buf_ctrl { + IPP_BUF_CTRL_QUEUE, + IPP_BUF_CTRL_DEQUEUE, }; /** - * A structure for rotator crop. + * A structure for ipp buffer operations. * - * @src_x: Cropped image position x in source buffer[FROM]. - * @src_y: Cropped image position y in source buffer[FROM]. - * @src_w: Cropped image width in source buffer. - * @src_h: Cropped image height in source buffer. - * @dst_x: Cropped image position x in destination buffer[TO]. - * @dst_y: Cropped image position y in destination buffer[TO]. + * @ops_id: operation directions. + * @ctrl: buffer control. + * @prop_id: id of property. + * @buf_id: id of buffer. + * @handle: Y, Cb, Cr each planar handle. + * @user_data: user data. */ -struct drm_exynos_rot_crop { - __u32 src_x; - __u32 src_y; - __u32 src_w; - __u32 src_h; - __u32 dst_x; - __u32 dst_y; +struct drm_exynos_ipp_buf { + enum drm_exynos_ops_id ops_id; + enum drm_exynos_ipp_buf_ctrl buf_ctrl; + __u32 prop_id; + __u32 buf_id; + __u32 handle[EXYNOS_DRM_PLANAR_MAX]; + __u32 reserved; + __u64 user_data; }; /** - * A structure for rotator operation. + * A structure for ipp start/stop operations. * - * @buf: (Image)Buffer data. - * @control: Control data. - * @crop: Cropped image data. - * @user_data: Not used yet. + * @prop_id: id of property. + * @use: use ipp device. */ -struct drm_exynos_rot_exec_data { - struct drm_exynos_rot_buffer buf; - struct drm_exynos_rot_control control; - struct drm_exynos_rot_crop crop; - __u64 user_data; +struct drm_exynos_ipp_ctrl { + __u32 prop_id; + __u32 use; }; #define DRM_EXYNOS_GEM_CREATE 0x00 @@ -356,8 +397,7 @@ struct drm_exynos_rot_exec_data { #define DRM_EXYNOS_GEM_MMAP 0x02 #define DRM_EXYNOS_GEM_USERPTR 0x03 #define DRM_EXYNOS_GEM_GET 0x04 -/* Reserved 0x04 ~ 0x05 for exynos specific gem ioctl */ -#define DRM_EXYNOS_PLANE_SET_ZPOS 0x06 +#define DRM_EXYNOS_USER_LIMIT 0x05 #define DRM_EXYNOS_VIDI_CONNECTION 0x07 /* temporary ioctl command. */ @@ -372,8 +412,11 @@ struct drm_exynos_rot_exec_data { #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21 #define DRM_EXYNOS_G2D_EXEC 0x22 -/* Rotator */ -#define DRM_EXYNOS_ROTATOR_EXEC 0x30 +/* IPP - Image Post Processing */ +#define DRM_EXYNOS_IPP_GET_PROPERTY 0x30 +#define DRM_EXYNOS_IPP_SET_PROPERTY 0x31 +#define DRM_EXYNOS_IPP_BUF 0x32 +#define DRM_EXYNOS_IPP_CTRL 0x33 #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) @@ -390,6 +433,9 @@ struct drm_exynos_rot_exec_data { #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info) +#define DRM_IOCTL_EXYNOS_USER_LIMIT DRM_IOWR(DRM_COMMAND_BASE + \ + DRM_EXYNOS_USER_LIMIT, struct drm_exynos_user_limit) + #define DRM_IOCTL_EXYNOS_GEM_EXPORT_UMP DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_GEM_EXPORT_UMP, struct drm_exynos_gem_ump) @@ -402,9 +448,6 @@ struct drm_exynos_rot_exec_data { #define DRM_IOCTL_EXYNOS_GEM_PHY_IMP DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_GEM_PHY_IMP, struct drm_exynos_gem_phy_imp) -#define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS DRM_IOWR(DRM_COMMAND_BASE + \ - DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos) - #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection) @@ -415,11 +458,18 @@ struct drm_exynos_rot_exec_data { #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec) -#define DRM_IOCTL_EXYNOS_ROTATOR_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ - DRM_EXYNOS_ROTATOR_EXEC, struct drm_exynos_rot_exec_data) +#define DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \ + DRM_EXYNOS_IPP_GET_PROPERTY, struct drm_exynos_ipp_property) +#define DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \ + DRM_EXYNOS_IPP_SET_PROPERTY, struct drm_exynos_ipp_property) +#define DRM_IOCTL_EXYNOS_IPP_BUF DRM_IOWR(DRM_COMMAND_BASE + \ + DRM_EXYNOS_IPP_BUF, struct drm_exynos_ipp_buf) +#define DRM_IOCTL_EXYNOS_IPP_CTRL DRM_IOWR(DRM_COMMAND_BASE + \ + DRM_EXYNOS_IPP_CTRL, struct drm_exynos_ipp_ctrl) /* EXYNOS specific events */ #define DRM_EXYNOS_G2D_EVENT 0x80000000 +#define DRM_EXYNOS_IPP_EVENT 0x80000001 struct drm_exynos_g2d_event { struct drm_event base; @@ -430,6 +480,16 @@ struct drm_exynos_g2d_event { __u32 reserved; }; +struct drm_exynos_ipp_event { + struct drm_event base; + __u64 user_data; + __u32 tv_sec; + __u32 tv_usec; + __u32 prop_id; + __u32 reserved; + __u32 buf_id[EXYNOS_DRM_OPS_MAX]; +}; + /** * A structure for lcd panel information. * @@ -490,4 +550,38 @@ struct exynos_drm_hdmi_pdata { int (*get_hpd)(void); }; +/** + * Platform Specific Structure for DRM based FIMC. + * + * @inv_pclk: if set 1. invert pixel clock + * @inv_vsync: if set 1. invert vsync signal for wb + * @inv_href: if set 1. invert href signal + * @inv_hsync: if set 1. invert hsync signal for wb + */ +struct exynos_drm_fimc_pol { + unsigned int inv_pclk; + unsigned int inv_vsync; + unsigned int inv_href; + unsigned int inv_hsync; +}; + +/* definition of chipset version */ +enum exynos_drm_fimc_ver { + FIMC_EXYNOS_4210, + FIMC_EXYNOS_4212, + FIMC_EXYNOS_4412, +}; + +/** + * Platform Specific Structure for DRM based FIMC. + * + * @pol: current hardware block polarity settings. + * @ver: current hardware block version. + */ +struct exynos_drm_fimc_pdata { + struct exynos_drm_fimc_pol pol; + enum exynos_drm_fimc_ver ver; +}; + #endif + |