Lines Matching full:layer

69  * enum zynqmp_dpsub_layer_mode - Layer mode
95 * struct zynqmp_disp_layer_dma - DMA channel for one data plane of a layer
107 * struct zynqmp_disp_layer_info - Static layer information
119 * struct zynqmp_disp_layer - Display layer
120 * @id: Layer ID
122 * @info: Static layer information
200 /* List of video layer formats */
305 /* List of graphics layer formats */
370 /* List of live video layer formats */
415 static bool zynqmp_disp_layer_is_video(const struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_is_video() argument
417 return layer->id == ZYNQMP_DPSUB_LAYER_VID; in zynqmp_disp_layer_is_video()
421 * zynqmp_disp_avbuf_set_format - Set the input format for a layer
423 * @layer: The layer
426 * Set the video buffer manager format for @layer to @fmt.
429 struct zynqmp_disp_layer *layer, in zynqmp_disp_avbuf_set_format() argument
435 layer->disp_fmt = fmt; in zynqmp_disp_avbuf_set_format()
436 if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) { in zynqmp_disp_avbuf_set_format()
439 val &= zynqmp_disp_layer_is_video(layer) in zynqmp_disp_avbuf_set_format()
445 reg = zynqmp_disp_layer_is_video(layer) in zynqmp_disp_avbuf_set_format()
453 reg = zynqmp_disp_layer_is_video(layer) in zynqmp_disp_avbuf_set_format()
567 * zynqmp_disp_avbuf_enable_video - Enable a video layer
569 * @layer: The layer
571 * Enable the video/graphics buffer for @layer.
574 struct zynqmp_disp_layer *layer) in zynqmp_disp_avbuf_enable_video() argument
579 if (zynqmp_disp_layer_is_video(layer)) { in zynqmp_disp_avbuf_enable_video()
581 if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) in zynqmp_disp_avbuf_enable_video()
588 if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) in zynqmp_disp_avbuf_enable_video()
597 * zynqmp_disp_avbuf_disable_video - Disable a video layer
599 * @layer: The layer
601 * Disable the video/graphics buffer for @layer.
604 struct zynqmp_disp_layer *layer) in zynqmp_disp_avbuf_disable_video() argument
609 if (zynqmp_disp_layer_is_video(layer)) { in zynqmp_disp_avbuf_disable_video()
769 * zynqmp_disp_blend_layer_set_csc - Configure colorspace conversion for layer
771 * @layer: The layer
775 * Configure the input colorspace conversion matrix and offsets for the @layer.
780 struct zynqmp_disp_layer *layer, in zynqmp_disp_blend_layer_set_csc() argument
788 if (layer->disp_fmt->swap) { in zynqmp_disp_blend_layer_set_csc()
789 if (layer->drm_fmt->is_yuv) { in zynqmp_disp_blend_layer_set_csc()
800 if (zynqmp_disp_layer_is_video(layer)) in zynqmp_disp_blend_layer_set_csc()
811 if (zynqmp_disp_layer_is_video(layer)) in zynqmp_disp_blend_layer_set_csc()
821 * zynqmp_disp_blend_layer_enable - Enable a layer
823 * @layer: The layer
826 struct zynqmp_disp_layer *layer) in zynqmp_disp_blend_layer_enable() argument
832 val = (layer->drm_fmt->is_yuv ? in zynqmp_disp_blend_layer_enable()
834 (layer->drm_fmt->hsub > 1 ? in zynqmp_disp_blend_layer_enable()
838 ZYNQMP_DISP_V_BLEND_LAYER_CONTROL(layer->id), in zynqmp_disp_blend_layer_enable()
841 if (layer->drm_fmt->is_yuv) { in zynqmp_disp_blend_layer_enable()
849 zynqmp_disp_blend_layer_set_csc(disp, layer, coeffs, offsets); in zynqmp_disp_blend_layer_enable()
853 * zynqmp_disp_blend_layer_disable - Disable a layer
855 * @layer: The layer
858 struct zynqmp_disp_layer *layer) in zynqmp_disp_blend_layer_disable() argument
861 ZYNQMP_DISP_V_BLEND_LAYER_CONTROL(layer->id), in zynqmp_disp_blend_layer_disable()
864 zynqmp_disp_blend_layer_set_csc(disp, layer, csc_zero_matrix, in zynqmp_disp_blend_layer_disable()
905 * ZynqMP Display Layer & DRM Plane
910 * @layer: The layer
914 * format @drm_fmt for the @layer, and return a pointer to the format
920 zynqmp_disp_layer_find_format(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_find_format() argument
925 for (i = 0; i < layer->info->num_formats; i++) { in zynqmp_disp_layer_find_format()
926 if (layer->info->formats[i].drm_fmt == drm_fmt) in zynqmp_disp_layer_find_format()
927 return &layer->info->formats[i]; in zynqmp_disp_layer_find_format()
936 * @layer: The layer
940 * bus format @media_bus_format for the @layer, and return a pointer to the
946 zynqmp_disp_layer_find_live_format(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_find_live_format() argument
951 for (i = 0; i < layer->info->num_formats; i++) in zynqmp_disp_layer_find_live_format()
952 if (layer->info->formats[i].bus_fmt == media_bus_format) in zynqmp_disp_layer_find_live_format()
953 return &layer->info->formats[i]; in zynqmp_disp_layer_find_live_format()
959 * zynqmp_disp_layer_drm_formats - Return the DRM formats supported by the layer
960 * @layer: The layer
966 * video input layer.
969 * supported by the layer. The number of formats in the array is returned
972 u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_drm_formats() argument
978 if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_NONLIVE)) { in zynqmp_disp_layer_drm_formats()
983 formats = kcalloc(layer->info->num_formats, sizeof(*formats), in zynqmp_disp_layer_drm_formats()
990 for (i = 0; i < layer->info->num_formats; ++i) in zynqmp_disp_layer_drm_formats()
991 formats[i] = layer->info->formats[i].drm_fmt; in zynqmp_disp_layer_drm_formats()
993 *num_formats = layer->info->num_formats; in zynqmp_disp_layer_drm_formats()
999 * the live video layer
1000 * @layer: The layer
1006 * layer. The number of formats in the array is returned through the
1009 u32 *zynqmp_disp_live_layer_formats(struct zynqmp_disp_layer *layer, in zynqmp_disp_live_layer_formats() argument
1015 if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_LIVE)) { in zynqmp_disp_live_layer_formats()
1020 formats = kcalloc(layer->info->num_formats, sizeof(*formats), in zynqmp_disp_live_layer_formats()
1027 for (i = 0; i < layer->info->num_formats; ++i) in zynqmp_disp_live_layer_formats()
1028 formats[i] = layer->info->formats[i].bus_fmt; in zynqmp_disp_live_layer_formats()
1030 *num_formats = layer->info->num_formats; in zynqmp_disp_live_layer_formats()
1035 * zynqmp_disp_layer_enable - Enable a layer
1036 * @layer: The layer
1038 * Enable the @layer in the audio/video buffer manager and the blender. DMA
1041 void zynqmp_disp_layer_enable(struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_enable() argument
1043 zynqmp_disp_avbuf_enable_video(layer->disp, layer); in zynqmp_disp_layer_enable()
1044 zynqmp_disp_blend_layer_enable(layer->disp, layer); in zynqmp_disp_layer_enable()
1048 * zynqmp_disp_layer_disable - Disable the layer
1049 * @layer: The layer
1051 * Disable the layer by stopping its DMA channels and disabling it in the
1054 void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_disable() argument
1058 if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) { in zynqmp_disp_layer_disable()
1059 for (i = 0; i < layer->drm_fmt->num_planes; i++) in zynqmp_disp_layer_disable()
1060 dmaengine_terminate_sync(layer->dmas[i].chan); in zynqmp_disp_layer_disable()
1063 zynqmp_disp_avbuf_disable_video(layer->disp, layer); in zynqmp_disp_layer_disable()
1064 zynqmp_disp_blend_layer_disable(layer->disp, layer); in zynqmp_disp_layer_disable()
1068 * zynqmp_disp_layer_set_format - Set the layer format
1069 * @layer: The layer
1075 * Set the format for @layer to @info. The layer must be disabled.
1077 void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_set_format() argument
1082 if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_NONLIVE)) in zynqmp_disp_layer_set_format()
1085 layer->disp_fmt = zynqmp_disp_layer_find_format(layer, info->format); in zynqmp_disp_layer_set_format()
1086 if (WARN_ON(!layer->disp_fmt)) in zynqmp_disp_layer_set_format()
1088 layer->drm_fmt = info; in zynqmp_disp_layer_set_format()
1090 zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); in zynqmp_disp_layer_set_format()
1097 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_set_format()
1112 * zynqmp_disp_layer_set_live_format - Set the live video layer format
1113 * @layer: The layer
1117 * layer. Use zynqmp_disp_layer_set_format() instead.
1119 * Set the display format for the live @layer. The layer must be disabled.
1121 void zynqmp_disp_layer_set_live_format(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_set_live_format() argument
1124 if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_LIVE)) in zynqmp_disp_layer_set_live_format()
1127 layer->disp_fmt = zynqmp_disp_layer_find_live_format(layer, in zynqmp_disp_layer_set_live_format()
1129 if (WARN_ON(!layer->disp_fmt)) in zynqmp_disp_layer_set_live_format()
1132 zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); in zynqmp_disp_layer_set_live_format()
1134 layer->drm_fmt = drm_format_info(layer->disp_fmt->drm_fmt); in zynqmp_disp_layer_set_live_format()
1138 * zynqmp_disp_layer_update - Update the layer framebuffer
1139 * @layer: The layer
1142 * Update the framebuffer for the layer by issuing a new DMA engine transaction
1147 int zynqmp_disp_layer_update(struct zynqmp_disp_layer *layer, in zynqmp_disp_layer_update() argument
1150 const struct drm_format_info *info = layer->drm_fmt; in zynqmp_disp_layer_update()
1153 if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) in zynqmp_disp_layer_update()
1159 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_update()
1179 dev_err(layer->disp->dev, in zynqmp_disp_layer_update()
1192 * zynqmp_disp_layer_release_dma - Release DMA channels for a layer
1194 * @layer: The layer
1196 * Release the DMA channels associated with @layer.
1199 struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_release_dma() argument
1203 for (i = 0; i < layer->info->num_channels; i++) { in zynqmp_disp_layer_release_dma()
1204 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_release_dma()
1228 * zynqmp_disp_layer_request_dma - Request DMA channels for a layer
1230 * @layer: The layer
1232 * Request all DMA engine channels needed by @layer.
1237 struct zynqmp_disp_layer *layer) in zynqmp_disp_layer_request_dma() argument
1243 for (i = 0; i < layer->info->num_channels; i++) { in zynqmp_disp_layer_request_dma()
1244 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; in zynqmp_disp_layer_request_dma()
1248 "%s%u", dma_names[layer->id], i); in zynqmp_disp_layer_request_dma()
1291 struct zynqmp_disp_layer *layer = &disp->layers[i]; in zynqmp_disp_create_layers() local
1293 layer->id = i; in zynqmp_disp_create_layers()
1294 layer->disp = disp; in zynqmp_disp_create_layers()
1300 layer->mode = ZYNQMP_DPSUB_LAYER_NONLIVE; in zynqmp_disp_create_layers()
1301 layer->info = &layer_info[i]; in zynqmp_disp_create_layers()
1303 layer->mode = ZYNQMP_DPSUB_LAYER_LIVE; in zynqmp_disp_create_layers()
1304 layer->info = &live_layer_info; in zynqmp_disp_create_layers()
1307 ret = zynqmp_disp_layer_request_dma(disp, layer); in zynqmp_disp_create_layers()
1311 disp->dpsub->layers[i] = layer; in zynqmp_disp_create_layers()
1432 struct zynqmp_disp_layer *layer; in zynqmp_disp_probe() local
1434 layer = &disp->layers[ZYNQMP_DPSUB_LAYER_VID]; in zynqmp_disp_probe()
1435 dpsub->dma_align = 1 << layer->dmas[0].chan->device->copy_align; in zynqmp_disp_probe()