OSDN Git Service

drm/amd/display: Respect DRM framebuffer info for video surfaces
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Wed, 13 Mar 2019 16:35:20 +0000 (12:35 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 21 Mar 2019 04:39:47 +0000 (23:39 -0500)
commit1791e54f0121ad9733c5b8f42cd7d1604e4f07a5
tree62a9a3bdec5da723a63e66f805ee0137ca632487
parent98ae7f98d44b61479599ec49257ccb8abd92d092
drm/amd/display: Respect DRM framebuffer info for video surfaces

[Why]
Incorrect hardcoded assumptions are made regarding luma and chroma
alignment. The actual values set for the DRM framebuffer should be used
when programming the address.

[How]
Respect the given pitch for both luma and chroma planes - it's not like
we can force the alignment to anything else at this point anyway.

Use the FB offset for the chroma planes directly. DRM already
provides this to us so there's no need to calculate it manually.

While we don't actually use the chroma surface size parameters on Raven,
these should have technically been fb->width / 2 and fb->height / 2
since the chroma plane is half size of the luma plane for NV12.

Leave a TODO indicating that those should be set based on the actual
surface format instead since this is only correct for YUV420 formats.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c