Permalink
Browse files

video: msm: Updated MDDI from HTC

Change-Id: I8352acff6d60d1bcaf2504b9ef2602de43ab11eb
  • Loading branch information...
1 parent 074765e commit 2eaad42be995bde039692415722be1d023d83e59 @cyanogen cyanogen committed Nov 9, 2010
@@ -27,17 +27,16 @@ struct mddi_info;
#define MSM_MDP_OUT_IF_FMT_RGB888 2
/* mdp override operations */
-#define MSM_MDP_PANEL_IGNORE_PIXEL_DATA (1 << 0)
-#define MSM_MDP_PANEL_FLIP_UD (1 << 1)
-#define MSM_MDP_PANEL_FLIP_LR (1 << 2)
-#define MSM_MDP4_MDDI_DMA_SWITCH (1 << 3)
+#define MSM_MDP_PANEL_IGNORE_PIXEL_DATA (1 << 0)
+#define MSM_MDP_PANEL_FLIP_UD (1 << 1)
+#define MSM_MDP_PANEL_FLIP_LR (1 << 2)
+#define MSM_MDP4_MDDI_DMA_SWITCH (1 << 3)
+#define MSM_MDP_DMA_PACK_ALIGN_LSB (1 << 4)
+#define MSM_MDP_RGB_PANEL_SELE_REFRESH (1 << 5)
/* mddi type */
-#define MSM_MDP_MDDI_TYPE_I 0
-#define MSM_MDP_MDDI_TYPE_II 1
-
-/* lcdc override operations */
-#define MSM_MDP_LCDC_DMA_PACK_ALIGN_LSB (1 << 0)
+#define MSM_MDP_MDDI_TYPE_I 0
+#define MSM_MDP_MDDI_TYPE_II 1
struct msm_fb_data {
int xres; /* x resolution in pixels */
@@ -56,12 +55,13 @@ enum {
MSM_MDDI_EMDH_INTERFACE,
MSM_EBI2_INTERFACE,
MSM_LCDC_INTERFACE,
+ MSM_TV_INTERFACE,
- MSM_MDP_NUM_INTERFACES = MSM_LCDC_INTERFACE + 1,
+ MSM_MDP_NUM_INTERFACES = MSM_TV_INTERFACE + 1
};
#define MSMFB_CAP_PARTIAL_UPDATES (1 << 0)
-#define MSMFB_CAP_CABC (1 << 1)
+#define MSMFB_CAP_CABC (1 << 1)
struct msm_lcdc_timing {
unsigned int clk_rate; /* dclk freq */
@@ -104,34 +104,33 @@ struct msm_panel_data {
/* capabilities supported by the panel */
uint32_t caps;
- /*
- * For samsung driver IC, we always need to indicate where
- * to draw. So we pass update_into to mddi client.
- *
- */
- struct {
- int left;
- int top;
- int eright; /* exclusive */
- int ebottom; /* exclusive */
- } update_info;
-
+ /*
+ * For samsung driver IC, we always need to indicate where
+ * to draw. So we pass update_into to mddi client.
+ *
+ */
+ struct {
+ int left;
+ int top;
+ int eright; /* exclusive */
+ int ebottom; /* exclusive */
+ } update_info;
};
enum {
- MDP_DMA_P = 0,
- MDP_DMA_S,
+ MDP_DMA_P = 0,
+ MDP_DMA_S,
};
struct msm_mdp_platform_data {
- /* from the enum above */
- int dma_channel;
- unsigned overrides;
- unsigned color_format;
- int tearing_check;
- unsigned sync_config;
- unsigned sync_thresh;
- unsigned sync_start_pos;
+ /* from the enum above */
+ int dma_channel;
+ unsigned overrides;
+ unsigned color_format;
+ int tearing_check;
+ unsigned sync_config;
+ unsigned sync_thresh;
+ unsigned sync_start_pos;
};
struct msm_mddi_client_data {
@@ -144,7 +143,7 @@ struct msm_mddi_client_data {
uint32_t reg, unsigned int nr_bytes);
uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg);
void (*auto_hibernate)(struct msm_mddi_client_data *, int);
- /* custom data that needs to be passed from the board file to a
+ /* custom data that needs to be passed from the board file to a
* particular client */
void *private_client_data;
struct resource *fb_resource;
@@ -159,8 +158,6 @@ struct msm_mddi_platform_data {
/* fixup the mfr name, product id */
void (*fixup)(uint16_t *mfr_name, uint16_t *product_id);
- int vsync_irq;
-
struct resource *fb_resource; /*optional*/
/* number of clients in the list that follows */
int num_clients;
@@ -192,6 +189,11 @@ struct msm_lcdc_panel_ops {
int (*uninit)(struct msm_lcdc_panel_ops *);
int (*blank)(struct msm_lcdc_panel_ops *);
int (*unblank)(struct msm_lcdc_panel_ops *);
+ int (*shutdown)(struct msm_lcdc_panel_ops *);
+#ifdef CONFIG_PANEL_SELF_REFRESH
+ int (*refresh_enable)(struct msm_lcdc_panel_ops *);
+ int (*refresh_disable)(struct msm_lcdc_panel_ops *);
+#endif
};
struct msm_lcdc_platform_data {
@@ -200,19 +202,20 @@ struct msm_lcdc_platform_data {
int fb_id;
struct msm_fb_data *fb_data;
struct resource *fb_resource;
- unsigned overrides;
};
struct msm_tvenc_platform_data {
- struct msm_tvenc_panel_ops *panel_ops;
- int fb_id;
- struct msm_fb_data *fb_data;
- struct resource *fb_resource;
- int (*video_relay)(int on_off);
- };
+ struct msm_tvenc_panel_ops *panel_ops;
+ int fb_id;
+ struct msm_fb_data *fb_data;
+ struct resource *fb_resource;
+ int (*video_relay)(int on_off);
+};
struct mdp_blit_req;
struct fb_info;
+struct mdp_overlay;
+struct msmfb_overlay_data;
struct mdp_device {
struct device dev;
void (*dma)(struct mdp_device *mdp, uint32_t addr,
@@ -221,31 +224,48 @@ struct mdp_device {
void (*dma_wait)(struct mdp_device *mdp, int interface);
int (*blit)(struct mdp_device *mdp, struct fb_info *fb,
struct mdp_blit_req *req);
+#ifdef CONFIG_FB_MSM_OVERLAY
+ int (*overlay_get)(struct mdp_device *mdp, struct fb_info *fb,
+ struct mdp_overlay *req);
+ int (*overlay_set)(struct mdp_device *mdp, struct fb_info *fb,
+ struct mdp_overlay *req);
+ int (*overlay_unset)(struct mdp_device *mdp, struct fb_info *fb,
+ int ndx);
+ int (*overlay_play)(struct mdp_device *mdp, struct fb_info *fb,
+ struct msmfb_overlay_data *req, struct file **p_src_file);
+#endif
void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id);
void (*configure_dma)(struct mdp_device *mdp);
int (*check_output_format)(struct mdp_device *mdp, int bpp);
int (*set_output_format)(struct mdp_device *mdp, int bpp);
- unsigned overrides;
+ void (*set_panel_size)(struct mdp_device *mdp, int width, int height);
unsigned color_format;
+ unsigned overrides;
+ uint32_t width; /*panel width*/
+ uint32_t height; /*panel height*/
};
struct class_interface;
int register_mdp_client(struct class_interface *class_intf);
/**** private client data structs go below this line ***/
+/*
+ * Panel private data, include backlight stuff
+ * 9/28 09', Jay
+ * */
struct panel_data {
- int panel_id;
- u32 caps;
- int shrink;
- /* backlight data */
- u8 *pwm;
- int min_level;
- /* default_br used in turn on backlight, must sync with setting in user space */
- int default_br;
- int (*shrink_br)(int brightness);
- int (*change_cabcmode)(struct msm_mddi_client_data *client_data,
- int mode, u8 dimming);
+ int panel_id;
+ u32 caps;
+ int shrink;
+ /* backlight data */
+ u8 *pwm;
+ int min_level;
+ /* default_br used in turn on backlight, must sync with setting in user space */
+ int default_br;
+ int (*shrink_br)(int brightness);
+ int (*change_cabcmode)(struct msm_mddi_client_data *client_data,
+ int mode, u8 dimming);
};
struct msm_mddi_bridge_platform_data {
@@ -260,29 +280,26 @@ struct msm_mddi_bridge_platform_data {
int (*unblank)(struct msm_mddi_bridge_platform_data *,
struct msm_mddi_client_data *);
int (*shutdown)(struct msm_mddi_bridge_platform_data *,
- struct msm_mddi_client_data *);
+ struct msm_mddi_client_data *);
struct msm_fb_data fb_data;
-
- struct panel_data panel_conf;
- /* for those MDDI client which need to re-position display region
- after each update or static electricity strike. It should be
- implemented in board-xxx-panel due to the function itself need to
- send the screen dimensional info of screen to MDDI client.
- */
- void (*adjust)(struct msm_mddi_client_data *);
+ struct panel_data panel_conf;
+ /* for those MDDI client which need to re-position display region
+ after each update or static electricity strike. It should be
+ implemented in board-xxx-panel due to the function itself need to
+ send the screen dimensional info of screen to MDDI client.
+ */
+ void (*adjust)(struct msm_mddi_client_data *);
#define SAMSUNG_D 0
#define SAMSUNG_S6 1
- int bridge_type;
- int panel_type;
-
- /* board file will identify what capabilities the panel supports */
- uint32_t panel_caps;
- /* backlight data */
- u8 *pwm;
+ int bridge_type;
+ int panel_type;
+ uint32_t caps;
+ /* backlight data */
+ u8 *pwm;
};
/*
- * This is used to communicate event between msm_fb, mddi, mddi_client,
+ * This is used to communicate event between msm_fb, mddi, mddi_client,
* and board.
* It's mainly used to reset the display system.
* Also, it is used for battery power policy.
@@ -294,12 +311,24 @@ struct msm_mddi_bridge_platform_data {
extern int register_display_notifier(struct notifier_block *nb);
extern int display_notifier_call_chain(unsigned long val, void *data);
-
+
#define display_notifier(fn, pri) { \
- static struct notifier_block fn##_nb = \
- { .notifier_call = fn, .priority = pri }; \
- register_display_notifier(&fn##_nb); \
+ static struct notifier_block fn##_nb = \
+ { .notifier_call = fn, .priority = pri }; \
+ register_display_notifier(&fn##_nb); \
}
+#if (defined(CONFIG_USB_FUNCTION_PROJECTOR) || defined(CONFIG_USB_ANDROID_PROJECTOR))
+/* For USB Projector to quick access the frame buffer info */
+struct msm_fb_info {
+ unsigned char *fb_addr;
+ int msmfb_area;
+ int xres;
+ int yres;
+};
+
+extern int msmfb_get_var(struct msm_fb_info *tmp);
+extern int msmfb_get_fb_area(void);
+#endif
#endif
@@ -40,34 +40,6 @@
#define HDMI_DBG(s...) do {} while (0)
#endif
-struct mdp_lcdc_info {
- struct mdp_info *mdp;
- struct clk *mdp_clk;
- struct clk *pclk;
- struct clk *pad_pclk;
- struct msm_panel_data fb_panel_data;
- struct platform_device fb_pdev;
- struct msm_lcdc_platform_data *pdata;
- uint32_t fb_start;
-
- struct msmfb_callback frame_start_cb;
- wait_queue_head_t vsync_waitq;
- int got_vsync;
-
- struct {
- uint32_t clk_rate;
- uint32_t hsync_ctl;
- uint32_t vsync_period;
- uint32_t vsync_pulse_width;
- uint32_t display_hctl;
- uint32_t display_vstart;
- uint32_t display_vend;
- uint32_t hsync_skew;
- uint32_t polarity;
- } parms;
- atomic_t blank_count;
- struct mutex blank_lock;
-};
struct mdp_lcdc_info *_lcdc;
static struct mdp_device *mdp_dev;
Oops, something went wrong.

0 comments on commit 2eaad42

Please sign in to comment.