Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2 add da_fb_linebytes to drmfb_attach_ar...
details: https://anonhg.NetBSD.org/src/rev/f6fa51b7ba58
branches: trunk
changeset: 819649:f6fa51b7ba58
user: maya <maya%NetBSD.org@localhost>
date: Mon Dec 12 19:45:56 2016 +0000
description:
add da_fb_linebytes to drmfb_attach_args and use it to pass linebytes
from nouveau code to drmfb. keep the same linebytes logic for i915.
nvidia hardware needs 256 byte alignment, so aligning to just 64 was
not enough.
fixes broken console with a width of 1440px (PR kern/51181)
ok riastradh
diffstat:
sys/external/bsd/drm2/drm/drmfb.c | 8 +++-----
sys/external/bsd/drm2/i915drm/intelfb.c | 7 +++++--
sys/external/bsd/drm2/include/drm/drmfb.h | 3 ++-
sys/external/bsd/drm2/nouveau/nouveaufb.c | 5 +++--
4 files changed, 13 insertions(+), 10 deletions(-)
diffs (105 lines):
diff -r 2bd14ce51e58 -r f6fa51b7ba58 sys/external/bsd/drm2/drm/drmfb.c
--- a/sys/external/bsd/drm2/drm/drmfb.c Mon Dec 12 19:15:15 2016 +0000
+++ b/sys/external/bsd/drm2/drm/drmfb.c Mon Dec 12 19:45:56 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drmfb.c,v 1.2 2015/11/09 23:11:18 jmcneill Exp $ */
+/* $NetBSD: drmfb.c,v 1.3 2016/12/12 19:45:56 maya Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.2 2015/11/09 23:11:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.3 2016/12/12 19:45:56 maya Exp $");
#ifdef _KERNEL_OPT
#include "vga.h"
@@ -103,9 +103,7 @@
prop_dictionary_set_uint32(dict, "width", sizes->surface_width);
prop_dictionary_set_uint32(dict, "height", sizes->surface_height);
prop_dictionary_set_uint8(dict, "depth", sizes->surface_bpp);
- prop_dictionary_set_uint16(dict, "linebytes",
- roundup2((sizes->surface_width * howmany(sizes->surface_bpp, 8)),
- 64));
+ prop_dictionary_set_uint16(dict, "linebytes", da->da_fb_linebytes);
prop_dictionary_set_uint32(dict, "address", 0); /* XXX >32-bit */
CTASSERT(sizeof(uintptr_t) <= sizeof(uint64_t));
prop_dictionary_set_uint64(dict, "virtual_address",
diff -r 2bd14ce51e58 -r f6fa51b7ba58 sys/external/bsd/drm2/i915drm/intelfb.c
--- a/sys/external/bsd/drm2/i915drm/intelfb.c Mon Dec 12 19:15:15 2016 +0000
+++ b/sys/external/bsd/drm2/i915drm/intelfb.c Mon Dec 12 19:45:56 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intelfb.c,v 1.13 2015/04/04 15:12:39 jmcneill Exp $ */
+/* $NetBSD: intelfb.c,v 1.14 2016/12/12 19:45:56 maya Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intelfb.c,v 1.13 2015/04/04 15:12:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intelfb.c,v 1.14 2016/12/12 19:45:56 maya Exp $");
#include <sys/types.h>
#include <sys/bus.h>
@@ -164,11 +164,14 @@
struct intelfb_softc *const sc = container_of(task,
struct intelfb_softc, sc_attach_task);
const struct intelfb_attach_args *const ifa = &sc->sc_ifa;
+ const struct drm_fb_helper_surface_size *const sizes = &ifa->ifa_fb_sizes;
const struct drmfb_attach_args da = {
.da_dev = sc->sc_dev,
.da_fb_helper = ifa->ifa_fb_helper,
.da_fb_sizes = &ifa->ifa_fb_sizes,
.da_fb_vaddr = bus_space_vaddr(ifa->ifa_fb_bst, sc->sc_fb_bsh),
+ .da_fb_linebytes = roundup2((sizes->surface_width *
+ howmany(sizes->surface_bpp, 8)), 64),
.da_params = &intelfb_drmfb_params,
};
int error;
diff -r 2bd14ce51e58 -r f6fa51b7ba58 sys/external/bsd/drm2/include/drm/drmfb.h
--- a/sys/external/bsd/drm2/include/drm/drmfb.h Mon Dec 12 19:15:15 2016 +0000
+++ b/sys/external/bsd/drm2/include/drm/drmfb.h Mon Dec 12 19:45:56 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drmfb.h,v 1.1 2015/03/05 17:50:41 riastradh Exp $ */
+/* $NetBSD: drmfb.h,v 1.2 2016/12/12 19:45:56 maya Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -76,6 +76,7 @@
struct drm_fb_helper *da_fb_helper;
const struct drm_fb_helper_surface_size *da_fb_sizes;
void *da_fb_vaddr;
+ uint32_t da_fb_linebytes;
const struct drmfb_params *da_params;
};
diff -r 2bd14ce51e58 -r f6fa51b7ba58 sys/external/bsd/drm2/nouveau/nouveaufb.c
--- a/sys/external/bsd/drm2/nouveau/nouveaufb.c Mon Dec 12 19:15:15 2016 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveaufb.c Mon Dec 12 19:45:56 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveaufb.c,v 1.3 2015/10/17 12:02:44 jmcneill Exp $ */
+/* $NetBSD: nouveaufb.c,v 1.4 2016/12/12 19:45:56 maya Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveaufb.c,v 1.3 2015/10/17 12:02:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveaufb.c,v 1.4 2016/12/12 19:45:56 maya Exp $");
#include <sys/types.h>
#include <sys/bus.h>
@@ -147,6 +147,7 @@
.da_fb_helper = nfa->nfa_fb_helper,
.da_fb_sizes = &nfa->nfa_fb_sizes,
.da_fb_vaddr = __UNVOLATILE(nfa->nfa_fb_ptr),
+ .da_fb_linebytes = nfa->nfa_fb_linebytes,
.da_params = &nouveaufb_drmfb_params,
};
int error;
Home |
Main Index |
Thread Index |
Old Index