summaryrefslogtreecommitdiff
path: root/sys/dev/fdt
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-01-14 06:53:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-01-14 06:53:18 +0000
commit79f416d24d4bcd32a55ee368b8896e7a5d95eed4 (patch)
tree46988055eca498f39200f52899008cc5cf2e0df5 /sys/dev/fdt
parent02cb1c0d4a143855129aae02385ee98ba28afe7e (diff)
update drm to linux 5.15.14
new hardware support includes Intel ehl/Elkhart Lake (embedded) jsl/Jasper Lake (atom) rkl/Rocket Lake (desktop) AMD van gogh APU (gfx1033) yellow carp / rembrandt APU (gfx1035?) Ryzen 6000 APU navy flounder / navi 22 (gfx1031) RX 6700, RX 6700 XT, RX 6700M, RX 6800M, RX 6850M XT dimgrey cavefish / navi 23 (gfx1032) Pro W6600, Pro W6600M, RX 6600, RX 6600 XT, RX 6600M, RX 6600S, RX 6650M, RX 6650M XT, RX 6700S, RX 6800S beige goby / navi 24 (gfx1034) RX 6500 XT, RX 6400, RX 6500M, RX 6300M Thanks to the OpenBSD Foundation for sponsoring this work niklas@ for helping with ttm and amdgpu and patrick@ for adapting rockchip drm.
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r--sys/dev/fdt/rkdrm.c22
-rw-r--r--sys/dev/fdt/rkvop.c22
2 files changed, 23 insertions, 21 deletions
diff --git a/sys/dev/fdt/rkdrm.c b/sys/dev/fdt/rkdrm.c
index 4b7c85b6741..33add572e2b 100644
--- a/sys/dev/fdt/rkdrm.c
+++ b/sys/dev/fdt/rkdrm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rkdrm.c,v 1.11 2021/07/07 02:38:21 jsg Exp $ */
+/* $OpenBSD: rkdrm.c,v 1.12 2022/01/14 06:52:58 jsg Exp $ */
/* $NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@@ -35,20 +35,10 @@
#include <machine/fdt.h>
#include <dev/ofw/openfirm.h>
-#include <dev/ofw/ofw_clock.h>
-#include <dev/ofw/ofw_gpio.h>
#include <dev/ofw/ofw_misc.h>
-#include <dev/ofw/fdt.h>
-#include <uvm/uvm_extern.h>
-#include <uvm/uvm_object.h>
-#include <uvm/uvm_device.h>
-
-#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
-#include <drm/drm_vblank.h>
-#include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_gem.h>
@@ -71,16 +61,12 @@ vmem_t *rkdrm_alloc_cma_pool(struct drm_device *, size_t);
int rkdrm_load(struct drm_device *, unsigned long);
int rkdrm_unload(struct drm_device *);
-int rkdrm_gem_fault(struct drm_gem_object *, struct uvm_faultinfo *,
- off_t, vaddr_t, vm_page_t *, int, int, vm_prot_t, int);
-
struct drm_driver rkdrm_driver = {
.driver_features = DRIVER_ATOMIC | DRIVER_MODESET | DRIVER_GEM,
.dumb_create = drm_gem_cma_dumb_create,
.dumb_map_offset = drm_gem_dumb_map_offset,
- .gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_fault = drm_gem_cma_fault,
.name = DRIVER_NAME,
@@ -91,6 +77,10 @@ struct drm_driver rkdrm_driver = {
.patchlevel = DRIVER_PATCHLEVEL,
};
+const struct drm_gem_object_funcs rkdrm_gem_object_funcs = {
+ .free = drm_gem_cma_free_object,
+};
+
struct cfattach rkdrm_ca = {
sizeof (struct rkdrm_softc), rkdrm_match, rkdrm_attach
};
@@ -173,6 +163,7 @@ rkdrm_fb_create(struct drm_device *ddev, struct drm_file *file,
fb = malloc(sizeof(*fb), M_DRM, M_ZERO | M_WAITOK);
drm_helper_mode_fill_fb_struct(ddev, &fb->base, cmd);
fb->base.format = drm_format_info(DRM_FORMAT_ARGB8888);
+ fb->base.obj[0] = gem_obj;
fb->obj = to_drm_gem_cma_obj(gem_obj);
error = drm_framebuffer_init(ddev, &fb->base, &rkdrm_framebuffer_funcs);
@@ -526,6 +517,7 @@ rkdrm_fb_probe(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *
drm_helper_mode_fill_fb_struct(ddev, fb, &mode_cmd);
fb->format = drm_format_info(DRM_FORMAT_ARGB8888);
+ fb->obj[0] = &sfb->obj->base;
error = drm_framebuffer_init(ddev, fb, &rkdrm_framebuffer_funcs);
if (error != 0) {
DRM_ERROR("failed to initialize framebuffer\n");
diff --git a/sys/dev/fdt/rkvop.c b/sys/dev/fdt/rkvop.c
index eebdb6c2c08..4595be00ce2 100644
--- a/sys/dev/fdt/rkvop.c
+++ b/sys/dev/fdt/rkvop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rkvop.c,v 1.4 2020/06/08 04:47:58 jsg Exp $ */
+/* $OpenBSD: rkvop.c,v 1.5 2022/01/14 06:52:58 jsg Exp $ */
/* $NetBSD: rk_vop.c,v 1.6 2020/01/05 12:14:35 mrg Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@@ -258,9 +258,11 @@ rkvop_attach(struct device *parent, struct device *self, void *aux)
}
int
-rkvop_plane_check(struct drm_plane *plane, struct drm_plane_state *state)
+rkvop_plane_check(struct drm_plane *plane, struct drm_atomic_state *das)
{
struct drm_crtc_state *crtc_state;
+ struct drm_plane_state *state = drm_atomic_get_new_plane_state(das,
+ plane);
if (state->crtc == NULL)
return 0;
@@ -275,8 +277,10 @@ rkvop_plane_check(struct drm_plane *plane, struct drm_plane_state *state)
}
void
-rkvop_plane_update(struct drm_plane *plane, struct drm_plane_state *old_state)
+rkvop_plane_update(struct drm_plane *plane, struct drm_atomic_state *das)
{
+ struct drm_plane_state *old_state = drm_atomic_get_new_plane_state(das,
+ plane);
struct drm_plane_state *state = plane->state;
struct drm_crtc *crtc = state->crtc;
struct rkvop_crtc *rkcrtc = to_rkvop_crtc(crtc);
@@ -382,8 +386,10 @@ rkvop_mode_fixup(struct drm_crtc *crtc,
}
int
-rkvop_crtc_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
+rkvop_crtc_check(struct drm_crtc *crtc, struct drm_atomic_state *das)
{
+ struct drm_crtc_state *state = drm_atomic_get_new_crtc_state(das,
+ crtc);
bool enabled = state->plane_mask & drm_plane_mask(crtc->primary);
if (enabled != state->enable)
@@ -393,8 +399,10 @@ rkvop_crtc_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
}
void
-rkvop_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
+rkvop_crtc_enable(struct drm_crtc *crtc, struct drm_atomic_state *das)
{
+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(das,
+ crtc);
struct rkvop_crtc *rkcrtc = to_rkvop_crtc(crtc);
struct rkvop_softc *sc = rkcrtc->sc;
struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode;
@@ -486,8 +494,10 @@ rkvop_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
}
void
-rkvop_crtc_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
+rkvop_crtc_flush(struct drm_crtc *crtc, struct drm_atomic_state *das)
{
+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(das,
+ crtc);
struct rkvop_crtc *rkcrtc = to_rkvop_crtc(crtc);
struct rkvop_softc *sc = rkcrtc->sc;