Lines Matching +full:dual +full:- +full:link
1 // SPDX-License-Identifier: GPL-2.0
12 /** komeda_pipeline_add - Add a pipeline to &komeda_dev */
19 if (mdev->n_pipelines + 1 > KOMEDA_MAX_PIPELINES) { in komeda_pipeline_add()
22 return ERR_PTR(-ENOSPC); in komeda_pipeline_add()
27 return ERR_PTR(-EINVAL); in komeda_pipeline_add()
30 pipe = devm_kzalloc(mdev->dev, size, GFP_KERNEL); in komeda_pipeline_add()
32 return ERR_PTR(-ENOMEM); in komeda_pipeline_add()
34 pipe->mdev = mdev; in komeda_pipeline_add()
35 pipe->id = mdev->n_pipelines; in komeda_pipeline_add()
36 pipe->funcs = funcs; in komeda_pipeline_add()
38 mdev->pipelines[mdev->n_pipelines] = pipe; in komeda_pipeline_add()
39 mdev->n_pipelines++; in komeda_pipeline_add()
50 dp_for_each_set_bit(i, pipe->avail_comps) { in komeda_pipeline_destroy()
55 clk_put(pipe->pxlclk); in komeda_pipeline_destroy()
57 of_node_put(pipe->of_output_links[0]); in komeda_pipeline_destroy()
58 of_node_put(pipe->of_output_links[1]); in komeda_pipeline_destroy()
59 of_node_put(pipe->of_output_port); in komeda_pipeline_destroy()
60 of_node_put(pipe->of_node); in komeda_pipeline_destroy()
62 devm_kfree(mdev->dev, pipe); in komeda_pipeline_destroy()
68 struct komeda_dev *mdev = pipe->mdev; in komeda_pipeline_get_component_pos()
77 pos = to_cpos(pipe->layers[id - KOMEDA_COMPONENT_LAYER0]); in komeda_pipeline_get_component_pos()
80 pos = to_cpos(pipe->wb_layer); in komeda_pipeline_get_component_pos()
84 temp = mdev->pipelines[id - KOMEDA_COMPONENT_COMPIZ0]; in komeda_pipeline_get_component_pos()
86 DRM_ERROR("compiz-%d doesn't exist.\n", id); in komeda_pipeline_get_component_pos()
89 pos = to_cpos(temp->compiz); in komeda_pipeline_get_component_pos()
93 pos = to_cpos(pipe->scalers[id - KOMEDA_COMPONENT_SCALER0]); in komeda_pipeline_get_component_pos()
96 pos = to_cpos(pipe->splitter); in komeda_pipeline_get_component_pos()
99 pos = to_cpos(pipe->merger); in komeda_pipeline_get_component_pos()
103 temp = mdev->pipelines[id - KOMEDA_COMPONENT_IPS0]; in komeda_pipeline_get_component_pos()
105 DRM_ERROR("ips-%d doesn't exist.\n", id); in komeda_pipeline_get_component_pos()
108 pos = to_cpos(temp->improc); in komeda_pipeline_get_component_pos()
111 pos = to_cpos(pipe->ctrlr); in komeda_pipeline_get_component_pos()
152 u32 avail_inputs = c->supported_inputs & (avail_comps); in komeda_component_pickup_input()
154 return komeda_pipeline_get_first_component(c->pipeline, avail_inputs); in komeda_component_pickup_input()
157 /** komeda_component_add - Add a component to &komeda_pipeline */
173 return ERR_PTR(-ENOSPC); in komeda_component_add()
178 return ERR_PTR(-EINVAL); in komeda_component_add()
181 idx = id - KOMEDA_COMPONENT_LAYER0; in komeda_component_add()
182 num = &pipe->n_layers; in komeda_component_add()
183 if (idx != pipe->n_layers) { in komeda_component_add()
185 return ERR_PTR(-EINVAL); in komeda_component_add()
188 idx = id - KOMEDA_COMPONENT_SCALER0; in komeda_component_add()
189 num = &pipe->n_scalers; in komeda_component_add()
190 if (idx != pipe->n_scalers) { in komeda_component_add()
192 return ERR_PTR(-EINVAL); in komeda_component_add()
196 c = devm_kzalloc(pipe->mdev->dev, comp_sz, GFP_KERNEL); in komeda_component_add()
198 return ERR_PTR(-ENOMEM); in komeda_component_add()
200 c->id = id; in komeda_component_add()
201 c->hw_id = hw_id; in komeda_component_add()
202 c->reg = reg; in komeda_component_add()
203 c->pipeline = pipe; in komeda_component_add()
204 c->max_active_inputs = max_active_inputs; in komeda_component_add()
205 c->max_active_outputs = max_active_outputs; in komeda_component_add()
206 c->supported_inputs = supported_inputs; in komeda_component_add()
207 c->funcs = funcs; in komeda_component_add()
213 vsnprintf(c->name, sizeof(c->name), name_fmt, args); in komeda_component_add()
220 pipe->avail_comps |= BIT(c->id); in komeda_component_add()
229 devm_kfree(mdev->dev, c); in komeda_component_destroy()
237 DRM_DEBUG(" %s: ID %d-0x%08lx.\n", in komeda_component_dump()
238 c->name, c->id, BIT(c->id)); in komeda_component_dump()
240 c->max_active_inputs, c->supported_inputs); in komeda_component_dump()
242 c->max_active_outputs, c->supported_outputs); in komeda_component_dump()
250 DRM_INFO("Pipeline-%d: n_layers: %d, n_scalers: %d, output: %s.\n", in komeda_pipeline_dump()
251 pipe->id, pipe->n_layers, pipe->n_scalers, in komeda_pipeline_dump()
252 pipe->dual_link ? "dual-link" : "single-link"); in komeda_pipeline_dump()
254 pipe->of_output_links[0] ? in komeda_pipeline_dump()
255 pipe->of_output_links[0]->full_name : "none"); in komeda_pipeline_dump()
257 pipe->of_output_links[1] ? in komeda_pipeline_dump()
258 pipe->of_output_links[1]->full_name : "none"); in komeda_pipeline_dump()
260 dp_for_each_set_bit(id, pipe->avail_comps) { in komeda_pipeline_dump()
269 struct komeda_pipeline *pipe = c->pipeline; in komeda_component_verify_inputs()
273 dp_for_each_set_bit(id, c->supported_inputs) { in komeda_component_verify_inputs()
276 c->supported_inputs &= ~(BIT(id)); in komeda_component_verify_inputs()
277 DRM_WARN("Can not find input(ID-%d) for component: %s.\n", in komeda_component_verify_inputs()
278 id, c->name); in komeda_component_verify_inputs()
282 input->supported_outputs |= BIT(c->id); in komeda_component_verify_inputs()
290 int index = left->base.id - KOMEDA_COMPONENT_LAYER0; in komeda_get_layer_split_right_layer()
293 for (i = index + 1; i < pipe->n_layers; i++) in komeda_get_layer_split_right_layer()
294 if (left->layer_type == pipe->layers[i]->layer_type) in komeda_get_layer_split_right_layer()
295 return pipe->layers[i]; in komeda_get_layer_split_right_layer()
305 dp_for_each_set_bit(id, pipe->avail_comps) { in komeda_pipeline_assemble()
310 for (i = 0; i < pipe->n_layers; i++) { in komeda_pipeline_assemble()
311 layer = pipe->layers[i]; in komeda_pipeline_assemble()
313 layer->right = komeda_get_layer_split_right_layer(pipe, layer); in komeda_pipeline_assemble()
316 if (pipe->dual_link && !pipe->ctrlr->supports_dual_link) { in komeda_pipeline_assemble()
317 pipe->dual_link = false; in komeda_pipeline_assemble()
318 DRM_WARN("PIPE-%d doesn't support dual-link, ignore DT dual-link configuration.\n", in komeda_pipeline_assemble()
319 pipe->id); in komeda_pipeline_assemble()
331 slave = komeda_component_pickup_input(&master->compiz->base, in komeda_pipeline_get_slave()
334 return slave ? slave->pipeline : NULL; in komeda_pipeline_get_slave()
342 for (i = 0; i < mdev->n_pipelines; i++) { in komeda_assemble_pipelines()
343 pipe = mdev->pipelines[i]; in komeda_assemble_pipelines()
358 seq_printf(sf, "\n======== Pipeline-%d ==========\n", pipe->id); in komeda_pipeline_dump_register()
360 if (pipe->funcs && pipe->funcs->dump_register) in komeda_pipeline_dump_register()
361 pipe->funcs->dump_register(pipe, sf); in komeda_pipeline_dump_register()
363 dp_for_each_set_bit(id, pipe->avail_comps) { in komeda_pipeline_dump_register()
366 seq_printf(sf, "\n------%s------\n", c->name); in komeda_pipeline_dump_register()
367 if (c->funcs->dump_register) in komeda_pipeline_dump_register()
368 c->funcs->dump_register(c, sf); in komeda_pipeline_dump_register()