[PATCH v4 10/14] drm: amdgpu: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()

Daniel Vetter daniel at ffwll.ch
Wed Sep 21 12:46:07 UTC 2016


On Wed, Sep 21, 2016 at 2:39 PM, Laurent Pinchart
<laurent.pinchart at ideasonboard.com> wrote:
>> > @@ -82,7 +82,7 @@ int amdgpu_align_pitch(struct amdgpu_device *adev, int
>> > width, int bpp, bool tile
>> >     aligned += pitch_mask;
>> >     aligned &= ~pitch_mask;
>> >
>> > -   return aligned;
>> > +   return aligned * cpp;
>>
>> Now you multiply by cpp after the rounding.
>
> That's right, but I don't think that's a problem, as all bpp values returned
> by drm_fb_get_bpp_depth() are multiple of 8 bits.

Before we have ALIGN(width * cpp, pitch_mask + 1). With your patch we
have ALIGN(width, pitch_mask + 1) * cpp. In short we overalign, and
instead of e.g. aligning to 256bytes we now align to 256*4 (for
xrgb8888).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list