Commit 54b2a433 authored by Sebastian Bauer's avatar Sebastian Bauer Committed by David Gibson
Browse files

sm501: Use values from the pitch register for 2D operations



Before, crt_h_total was used for src_width and dst_width. This is a
property of the current display setting and not relevant for the 2D
operation that also can be done off-screen. The pitch register's purpose
is to describe line pitch relevant of the 2D operation.

Signed-off-by: default avatarSebastian Bauer <mail@sebastianbauer.info>
Signed-off-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent d2733559
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -709,8 +709,8 @@ static void sm501_2d_operation(SM501State *s)
    /* get frame buffer info */
    uint8_t *src = s->local_mem + (s->twoD_source_base & 0x03FFFFFF);
    uint8_t *dst = s->local_mem + (s->twoD_destination_base & 0x03FFFFFF);
    int src_width = (s->dc_crt_h_total & 0x00000FFF) + 1;
    int dst_width = (s->dc_crt_h_total & 0x00000FFF) + 1;
    int src_width = s->twoD_pitch & 0x1FFF;
    int dst_width = (s->twoD_pitch >> 16) & 0x1FFF;

    if (addressing != 0x0) {
        printf("%s: only XY addressing is supported.\n", __func__);