Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/nvidia Fix regression introduced by myself with...



details:   https://anonhg.NetBSD.org/src/rev/67f1c1a4d2e0
branches:  trunk
changeset: 349645:67f1c1a4d2e0
user:      maya <maya%NetBSD.org@localhost>
date:      Sat Dec 17 12:11:38 2016 +0000

description:
Fix regression introduced by myself with the addition of da_fb_linebytes

tegra_fb was not adjusted so da_fb_linebytes was used uninitialized

add tfa_fb_linebytes and match radeonfb/nouveaufb code in how we set it
switch to using an initializer to hopefully avoid future errors

this change doesn't need to be pulled up, as tegra_fb.c is absent
in netbsd-7

diffstat:

 sys/arch/arm/nvidia/tegra_drm.h    |   3 ++-
 sys/arch/arm/nvidia/tegra_drm_fb.c |   5 +++--
 sys/arch/arm/nvidia/tegra_fb.c     |  18 ++++++++++--------
 3 files changed, 15 insertions(+), 11 deletions(-)

diffs (89 lines):

diff -r 47e9b756b70c -r 67f1c1a4d2e0 sys/arch/arm/nvidia/tegra_drm.h
--- a/sys/arch/arm/nvidia/tegra_drm.h   Sat Dec 17 10:25:49 2016 +0000
+++ b/sys/arch/arm/nvidia/tegra_drm.h   Sat Dec 17 12:11:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_drm.h,v 1.6 2015/12/22 22:10:36 jmcneill Exp $ */
+/* $NetBSD: tegra_drm.h,v 1.7 2016/12/17 12:11:38 maya Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -79,6 +79,7 @@
        struct drm_fb_helper_surface_size tfa_fb_sizes;
        bus_space_tag_t         tfa_fb_bst;
        bus_dma_tag_t           tfa_fb_dmat;
+       uint32_t                tfa_fb_linebytes;
 };
 
 struct tegra_crtc {
diff -r 47e9b756b70c -r 67f1c1a4d2e0 sys/arch/arm/nvidia/tegra_drm_fb.c
--- a/sys/arch/arm/nvidia/tegra_drm_fb.c        Sat Dec 17 10:25:49 2016 +0000
+++ b/sys/arch/arm/nvidia/tegra_drm_fb.c        Sat Dec 17 12:11:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_drm_fb.c,v 1.3 2015/11/16 21:14:33 jmcneill Exp $ */
+/* $NetBSD: tegra_drm_fb.c,v 1.4 2016/12/17 12:11:38 maya Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_drm_fb.c,v 1.3 2015/11/16 21:14:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_drm_fb.c,v 1.4 2016/12/17 12:11:38 maya Exp $");
 
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
@@ -108,6 +108,7 @@
        tfa.tfa_fb_sizes = *sizes;
        tfa.tfa_fb_bst = sc->sc_bst;
        tfa.tfa_fb_dmat = sc->sc_dmat;
+       tfa.tfa_fb_linebytes = helper->fb->pitches[0];
 
        helper->fbdev = config_found_ia(ddev->dev, "tegrafbbus", &tfa, NULL);
        if (helper->fbdev == NULL) {
diff -r 47e9b756b70c -r 67f1c1a4d2e0 sys/arch/arm/nvidia/tegra_fb.c
--- a/sys/arch/arm/nvidia/tegra_fb.c    Sat Dec 17 10:25:49 2016 +0000
+++ b/sys/arch/arm/nvidia/tegra_fb.c    Sat Dec 17 12:11:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_fb.c,v 1.2 2015/11/12 00:43:52 jmcneill Exp $ */
+/* $NetBSD: tegra_fb.c,v 1.3 2016/12/17 12:11:38 maya Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_fb.c,v 1.2 2015/11/12 00:43:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_fb.c,v 1.3 2016/12/17 12:11:38 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -78,7 +78,6 @@
        struct tegra_fb_softc * const sc = device_private(self);
        struct tegra_drm_softc * const drmsc = device_private(parent);
        struct tegra_drmfb_attach_args * const tfa = aux;
-       struct drmfb_attach_args da;
        int error;
 
        sc->sc_dev = self;
@@ -89,11 +88,14 @@
        aprint_naive("\n");
        aprint_normal("\n");
 
-       da.da_dev = self;
-       da.da_fb_helper = tfa->tfa_fb_helper;
-       da.da_fb_sizes = &tfa->tfa_fb_sizes;
-       da.da_fb_vaddr = sc->sc_fb->obj->dmap;
-       da.da_params = &tegrafb_drmfb_params;
+       const struct drmfb_attach_args da = {
+               .da_dev = self,
+               .da_fb_helper = tfa->tfa_fb_helper,
+               .da_fb_sizes = &tfa->tfa_fb_sizes,
+               .da_fb_vaddr = sc->sc_fb->obj->dmap,
+               .da_fb_linebytes = tfa->tfa_fb_linebytes,
+               .da_params = &tegrafb_drmfb_params,
+       };
 
        error = drmfb_attach(&sc->sc_drmfb, &da);
        if (error) {



Home | Main Index | Thread Index | Old Index