Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/rockchip rkvop: set stride using virtual frameb...



details:   https://anonhg.NetBSD.org/src/rev/b5c47286f744
branches:  trunk
changeset: 1005710:b5c47286f744
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Tue Dec 17 18:30:51 2019 +0000

description:
rkvop: set stride using virtual framebuffer width instead of display mode

diffstat:

 sys/arch/arm/rockchip/rk_vop.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r 61def5e14faa -r b5c47286f744 sys/arch/arm/rockchip/rk_vop.c
--- a/sys/arch/arm/rockchip/rk_vop.c    Tue Dec 17 18:26:36 2019 +0000
+++ b/sys/arch/arm/rockchip/rk_vop.c    Tue Dec 17 18:30:51 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_vop.c,v 1.4 2019/12/17 18:26:36 jakllsch Exp $ */
+/* $NetBSD: rk_vop.c,v 1.5 2019/12/17 18:30:51 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.4 2019/12/17 18:26:36 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.5 2019/12/17 18:30:51 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -236,8 +236,15 @@
 
        uint64_t paddr = (uint64_t)sfb->obj->dmamap->dm_segs[0].ds_addr;
 
+       paddr += y * sfb->base.pitches[0];
+       paddr += x * drm_format_plane_cpp(sfb->base.pixel_format, 0);
+
        KASSERT((paddr & ~0xffffffff) == 0);
 
+       const uint32_t vir = __SHIFTIN(sfb->base.pitches[0] / 4,
+           WIN0_VIR_STRIDE);
+       WR4(sc, VOP_WIN0_VIR, vir);
+
        /* Framebuffer start address */
        WR4(sc, VOP_WIN0_YRGB_MST, (uint32_t)paddr);
 
@@ -309,9 +316,6 @@
 
        WR4(sc, VOP_WIN0_COLOR_KEY, 0);
 
-       val = __SHIFTIN(hactive, WIN0_VIR_STRIDE);
-       WR4(sc, VOP_WIN0_VIR, val);
-
        if (adjusted_mode->hdisplay > 2560)
                lb_mode = WIN0_LB_MODE_RGB_3840X2;
        else if (adjusted_mode->hdisplay > 1920)



Home | Main Index | Thread Index | Old Index