Loading drivers/video/msm/mdss/mdss_mdp_wb.c +32 −0 Original line number Diff line number Diff line Loading @@ -60,11 +60,14 @@ struct mdss_mdp_wb_data { struct msmfb_data buf_info; struct mdss_mdp_data buf_data; int state; bool user_alloc; }; static DEFINE_MUTEX(mdss_mdp_wb_buf_lock); static struct mdss_mdp_wb mdss_mdp_wb_info; static void mdss_mdp_wb_free_node(struct mdss_mdp_wb_data *node); #ifdef DEBUG_WRITEBACK /* for debugging: writeback output buffer to allocated memory */ static inline Loading Loading @@ -249,6 +252,7 @@ static int mdss_mdp_wb_terminate(struct msm_fb_data_type *mfd) struct mdss_mdp_wb_data *node, *temp; list_for_each_entry_safe(node, temp, &wb->register_queue, registered_entry) { mdss_mdp_wb_free_node(node); list_del(&node->registered_entry); kfree(node); } Loading Loading @@ -365,12 +369,24 @@ static struct mdss_mdp_wb_data *get_user_node(struct msm_fb_data_type *mfd, struct mdss_mdp_img_data *buf; int ret; if (!list_empty(&wb->register_queue)) { list_for_each_entry(node, &wb->register_queue, registered_entry) if ((node->buf_info.memory_id == data->memory_id) && (node->buf_info.offset == data->offset)) { pr_debug("found node fd=%x off=%x addr=%x\n", data->memory_id, data->offset, node->buf_data.p[0].addr); return node; } } node = kzalloc(sizeof(struct mdss_mdp_wb_data), GFP_KERNEL); if (node == NULL) { pr_err("out of memory\n"); return NULL; } node->user_alloc = true; node->buf_data.num_planes = 1; buf = &node->buf_data.p[0]; if (wb->is_secure) Loading Loading @@ -398,6 +414,22 @@ register_fail: return NULL; } static void mdss_mdp_wb_free_node(struct mdss_mdp_wb_data *node) { struct mdss_mdp_img_data *buf; if (node->user_alloc) { buf = &node->buf_data.p[0]; pr_debug("free user node mem_id=%d offset=%u addr=0x%x\n", node->buf_info.memory_id, node->buf_info.offset, buf->addr); mdss_mdp_put_img(&node->buf_data.p[0]); node->user_alloc = false; } } static int mdss_mdp_wb_queue(struct msm_fb_data_type *mfd, struct msmfb_data *data, int local) { Loading Loading
drivers/video/msm/mdss/mdss_mdp_wb.c +32 −0 Original line number Diff line number Diff line Loading @@ -60,11 +60,14 @@ struct mdss_mdp_wb_data { struct msmfb_data buf_info; struct mdss_mdp_data buf_data; int state; bool user_alloc; }; static DEFINE_MUTEX(mdss_mdp_wb_buf_lock); static struct mdss_mdp_wb mdss_mdp_wb_info; static void mdss_mdp_wb_free_node(struct mdss_mdp_wb_data *node); #ifdef DEBUG_WRITEBACK /* for debugging: writeback output buffer to allocated memory */ static inline Loading Loading @@ -249,6 +252,7 @@ static int mdss_mdp_wb_terminate(struct msm_fb_data_type *mfd) struct mdss_mdp_wb_data *node, *temp; list_for_each_entry_safe(node, temp, &wb->register_queue, registered_entry) { mdss_mdp_wb_free_node(node); list_del(&node->registered_entry); kfree(node); } Loading Loading @@ -365,12 +369,24 @@ static struct mdss_mdp_wb_data *get_user_node(struct msm_fb_data_type *mfd, struct mdss_mdp_img_data *buf; int ret; if (!list_empty(&wb->register_queue)) { list_for_each_entry(node, &wb->register_queue, registered_entry) if ((node->buf_info.memory_id == data->memory_id) && (node->buf_info.offset == data->offset)) { pr_debug("found node fd=%x off=%x addr=%x\n", data->memory_id, data->offset, node->buf_data.p[0].addr); return node; } } node = kzalloc(sizeof(struct mdss_mdp_wb_data), GFP_KERNEL); if (node == NULL) { pr_err("out of memory\n"); return NULL; } node->user_alloc = true; node->buf_data.num_planes = 1; buf = &node->buf_data.p[0]; if (wb->is_secure) Loading Loading @@ -398,6 +414,22 @@ register_fail: return NULL; } static void mdss_mdp_wb_free_node(struct mdss_mdp_wb_data *node) { struct mdss_mdp_img_data *buf; if (node->user_alloc) { buf = &node->buf_data.p[0]; pr_debug("free user node mem_id=%d offset=%u addr=0x%x\n", node->buf_info.memory_id, node->buf_info.offset, buf->addr); mdss_mdp_put_img(&node->buf_data.p[0]); node->user_alloc = false; } } static int mdss_mdp_wb_queue(struct msm_fb_data_type *mfd, struct msmfb_data *data, int local) { Loading