diff options
author | ngie <ngie@FreeBSD.org> | 2016-08-03 00:03:03 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-08-03 00:03:03 +0000 |
commit | 3722185c1ca1226b2b96ce6afc1acf659ce4b61d (patch) | |
tree | 32984a509328e270399c4258f4383faa5e9755ab /sys/dev/drm2 | |
parent | 5a5072d2bb8b7f5ff7a6ebad399f6ab356e62684 (diff) | |
download | FreeBSD-src-3722185c1ca1226b2b96ce6afc1acf659ce4b61d.zip FreeBSD-src-3722185c1ca1226b2b96ce6afc1acf659ce4b61d.tar.gz |
MFC r302571,r302572,r302577,r302841:
Approved by: re (gjb)
r302571:
Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
-Wredundant-decls warning
PR: 209924
Tested with: devel/amd64-gcc (5.3.0)
r302572:
Remove redundant declarations for intel_fbc_enabled(..) and
i915_gem_dump_object(..) to fix -Wredundant-decls warning
PR: 209924
Tested with: devel/amd64-gcc (5.3.0)
r302577:
Add missing default case to capable(..) function definition
By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
aren't possible. Add in a KASSERT safety belt and return false in
!INVARIANTS case if an invalid value is passed in, as it would be a
programmer error.
This fixes a -Wreturn-type error with gcc 5.3.0.
r302841:
Always panic if an invalid capability is passed to `capable(..)` instead of
just with INVARIANTS
rwatson's point was valid in the sense that if the data passed at runtime is
invalid, it should always trip the invariant, not just in the debug case.
This is a deterrent against malicious input, or input caused by hardware
errors.
Requested by: rwatson
Diffstat (limited to 'sys/dev/drm2')
-rw-r--r-- | sys/dev/drm2/drm_os_freebsd.h | 3 | ||||
-rw-r--r-- | sys/dev/drm2/i915/i915_drv.h | 3 | ||||
-rw-r--r-- | sys/dev/drm2/radeon/radeon_acpi.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/drm2/drm_os_freebsd.h b/sys/dev/drm2/drm_os_freebsd.h index f590493..3c99838 100644 --- a/sys/dev/drm2/drm_os_freebsd.h +++ b/sys/dev/drm2/drm_os_freebsd.h @@ -438,6 +438,9 @@ capable(enum __drm_capabilities cap) switch (cap) { case CAP_SYS_ADMIN: return DRM_SUSER(curthread); + default: + panic("%s: unhandled capability: %0x", __func__, cap); + return (false); } } diff --git a/sys/dev/drm2/i915/i915_drv.h b/sys/dev/drm2/i915/i915_drv.h index 3325aa1..97cb46b 100644 --- a/sys/dev/drm2/i915/i915_drv.h +++ b/sys/dev/drm2/i915/i915_drv.h @@ -1618,8 +1618,6 @@ int i915_verify_lists(struct drm_device *dev); #endif void i915_gem_object_check_coherency(struct drm_i915_gem_object *obj, int handle); -void i915_gem_dump_object(struct drm_i915_gem_object *obj, int len, - const char *where, uint32_t mark); /* i915_suspend.c */ extern int i915_save_state(struct drm_device *dev); @@ -1673,7 +1671,6 @@ extern void intel_modeset_cleanup(struct drm_device *dev); extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state); extern void intel_modeset_setup_hw_state(struct drm_device *dev, bool force_restore); -extern bool intel_fbc_enabled(struct drm_device *dev); extern void intel_disable_fbc(struct drm_device *dev); extern bool ironlake_set_drps(struct drm_device *dev, u8 val); extern void intel_init_pch_refclk(struct drm_device *dev); diff --git a/sys/dev/drm2/radeon/radeon_acpi.c b/sys/dev/drm2/radeon/radeon_acpi.c index a725ab7..e4dd6e8 100644 --- a/sys/dev/drm2/radeon/radeon_acpi.c +++ b/sys/dev/drm2/radeon/radeon_acpi.c @@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$"); #define ACPI_AC_CLASS "ac_adapter" -extern void radeon_pm_acpi_event_handler(struct radeon_device *rdev); - struct atif_verify_interface { u16 size; /* structure size in bytes (includes size field) */ u16 version; /* version */ |