Module Name: src Committed By: riastradh Date: Sun Dec 19 10:49:22 UTC 2021
Modified Files: src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_connector.c nouveau_connector.h Log Message: Work around const in container_of. Ifdef out vga switcheroo. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c:1.6 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c:1.7 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c:1.6 Sat Dec 18 23:45:32 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c Sun Dec 19 10:49:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_connector.c,v 1.6 2021/12/18 23:45:32 riastradh Exp $ */ +/* $NetBSD: nouveau_connector.c,v 1.7 2021/12/19 10:49:21 riastradh Exp $ */ /* * Copyright (C) 2008 Maarten Maathuis. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nouveau_connector.c,v 1.6 2021/12/18 23:45:32 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nouveau_connector.c,v 1.7 2021/12/19 10:49:21 riastradh Exp $"); #include <acpi/button.h> @@ -104,7 +104,7 @@ nouveau_conn_atomic_get_property(struct const struct drm_connector_state *state, struct drm_property *property, u64 *val) { - struct nouveau_conn_atom *asyc = nouveau_conn_atom(state); + const struct nouveau_conn_atom *asyc = nouveau_conn_atom_const(state); struct nouveau_display *disp = nouveau_display(connector->dev); struct drm_device *dev = connector->dev; @@ -424,7 +424,7 @@ nouveau_connector_destroy(struct drm_con if (nv_connector->aux.transfer) { drm_dp_cec_unregister_connector(&nv_connector->aux); drm_dp_aux_unregister(&nv_connector->aux); - kfree(nv_connector->aux.name); + kfree(__UNCONST(nv_connector->aux.name)); } kfree(connector); } @@ -458,12 +458,19 @@ nouveau_connector_ddc_detect(struct drm_ if (!nv_encoder->i2c) break; +#ifdef __NetBSD__ + __USE(switcheroo_ddc); + __USE(dev); +#else if (switcheroo_ddc) vga_switcheroo_lock_ddc(dev->pdev); +#endif if (nvkm_probe_i2c(nv_encoder->i2c, 0x50)) found = nv_encoder; +#ifndef __NetBSD__ if (switcheroo_ddc) vga_switcheroo_unlock_ddc(dev->pdev); +#endif break; } Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h:1.4 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h:1.3 Sat Dec 18 23:45:32 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h Sun Dec 19 10:49:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_connector.h,v 1.3 2021/12/18 23:45:32 riastradh Exp $ */ +/* $NetBSD: nouveau_connector.h,v 1.4 2021/12/19 10:49:21 riastradh Exp $ */ /* * Copyright (C) 2008 Maarten Maathuis. @@ -49,6 +49,8 @@ struct nouveau_backlight; #define nouveau_conn_atom(p) \ container_of((p), struct nouveau_conn_atom, state) +#define nouveau_conn_atom_const(p) \ + const_container_of((p), struct nouveau_conn_atom, state) struct nouveau_conn_atom { struct drm_connector_state state;