Stride of 800x600 framebuffer

吳翰融 hjwu at sslab.cs.nctu.edu.tw
Mon Oct 13 00:54:29 PDT 2014


Hi all,

I am very new to DRM and radeon driver, There are many concepts of Linux
graphic system I haven't acquired.I am looking help for a question about
drm framebuffer, it might be very simple to you. Why is stride of 800x600
framebuffer is 832*4=3328? Actually the number of pitch 832 is derive from

int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bool
tiled)
{
int aligned = width;
int align_large = (ASIC_IS_AVIVO(rdev)) || tiled;
int pitch_mask = 0;

switch (bpp / 8) {
case 1:
pitch_mask = align_large ? 255 : 127;
break;
case 2:
pitch_mask = align_large ? 127 : 31;
break;
case 3:
case 4:
pitch_mask = align_large ? 63 : 15;
break;
}

aligned += pitch_mask;
aligned &= ~pitch_mask;
return aligned;
}
Why we have to align the pitch? I discover that if I write directly a
800*600 32bpp raw image to /dev/fb0, the image could not be correctly
rendered, since the pitch is 832 instead of 800, however
the  virtualize_size sysfs gave me is 800,600, which is correct.

I am working on an AMD g-series eval board with kernel 3.16.3.

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-driver-ati/attachments/20141013/0378c40c/attachment.html>


More information about the xorg-driver-ati mailing list