Skip to content

Commit

Permalink
drm: xilinx: Fix case wherein manager plane dts setting was ignored
Browse files Browse the repository at this point in the history
In the case wherein the DRM driver is used to control only a dma
channel, it is possible that the dma channel may support multiple
pixel memory formats (i.e. Video Framebuffer).  In such cases, when
initializing the DRM device, we wish to use the plane manager video
format specified in the device tree as the default selection when
there is more than one possible pixel format supported by the attached
dma channel.

Signed-off-by: Jeffrey Mouroux <[email protected]>
  • Loading branch information
jmouroux committed Nov 29, 2017
1 parent 15c99dc commit 820c634
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions drivers/gpu/drm/xilinx/xilinx_drm_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,12 +927,24 @@ xilinx_drm_plane_create(struct xilinx_drm_plane_manager *manager,
if (plane->format == 0) {
ret = xilinx_xdma_get_drm_vid_fmts(plane->dma[0].chan,
&num_fmts, &fmts);
if (!ret) {
int i;

/* If there's no IP other than VDMA pick the manager's format */
if (ret)
plane->format = manager->format;
else
plane->format = fmts[0];
for (i = 0; i < num_fmts; i++) {
if (fmts[i] != manager->format)
continue;

break;
}

if (i < num_fmts) {
plane->format = manager->format;
} else {
DRM_ERROR("No dma support for drm mgr fmt %x\n",
manager->format);
return ERR_PTR(-EINVAL);
}
}
}

/* initialize drm plane */
Expand Down

0 comments on commit 820c634

Please sign in to comment.