Lines Matching full:layer
82 * struct zynqmp_disp_layer_dma - DMA channel for one data plane of a layer
94 * struct zynqmp_disp_layer_info - Static layer information
106 * struct zynqmp_disp_layer - Display layer
107 * @id: Layer ID
109 * @info: Static layer information
187 /* List of video layer formats */
292 /* List of graphics layer formats */
367 static bool zynqmp_disp_layer_is_video(const struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_is_video() argument
369 return layer->id == ZYNQMP_DPSUB_LAYER_VID; in zynqmp_disp_layer_is_video()
373 * zynqmp_disp_avbuf_set_format - Set the input format for a layer
375 * @layer: The layer
378 * Set the video buffer manager format for @layer to @fmt.
381 struct zynqmp_disp_layer *layer, in zynqmp_disp_avbuf_set_format() argument
388 val &= zynqmp_disp_layer_is_video(layer) in zynqmp_disp_avbuf_set_format()
395 unsigned int reg = zynqmp_disp_layer_is_video(layer) in zynqmp_disp_avbuf_set_format()
509 * zynqmp_disp_avbuf_enable_video - Enable a video layer
511 * @layer: The layer
513 * Enable the video/graphics buffer for @layer.
516 struct zynqmp_disp_layer *layer) in zynqmp_disp_avbuf_enable_video() argument
521 if (zynqmp_disp_layer_is_video(layer)) { in zynqmp_disp_avbuf_enable_video()
523 if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) in zynqmp_disp_avbuf_enable_video()
530 if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) in zynqmp_disp_avbuf_enable_video()
539 * zynqmp_disp_avbuf_disable_video - Disable a video layer
541 * @layer: The layer
543 * Disable the video/graphics buffer for @layer.
546 struct zynqmp_disp_layer *layer) in zynqmp_disp_avbuf_disable_video() argument
551 if (zynqmp_disp_layer_is_video(layer)) { in zynqmp_disp_avbuf_disable_video()
711 * zynqmp_disp_blend_layer_set_csc - Configure colorspace conversion for layer
713 * @layer: The layer
717 * Configure the input colorspace conversion matrix and offsets for the @layer.
722 struct zynqmp_disp_layer *layer, in zynqmp_disp_blend_layer_set_csc() argument
730 if (layer->disp_fmt->swap) { in zynqmp_disp_blend_layer_set_csc()
731 if (layer->drm_fmt->is_yuv) { in zynqmp_disp_blend_layer_set_csc()
742 if (zynqmp_disp_layer_is_video(layer)) in zynqmp_disp_blend_layer_set_csc()
753 if (zynqmp_disp_layer_is_video(layer)) in zynqmp_disp_blend_layer_set_csc()
763 * zynqmp_disp_blend_layer_enable - Enable a layer
765 * @layer: The layer
768 struct zynqmp_disp_layer *layer) in zynqmp_disp_blend_layer_enable() argument
774 val = (layer->drm_fmt->is_yuv ? in zynqmp_disp_blend_layer_enable()
776 (layer->drm_fmt->hsub > 1 ? in zynqmp_disp_blend_layer_enable()
780 ZYNQMP_DISP_V_BLEND_LAYER_CONTROL(layer->id), in zynqmp_disp_blend_layer_enable()
783 if (layer->drm_fmt->is_yuv) { in zynqmp_disp_blend_layer_enable()
791 zynqmp_disp_blend_layer_set_csc(disp, layer, coeffs, offsets); in zynqmp_disp_blend_layer_enable()
795 * zynqmp_disp_blend_layer_disable - Disable a layer
797 * @layer: The layer
800 struct zynqmp_disp_layer *layer) in zynqmp_disp_blend_layer_disable() argument
803 ZYNQMP_DISP_V_BLEND_LAYER_CONTROL(layer->id), in zynqmp_disp_blend_layer_disable()
806 zynqmp_disp_blend_layer_set_csc(disp, layer, csc_zero_matrix, in zynqmp_disp_blend_layer_disable()
847 * ZynqMP Display Layer & DRM Plane
852 * @layer: The layer
856 * format @drm_fmt for the @layer, and return a pointer to the format
862 zynqmp_disp_layer_find_format(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_find_format() argument
867 for (i = 0; i < layer->info->num_formats; i++) { in zynqmp_disp_layer_find_format()
868 if (layer->info->formats[i].drm_fmt == drm_fmt) in zynqmp_disp_layer_find_format()
869 return &layer->info->formats[i]; in zynqmp_disp_layer_find_format()
876 * zynqmp_disp_layer_drm_formats - Return the DRM formats supported by the layer
877 * @layer: The layer
881 * supported by the layer. The number of formats in the array is returned
884 u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_drm_formats() argument
890 formats = kcalloc(layer->info->num_formats, sizeof(*formats), in zynqmp_disp_layer_drm_formats()
895 for (i = 0; i < layer->info->num_formats; ++i) in zynqmp_disp_layer_drm_formats()
896 formats[i] = layer->info->formats[i].drm_fmt; in zynqmp_disp_layer_drm_formats()
898 *num_formats = layer->info->num_formats; in zynqmp_disp_layer_drm_formats()
903 * zynqmp_disp_layer_enable - Enable a layer
904 * @layer: The layer
905 * @mode: Operating mode of layer
907 * Enable the @layer in the audio/video buffer manager and the blender. DMA
910 void zynqmp_disp_layer_enable(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_enable() argument
913 layer->mode = mode; in zynqmp_disp_layer_enable()
914 zynqmp_disp_avbuf_enable_video(layer->disp, layer); in zynqmp_disp_layer_enable()
915 zynqmp_disp_blend_layer_enable(layer->disp, layer); in zynqmp_disp_layer_enable()
919 * zynqmp_disp_layer_disable - Disable the layer
920 * @layer: The layer
922 * Disable the layer by stopping its DMA channels and disabling it in the
925 void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_disable() argument
929 if (layer->disp->dpsub->dma_enabled) { in zynqmp_disp_layer_disable()
930 for (i = 0; i < layer->drm_fmt->num_planes; i++) in zynqmp_disp_layer_disable()
931 dmaengine_terminate_sync(layer->dmas[i].chan); in zynqmp_disp_layer_disable()
934 zynqmp_disp_avbuf_disable_video(layer->disp, layer); in zynqmp_disp_layer_disable()
935 zynqmp_disp_blend_layer_disable(layer->disp, layer); in zynqmp_disp_layer_disable()
939 * zynqmp_disp_layer_set_format - Set the layer format
940 * @layer: The layer
943 * Set the format for @layer to @info. The layer must be disabled.
945 void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_set_format() argument
950 layer->disp_fmt = zynqmp_disp_layer_find_format(layer, info->format); in zynqmp_disp_layer_set_format()
951 layer->drm_fmt = info; in zynqmp_disp_layer_set_format()
953 zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); in zynqmp_disp_layer_set_format()
955 if (!layer->disp->dpsub->dma_enabled) in zynqmp_disp_layer_set_format()
963 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_set_format()
978 * zynqmp_disp_layer_update - Update the layer framebuffer
979 * @layer: The layer
982 * Update the framebuffer for the layer by issuing a new DMA engine transaction
987 int zynqmp_disp_layer_update(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_update() argument
990 const struct drm_format_info *info = layer->drm_fmt; in zynqmp_disp_layer_update()
993 if (!layer->disp->dpsub->dma_enabled) in zynqmp_disp_layer_update()
999 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_update()
1019 dev_err(layer->disp->dev, in zynqmp_disp_layer_update()
1032 * zynqmp_disp_layer_release_dma - Release DMA channels for a layer
1034 * @layer: The layer
1036 * Release the DMA channels associated with @layer.
1039 struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_release_dma() argument
1043 if (!layer->info || !disp->dpsub->dma_enabled) in zynqmp_disp_layer_release_dma()
1046 for (i = 0; i < layer->info->num_channels; i++) { in zynqmp_disp_layer_release_dma()
1047 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_release_dma()
1071 * zynqmp_disp_layer_request_dma - Request DMA channels for a layer
1073 * @layer: The layer
1075 * Request all DMA engine channels needed by @layer.
1080 struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_request_dma() argument
1089 for (i = 0; i < layer->info->num_channels; i++) { in zynqmp_disp_layer_request_dma()
1090 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_request_dma()
1094 "%s%u", dma_names[layer->id], i); in zynqmp_disp_layer_request_dma()
1132 struct zynqmp_disp_layer *layer = &disp->layers[i]; in zynqmp_disp_create_layers() local
1134 layer->id = i; in zynqmp_disp_create_layers()
1135 layer->disp = disp; in zynqmp_disp_create_layers()
1136 layer->info = &layer_info[i]; in zynqmp_disp_create_layers()
1138 ret = zynqmp_disp_layer_request_dma(disp, layer); in zynqmp_disp_create_layers()
1142 disp->dpsub->layers[i] = layer; in zynqmp_disp_create_layers()
1263 struct zynqmp_disp_layer *layer; in zynqmp_disp_probe() local
1265 layer = &disp->layers[ZYNQMP_DPSUB_LAYER_VID]; in zynqmp_disp_probe()
1266 dpsub->dma_align = 1 << layer->dmas[0].chan->device->copy_align; in zynqmp_disp_probe()