Søren Sandmann <sandm...@cs.au.dk> writes: > From: Søren Sandmann Pedersen <s...@redhat.com> > > The fb layer of X can't deal with strides that are not a multiple of > 4, so when Xephyr allocates its own framebuffer it should make sure to > align it. > > This fixes crashes and rendering corruption when Xephyr runs in a > depth that is different from the host X server and its screen size is > not a multiple of 4 / depth. (This is particularly easy to trigger if > you use the -resizeable option). > --- > hw/kdrive/ephyr/hostx.c | 15 ++++++++------- > 1 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c > index 86f3679..b547525 100644 > --- a/hw/kdrive/ephyr/hostx.c > +++ b/hw/kdrive/ephyr/hostx.c > @@ -719,12 +719,14 @@ hostx_screen_init(KdScreenInfo *screen, > return scrpriv->ximg->data; > } > else { > - *bytes_per_line = width * (scrpriv->server_depth >> 3); > + int Bpp = scrpriv->server_depth >> 3;
It took me a moment to figure out that 'B' was probaby capitalized to mean bytes as opposed to bits. I prefer the bytes_per_pixel naming in the other hunk if you feel the units need clarification here. > + int stride = (width * Bpp + 0x3) & ~0x3; > + trailing whitespace > + *bytes_per_line = stride; > *bits_per_pixel = scrpriv->server_depth; Other than the whitespace, these two patches are: Reviewed-by: Eric Anholt <e...@anholt.net>
pgpGPTqqNhHbn.pgp
Description: PGP signature
_______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel