From owner-svn-src-stable-11@freebsd.org Wed Aug 3 00:03:04 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95071BAD816; Wed, 3 Aug 2016 00:03:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 730B11A14; Wed, 3 Aug 2016 00:03:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u73033Zp088563; Wed, 3 Aug 2016 00:03:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u73033mu088560; Wed, 3 Aug 2016 00:03:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608030003.u73033mu088560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 3 Aug 2016 00:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303689 - in stable/11/sys/dev/drm2: . i915 radeon X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 00:03:04 -0000 Author: ngie Date: Wed Aug 3 00:03:03 2016 New Revision: 303689 URL: https://svnweb.freebsd.org/changeset/base/303689 Log: 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 Modified: stable/11/sys/dev/drm2/drm_os_freebsd.h stable/11/sys/dev/drm2/i915/i915_drv.h stable/11/sys/dev/drm2/radeon/radeon_acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm2/drm_os_freebsd.h ============================================================================== --- stable/11/sys/dev/drm2/drm_os_freebsd.h Tue Aug 2 23:54:21 2016 (r303688) +++ stable/11/sys/dev/drm2/drm_os_freebsd.h Wed Aug 3 00:03:03 2016 (r303689) @@ -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); } } Modified: stable/11/sys/dev/drm2/i915/i915_drv.h ============================================================================== --- stable/11/sys/dev/drm2/i915/i915_drv.h Tue Aug 2 23:54:21 2016 (r303688) +++ stable/11/sys/dev/drm2/i915/i915_drv.h Wed Aug 3 00:03:03 2016 (r303689) @@ -1618,8 +1618,6 @@ int i915_verify_lists(struct drm_device #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 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); Modified: stable/11/sys/dev/drm2/radeon/radeon_acpi.c ============================================================================== --- stable/11/sys/dev/drm2/radeon/radeon_acpi.c Tue Aug 2 23:54:21 2016 (r303688) +++ stable/11/sys/dev/drm2/radeon/radeon_acpi.c Wed Aug 3 00:03:03 2016 (r303689) @@ -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 */