Wed Jul 24 02:58:56 2013 UTC ()
Ifdef out Linux intel_ips kludge in intel_pm.c.


(riastradh)
diff -r1.1.1.1.2.2 -r1.1.1.1.2.3 src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c

cvs diff -r1.1.1.1.2.2 -r1.1.1.1.2.3 src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c 2013/07/23 21:28:22 1.1.1.1.2.2
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c 2013/07/24 02:58:56 1.1.1.1.2.3
@@ -18,27 +18,29 @@ @@ -18,27 +18,29 @@
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE. 21 * IN THE SOFTWARE.
22 * 22 *
23 * Authors: 23 * Authors:
24 * Eugeni Dodonov <eugeni.dodonov@intel.com> 24 * Eugeni Dodonov <eugeni.dodonov@intel.com>
25 * 25 *
26 */ 26 */
27 27
28#include <linux/cpufreq.h> 28#include <linux/cpufreq.h>
29#include "i915_drv.h" 29#include "i915_drv.h"
30#include "intel_drv.h" 30#include "intel_drv.h"
 31#ifndef __NetBSD__
31#include "../../../platform/x86/intel_ips.h" 32#include "../../../platform/x86/intel_ips.h"
 33#endif
32#include <linux/module.h> 34#include <linux/module.h>
33 35
34#define FORCEWAKE_ACK_TIMEOUT_MS 2 36#define FORCEWAKE_ACK_TIMEOUT_MS 2
35 37
36/* FBC, or Frame Buffer Compression, is a technique employed to compress the 38/* FBC, or Frame Buffer Compression, is a technique employed to compress the
37 * framebuffer contents in-memory, aiming at reducing the required bandwidth 39 * framebuffer contents in-memory, aiming at reducing the required bandwidth
38 * during in-memory transfers and, therefore, reduce the power packet. 40 * during in-memory transfers and, therefore, reduce the power packet.
39 * 41 *
40 * The benefits of FBC are mostly visible with solid backgrounds and 42 * The benefits of FBC are mostly visible with solid backgrounds and
41 * variation-less patterns. 43 * variation-less patterns.
42 * 44 *
43 * FBC-related functionality can be enabled by the means of the 45 * FBC-related functionality can be enabled by the means of the
44 * i915.i915_enable_fbc parameter 46 * i915.i915_enable_fbc parameter
@@ -3324,33 +3326,35 @@ out_unlock: @@ -3324,33 +3326,35 @@ out_unlock:
3324EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); 3326EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable);
3325 3327
3326/** 3328/**
3327 * Tells the intel_ips driver that the i915 driver is now loaded, if 3329 * Tells the intel_ips driver that the i915 driver is now loaded, if
3328 * IPS got loaded first. 3330 * IPS got loaded first.
3329 * 3331 *
3330 * This awkward dance is so that neither module has to depend on the 3332 * This awkward dance is so that neither module has to depend on the
3331 * other in order for IPS to do the appropriate communication of 3333 * other in order for IPS to do the appropriate communication of
3332 * GPU turbo limits to i915. 3334 * GPU turbo limits to i915.
3333 */ 3335 */
3334static void 3336static void
3335ips_ping_for_i915_load(void) 3337ips_ping_for_i915_load(void)
3336{ 3338{
 3339#ifndef __NetBSD__ /* XXX whattakludge for Linux module mania */
3337 void (*link)(void); 3340 void (*link)(void);
3338 3341
3339 link = symbol_get(ips_link_to_i915_driver); 3342 link = symbol_get(ips_link_to_i915_driver);
3340 if (link) { 3343 if (link) {
3341 link(); 3344 link();
3342 symbol_put(ips_link_to_i915_driver); 3345 symbol_put(ips_link_to_i915_driver);
3343 } 3346 }
 3347#endif
3344} 3348}
3345 3349
3346void intel_gpu_ips_init(struct drm_i915_private *dev_priv) 3350void intel_gpu_ips_init(struct drm_i915_private *dev_priv)
3347{ 3351{
3348 /* We only register the i915 ips part with intel-ips once everything is 3352 /* We only register the i915 ips part with intel-ips once everything is
3349 * set up, to avoid intel-ips sneaking in and reading bogus values. */ 3353 * set up, to avoid intel-ips sneaking in and reading bogus values. */
3350 spin_lock_irq(&mchdev_lock); 3354 spin_lock_irq(&mchdev_lock);
3351 i915_mch_dev = dev_priv; 3355 i915_mch_dev = dev_priv;
3352 spin_unlock_irq(&mchdev_lock); 3356 spin_unlock_irq(&mchdev_lock);
3353 3357
3354 ips_ping_for_i915_load(); 3358 ips_ping_for_i915_load();
3355} 3359}
3356 3360