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 rockchip/drm: use drm_helper_mode_fill...
details: https://anonhg.NetBSD.org/src/rev/1d3fa9f94e4b
branches: trunk
changeset: 1028917:1d3fa9f94e4b
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 12:28:35 2021 +0000
description:
rockchip/drm: use drm_helper_mode_fill_fb_struct or say why not.
Author: phone <mrg%NetBSD.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>
diffstat:
sys/arch/arm/rockchip/rk_drm.c | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
diffs (51 lines):
diff -r 96b83a19d771 -r 1d3fa9f94e4b sys/arch/arm/rockchip/rk_drm.c
--- a/sys/arch/arm/rockchip/rk_drm.c Sun Dec 19 12:28:27 2021 +0000
+++ b/sys/arch/arm/rockchip/rk_drm.c Sun Dec 19 12:28:35 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_drm.c,v 1.12 2021/12/19 12:28:27 riastradh Exp $ */
+/* $NetBSD: rk_drm.c,v 1.13 2021/12/19 12:28:35 riastradh Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.12 2021/12/19 12:28:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.13 2021/12/19 12:28:35 riastradh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -269,16 +269,8 @@
return NULL;
fb = kmem_zalloc(sizeof(*fb), KM_SLEEP);
+ drm_helper_mode_fill_fb_struct(ddev, &fb->base, cmd);
fb->obj = to_drm_gem_cma_obj(gem_obj);
- fb->base.pitches[0] = cmd->pitches[0];
- fb->base.pitches[1] = cmd->pitches[1];
- fb->base.pitches[2] = cmd->pitches[2];
- fb->base.offsets[0] = cmd->offsets[0];
- fb->base.offsets[1] = cmd->offsets[2];
- fb->base.offsets[2] = cmd->offsets[1];
- fb->base.width = cmd->width;
- fb->base.height = cmd->height;
- fb->base.format = drm_format_info(cmd->pixel_format);
error = drm_framebuffer_init(ddev, &fb->base, &rk_drm_framebuffer_funcs);
if (error != 0)
@@ -330,10 +322,14 @@
return -ENOMEM;
}
+ /* similar to drm_helper_mode_fill_fb_struct(), but we have no cmd */
fb->pitches[0] = pitch;
fb->offsets[0] = 0;
fb->width = width;
fb->height = height;
+ fb->dev = ddev;
+ fb->modifier = 0;
+ fb->flags = 0;
#ifdef __ARM_BIG_ENDIAN
fb->format = drm_format_info(DRM_FORMAT_BGRX8888);
#else
Home |
Main Index |
Thread Index |
Old Index