summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2013-08-13 10:23:48 +0000
committerjsg <jsg@openbsd.org>2013-08-13 10:23:48 +0000
commitd68e72381b283ae5c41ee5225aece9e42799416a (patch)
tree4a99d704bf69bdb1bd20eb763a8d22217f038011
parentWhen net.inet.ip.sourceroute is enable, store the source route (diff)
downloadwireguard-openbsd-d68e72381b283ae5c41ee5225aece9e42799416a.tar.xz
wireguard-openbsd-d68e72381b283ae5c41ee5225aece9e42799416a.zip
add static back to functions that originally had it
reduces the diff to linux and makes ddb hangman a little easier
-rw-r--r--sys/dev/pci/drm/drmP.h4
-rw-r--r--sys/dev/pci/drm/i915/dvo_ch7017.c48
-rw-r--r--sys/dev/pci/drm/i915/dvo_ch7xxx.c49
-rw-r--r--sys/dev/pci/drm/i915/dvo_ivch.c45
-rw-r--r--sys/dev/pci/drm/i915/dvo_ns2501.c53
-rw-r--r--sys/dev/pci/drm/i915/dvo_sil164.c45
-rw-r--r--sys/dev/pci/drm/i915/dvo_tfp410.c49
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.h45
-rw-r--r--sys/dev/pci/drm/i915/i915_gem.c208
-rw-r--r--sys/dev/pci/drm/i915/i915_gem_execbuffer.c37
-rw-r--r--sys/dev/pci/drm/i915/i915_gem_gtt.c5
-rw-r--r--sys/dev/pci/drm/i915/i915_gem_tiling.c9
-rw-r--r--sys/dev/pci/drm/i915/i915_irq.c287
-rw-r--r--sys/dev/pci/drm/i915/i915_suspend.c67
-rw-r--r--sys/dev/pci/drm/i915/intel_bios.c71
-rw-r--r--sys/dev/pci/drm/i915/intel_crt.c104
-rw-r--r--sys/dev/pci/drm/i915/intel_ddi.c115
-rw-r--r--sys/dev/pci/drm/i915/intel_display.c1018
-rw-r--r--sys/dev/pci/drm/i915/intel_dp.c343
-rw-r--r--sys/dev/pci/drm/i915/intel_dvo.c66
-rw-r--r--sys/dev/pci/drm/i915/intel_fb.c32
-rw-r--r--sys/dev/pci/drm/i915/intel_hdmi.c155
-rw-r--r--sys/dev/pci/drm/i915/intel_lvds.c97
-rw-r--r--sys/dev/pci/drm/i915/intel_modes.c10
-rw-r--r--sys/dev/pci/drm/i915/intel_opregion.c48
-rw-r--r--sys/dev/pci/drm/i915/intel_overlay.c199
-rw-r--r--sys/dev/pci/drm/i915/intel_panel.c71
-rw-r--r--sys/dev/pci/drm/i915/intel_pm.c509
-rw-r--r--sys/dev/pci/drm/i915/intel_ringbuffer.c198
-rw-r--r--sys/dev/pci/drm/i915/intel_sdvo.c346
-rw-r--r--sys/dev/pci/drm/i915/intel_sprite.c73
-rw-r--r--sys/dev/pci/drm/i915/intel_tv.c67
32 files changed, 1229 insertions, 3244 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index 9af50d111b7..5b32883ba12 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drmP.h,v 1.141 2013/08/12 04:11:52 jsg Exp $ */
+/* $OpenBSD: drmP.h,v 1.142 2013/08/13 10:23:48 jsg Exp $ */
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
*/
@@ -142,6 +142,8 @@ typedef uint32_t __be32;
#define EXPORT_SYMBOL(x)
#define MODULE_FIRMWARE(x)
#define __iomem
+#define __must_check
+#define __init
#define ARRAY_SIZE nitems
#define DRM_ARRAY_SIZE nitems
diff --git a/sys/dev/pci/drm/i915/dvo_ch7017.c b/sys/dev/pci/drm/i915/dvo_ch7017.c
index e54fb7e715b..53954d19391 100644
--- a/sys/dev/pci/drm/i915/dvo_ch7017.c
+++ b/sys/dev/pci/drm/i915/dvo_ch7017.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvo_ch7017.c,v 1.2 2013/03/30 12:36:50 kettenis Exp $ */
+/* $OpenBSD: dvo_ch7017.c,v 1.3 2013/08/13 10:23:48 jsg Exp $ */
/*
* Copyright © 2006 Intel Corporation
*
@@ -163,21 +163,10 @@ struct ch7017_priv {
uint8_t dummy;
};
-void ch7017_dump_regs(struct intel_dvo_device *);
-void ch7017_dpms(struct intel_dvo_device *, bool);
-bool ch7017_read(struct intel_dvo_device *, u8, u8 *);
-bool ch7017_write(struct intel_dvo_device *, u8, u8);
-bool ch7017_init(struct intel_dvo_device *, struct i2c_controller *);
-enum drm_connector_status ch7017_detect(struct intel_dvo_device *);
-enum drm_mode_status ch7017_mode_valid(struct intel_dvo_device *,
- struct drm_display_mode *);
-void ch7017_mode_set(struct intel_dvo_device *, struct drm_display_mode *,
- struct drm_display_mode *);
-bool ch7017_get_hw_state(struct intel_dvo_device *);
-void ch7017_destroy(struct intel_dvo_device *);
-
-bool
-ch7017_read(struct intel_dvo_device *dvo, u8 addr, u8 *val)
+static void ch7017_dump_regs(struct intel_dvo_device *dvo);
+static void ch7017_dpms(struct intel_dvo_device *dvo, bool enable);
+
+static bool ch7017_read(struct intel_dvo_device *dvo, u8 addr, u8 *val)
{
struct i2c_controller *adapter = dvo->i2c_bus;
int ret;
@@ -192,8 +181,7 @@ ch7017_read(struct intel_dvo_device *dvo, u8 addr, u8 *val)
return true;
}
-bool
-ch7017_write(struct intel_dvo_device *dvo, u8 addr, u8 val)
+static bool ch7017_write(struct intel_dvo_device *dvo, u8 addr, u8 val)
{
struct i2c_controller *adapter = dvo->i2c_bus;
uint8_t buf[2] = { addr, val };
@@ -210,8 +198,7 @@ ch7017_write(struct intel_dvo_device *dvo, u8 addr, u8 val)
}
/** Probes for a CH7017 on the given bus and slave address. */
-bool
-ch7017_init(struct intel_dvo_device *dvo,
+static bool ch7017_init(struct intel_dvo_device *dvo,
struct i2c_controller *adapter)
{
struct ch7017_priv *priv;
@@ -254,14 +241,12 @@ fail:
return false;
}
-enum drm_connector_status
-ch7017_detect(struct intel_dvo_device *dvo)
+static enum drm_connector_status ch7017_detect(struct intel_dvo_device *dvo)
{
return connector_status_connected;
}
-enum drm_mode_status
-ch7017_mode_valid(struct intel_dvo_device *dvo,
+static enum drm_mode_status ch7017_mode_valid(struct intel_dvo_device *dvo,
struct drm_display_mode *mode)
{
if (mode->clock > 160000)
@@ -270,8 +255,7 @@ ch7017_mode_valid(struct intel_dvo_device *dvo,
return MODE_OK;
}
-void
-ch7017_mode_set(struct intel_dvo_device *dvo,
+static void ch7017_mode_set(struct intel_dvo_device *dvo,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -348,8 +332,7 @@ ch7017_mode_set(struct intel_dvo_device *dvo,
}
/* set the CH7017 power state */
-void
-ch7017_dpms(struct intel_dvo_device *dvo, bool enable)
+static void ch7017_dpms(struct intel_dvo_device *dvo, bool enable)
{
uint8_t val;
@@ -377,8 +360,7 @@ ch7017_dpms(struct intel_dvo_device *dvo, bool enable)
drm_msleep(20, "chdmps");
}
-bool
-ch7017_get_hw_state(struct intel_dvo_device *dvo)
+static bool ch7017_get_hw_state(struct intel_dvo_device *dvo)
{
uint8_t val;
@@ -390,8 +372,7 @@ ch7017_get_hw_state(struct intel_dvo_device *dvo)
return true;
}
-void
-ch7017_dump_regs(struct intel_dvo_device *dvo)
+static void ch7017_dump_regs(struct intel_dvo_device *dvo)
{
uint8_t val;
@@ -412,8 +393,7 @@ do { \
DUMP(CH7017_LVDS_POWER_DOWN);
}
-void
-ch7017_destroy(struct intel_dvo_device *dvo)
+static void ch7017_destroy(struct intel_dvo_device *dvo)
{
struct ch7017_priv *priv = dvo->dev_priv;
diff --git a/sys/dev/pci/drm/i915/dvo_ch7xxx.c b/sys/dev/pci/drm/i915/dvo_ch7xxx.c
index ec0972ce6f5..fb4a1e609c1 100644
--- a/sys/dev/pci/drm/i915/dvo_ch7xxx.c
+++ b/sys/dev/pci/drm/i915/dvo_ch7xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvo_ch7xxx.c,v 1.2 2013/03/30 12:36:50 kettenis Exp $ */
+/* $OpenBSD: dvo_ch7xxx.c,v 1.3 2013/08/13 10:23:48 jsg Exp $ */
/**************************************************************************
Copyright © 2006 Dave Airlie
@@ -97,22 +97,7 @@ struct ch7xxx_priv {
bool quiet;
};
-char *ch7xxx_get_id(uint8_t);
-bool ch7xxx_readb(struct intel_dvo_device *, int, uint8_t *);
-bool ch7xxx_writeb(struct intel_dvo_device *, int, uint8_t);
-bool ch7xxx_init(struct intel_dvo_device *, struct i2c_controller *);
-enum drm_connector_status ch7xxx_detect(struct intel_dvo_device *);
-enum drm_mode_status ch7xxx_mode_valid(struct intel_dvo_device *,
- struct drm_display_mode *);
-void ch7xxx_mode_set(struct intel_dvo_device *, struct drm_display_mode *,
- struct drm_display_mode *);
-void ch7xxx_dpms(struct intel_dvo_device *, bool);
-bool ch7xxx_get_hw_state(struct intel_dvo_device *);
-void ch7xxx_dump_regs(struct intel_dvo_device *);
-void ch7xxx_destroy(struct intel_dvo_device *);
-
-char *
-ch7xxx_get_id(uint8_t vid)
+static char *ch7xxx_get_id(uint8_t vid)
{
int i;
@@ -125,8 +110,7 @@ ch7xxx_get_id(uint8_t vid)
}
/** Reads an 8 bit register */
-bool
-ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
+static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
{
struct ch7xxx_priv *ch7xxx = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -157,8 +141,7 @@ read_err:
}
/** Writes an 8 bit register */
-bool
-ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
+static bool ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
{
struct ch7xxx_priv *ch7xxx = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -186,8 +169,7 @@ write_err:
return false;
}
-bool
-ch7xxx_init(struct intel_dvo_device *dvo,
+static bool ch7xxx_init(struct intel_dvo_device *dvo,
struct i2c_controller *adapter)
{
/* this will detect the CH7xxx chip on the specified i2c bus */
@@ -234,8 +216,7 @@ out:
return false;
}
-enum drm_connector_status
-ch7xxx_detect(struct intel_dvo_device *dvo)
+static enum drm_connector_status ch7xxx_detect(struct intel_dvo_device *dvo)
{
uint8_t cdet, orig_pm, pm;
@@ -256,8 +237,7 @@ ch7xxx_detect(struct intel_dvo_device *dvo)
return connector_status_disconnected;
}
-enum drm_mode_status
-ch7xxx_mode_valid(struct intel_dvo_device *dvo,
+static enum drm_mode_status ch7xxx_mode_valid(struct intel_dvo_device *dvo,
struct drm_display_mode *mode)
{
if (mode->clock > 165000)
@@ -266,8 +246,7 @@ ch7xxx_mode_valid(struct intel_dvo_device *dvo,
return MODE_OK;
}
-void
-ch7xxx_mode_set(struct intel_dvo_device *dvo,
+static void ch7xxx_mode_set(struct intel_dvo_device *dvo,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -306,8 +285,7 @@ ch7xxx_mode_set(struct intel_dvo_device *dvo,
}
/* set the CH7xxx power state */
-void
-ch7xxx_dpms(struct intel_dvo_device *dvo, bool enable)
+static void ch7xxx_dpms(struct intel_dvo_device *dvo, bool enable)
{
if (enable)
ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_DVIL | CH7xxx_PM_DVIP);
@@ -315,8 +293,7 @@ ch7xxx_dpms(struct intel_dvo_device *dvo, bool enable)
ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_FPD);
}
-bool
-ch7xxx_get_hw_state(struct intel_dvo_device *dvo)
+static bool ch7xxx_get_hw_state(struct intel_dvo_device *dvo)
{
u8 val;
@@ -328,8 +305,7 @@ ch7xxx_get_hw_state(struct intel_dvo_device *dvo)
return false;
}
-void
-ch7xxx_dump_regs(struct intel_dvo_device *dvo)
+static void ch7xxx_dump_regs(struct intel_dvo_device *dvo)
{
int i;
@@ -342,8 +318,7 @@ ch7xxx_dump_regs(struct intel_dvo_device *dvo)
}
}
-void
-ch7xxx_destroy(struct intel_dvo_device *dvo)
+static void ch7xxx_destroy(struct intel_dvo_device *dvo)
{
struct ch7xxx_priv *ch7xxx = dvo->dev_priv;
diff --git a/sys/dev/pci/drm/i915/dvo_ivch.c b/sys/dev/pci/drm/i915/dvo_ivch.c
index e5d1bd07039..7e1e33b8868 100644
--- a/sys/dev/pci/drm/i915/dvo_ivch.c
+++ b/sys/dev/pci/drm/i915/dvo_ivch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvo_ivch.c,v 1.3 2013/07/08 09:47:45 jsg Exp $ */
+/* $OpenBSD: dvo_ivch.c,v 1.4 2013/08/13 10:23:48 jsg Exp $ */
/*
* Copyright © 2006 Intel Corporation
*
@@ -157,26 +157,14 @@ struct ivch_priv {
};
-void ivch_dump_regs(struct intel_dvo_device *);
-bool ivch_read(struct intel_dvo_device *, int, uint16_t *);
-bool ivch_write(struct intel_dvo_device *, int, uint16_t);
-bool ivch_init(struct intel_dvo_device *, struct i2c_controller *);
-enum drm_connector_status ivch_detect(struct intel_dvo_device *);
-enum drm_mode_status ivch_mode_valid(struct intel_dvo_device *,
- struct drm_display_mode *);
-void ivch_dpms(struct intel_dvo_device *, bool);
-bool ivch_get_hw_state(struct intel_dvo_device *);
-void ivch_mode_set(struct intel_dvo_device *, struct drm_display_mode *,
- struct drm_display_mode *);
-void ivch_destroy(struct intel_dvo_device *);
+static void ivch_dump_regs(struct intel_dvo_device *dvo);
/**
* Reads a register on the ivch.
*
* Each of the 256 registers are 16 bits long.
*/
-bool
-ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data)
+static bool ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data)
{
struct ivch_priv *priv = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -215,8 +203,7 @@ read_err:
}
/** Writes a 16-bit register on the ivch */
-bool
-ivch_write(struct intel_dvo_device *dvo, int addr, uint16_t data)
+static bool ivch_write(struct intel_dvo_device *dvo, int addr, uint16_t data)
{
struct ivch_priv *priv = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -246,8 +233,7 @@ write_err:
}
/** Probes the given bus and slave address for an ivch */
-bool
-ivch_init(struct intel_dvo_device *dvo,
+static bool ivch_init(struct intel_dvo_device *dvo,
struct i2c_controller *adapter)
{
struct ivch_priv *priv;
@@ -286,14 +272,12 @@ out:
return false;
}
-enum drm_connector_status
-ivch_detect(struct intel_dvo_device *dvo)
+static enum drm_connector_status ivch_detect(struct intel_dvo_device *dvo)
{
return connector_status_connected;
}
-enum drm_mode_status
-ivch_mode_valid(struct intel_dvo_device *dvo,
+static enum drm_mode_status ivch_mode_valid(struct intel_dvo_device *dvo,
struct drm_display_mode *mode)
{
if (mode->clock > 112000)
@@ -303,8 +287,7 @@ ivch_mode_valid(struct intel_dvo_device *dvo,
}
/** Sets the power state of the panel connected to the ivch */
-void
-ivch_dpms(struct intel_dvo_device *dvo, bool enable)
+static void ivch_dpms(struct intel_dvo_device *dvo, bool enable)
{
int i;
uint16_t vr01, vr30, backlight;
@@ -339,8 +322,7 @@ ivch_dpms(struct intel_dvo_device *dvo, bool enable)
udelay(16 * 1000);
}
-bool
-ivch_get_hw_state(struct intel_dvo_device *dvo)
+static bool ivch_get_hw_state(struct intel_dvo_device *dvo)
{
uint16_t vr01;
@@ -354,8 +336,7 @@ ivch_get_hw_state(struct intel_dvo_device *dvo)
return false;
}
-void
-ivch_mode_set(struct intel_dvo_device *dvo,
+static void ivch_mode_set(struct intel_dvo_device *dvo,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -390,8 +371,7 @@ ivch_mode_set(struct intel_dvo_device *dvo,
ivch_dump_regs(dvo);
}
-void
-ivch_dump_regs(struct intel_dvo_device *dvo)
+static void ivch_dump_regs(struct intel_dvo_device *dvo)
{
uint16_t val;
@@ -433,8 +413,7 @@ ivch_dump_regs(struct intel_dvo_device *dvo)
DRM_LOG_KMS("VR8F: 0x%04x\n", val);
}
-void
-ivch_destroy(struct intel_dvo_device *dvo)
+static void ivch_destroy(struct intel_dvo_device *dvo)
{
struct ivch_priv *priv = dvo->dev_priv;
diff --git a/sys/dev/pci/drm/i915/dvo_ns2501.c b/sys/dev/pci/drm/i915/dvo_ns2501.c
index a1f27ebf4fc..474e8005b96 100644
--- a/sys/dev/pci/drm/i915/dvo_ns2501.c
+++ b/sys/dev/pci/drm/i915/dvo_ns2501.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvo_ns2501.c,v 1.4 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: dvo_ns2501.c,v 1.5 2013/08/13 10:23:49 jsg Exp $ */
/*
*
* Copyright (c) 2012 Gilles Dartiguelongue, Thomas Richter
@@ -75,21 +75,6 @@ struct ns2501_priv {
#define NSPTR(d) ((NS2501Ptr)(d->DriverPrivate.ptr))
-void enable_dvo(struct intel_dvo_device *);
-void restore_dvo(struct intel_dvo_device *);
-bool ns2501_readb(struct intel_dvo_device *, int, uint8_t *);
-bool ns2501_writeb(struct intel_dvo_device *, int, uint8_t);
-enum drm_connector_status ns2501_detect(struct intel_dvo_device *);
-bool ns2501_init(struct intel_dvo_device *, struct i2c_controller *);
-enum drm_mode_status ns2501_mode_valid(struct intel_dvo_device *,
- struct drm_display_mode *);
-void ns2501_mode_set(struct intel_dvo_device *, struct drm_display_mode *,
- struct drm_display_mode *);
-bool ns2501_get_hw_state(struct intel_dvo_device *);
-void ns2501_dpms(struct intel_dvo_device *, bool);
-void ns2501_dump_regs(struct intel_dvo_device *);
-void ns2501_destroy(struct intel_dvo_device *);
-
/*
* For reasons unclear to me, the ns2501 at least on the Fujitsu/Siemens
* laptops does not react on the i2c bus unless
@@ -103,8 +88,7 @@ void ns2501_destroy(struct intel_dvo_device *);
* when switching the resolution.
*/
-void
-enable_dvo(struct intel_dvo_device *dvo)
+static void enable_dvo(struct intel_dvo_device *dvo)
{
struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -132,8 +116,7 @@ enable_dvo(struct intel_dvo_device *dvo)
* Restore the I915 registers modified by the above
* trigger function.
*/
-void
-restore_dvo(struct intel_dvo_device *dvo)
+static void restore_dvo(struct intel_dvo_device *dvo)
{
struct i2c_controller *adapter = dvo->i2c_bus;
struct intel_gmbus *bus = container_of(adapter,
@@ -154,8 +137,7 @@ restore_dvo(struct intel_dvo_device *dvo)
** If it returns false, it might be wise to enable the
** DVO with the above function.
*/
-bool
-ns2501_readb(struct intel_dvo_device *dvo, int addr, uint8_t * ch)
+static bool ns2501_readb(struct intel_dvo_device *dvo, int addr, uint8_t * ch)
{
struct ns2501_priv *ns = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -193,8 +175,7 @@ read_err:
** If it returns false, it might be wise to enable the
** DVO with the above function.
*/
-bool
-ns2501_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
+static bool ns2501_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
{
struct ns2501_priv *ns = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -228,8 +209,7 @@ write_err:
* talk to it. If not, it will not be seen and not detected.
* Bummer!
*/
-bool
-ns2501_init(struct intel_dvo_device *dvo,
+static bool ns2501_init(struct intel_dvo_device *dvo,
struct i2c_controller *adapter)
{
/* this will detect the NS2501 chip on the specified i2c bus */
@@ -274,8 +254,7 @@ out:
return false;
}
-enum drm_connector_status
-ns2501_detect(struct intel_dvo_device *dvo)
+static enum drm_connector_status ns2501_detect(struct intel_dvo_device *dvo)
{
/*
* This is a Laptop display, it doesn't have hotplugging.
@@ -287,8 +266,7 @@ ns2501_detect(struct intel_dvo_device *dvo)
return connector_status_connected;
}
-enum drm_mode_status
-ns2501_mode_valid(struct intel_dvo_device *dvo,
+static enum drm_mode_status ns2501_mode_valid(struct intel_dvo_device *dvo,
struct drm_display_mode *mode)
{
DRM_DEBUG_KMS
@@ -311,8 +289,7 @@ ns2501_mode_valid(struct intel_dvo_device *dvo,
}
}
-void
-ns2501_mode_set(struct intel_dvo_device *dvo,
+static void ns2501_mode_set(struct intel_dvo_device *dvo,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -510,8 +487,7 @@ ns2501_mode_set(struct intel_dvo_device *dvo,
}
/* set the NS2501 power state */
-bool
-ns2501_get_hw_state(struct intel_dvo_device *dvo)
+static bool ns2501_get_hw_state(struct intel_dvo_device *dvo)
{
unsigned char ch;
@@ -525,8 +501,7 @@ ns2501_get_hw_state(struct intel_dvo_device *dvo)
}
/* set the NS2501 power state */
-void
-ns2501_dpms(struct intel_dvo_device *dvo, bool enable)
+static void ns2501_dpms(struct intel_dvo_device *dvo, bool enable)
{
bool ok;
bool restore = false;
@@ -569,8 +544,7 @@ ns2501_dpms(struct intel_dvo_device *dvo, bool enable)
}
}
-void
-ns2501_dump_regs(struct intel_dvo_device *dvo)
+static void ns2501_dump_regs(struct intel_dvo_device *dvo)
{
uint8_t val;
@@ -586,8 +560,7 @@ ns2501_dump_regs(struct intel_dvo_device *dvo)
DRM_LOG_KMS("NS2501_REGC: 0x%02x\n", val);
}
-void
-ns2501_destroy(struct intel_dvo_device *dvo)
+static void ns2501_destroy(struct intel_dvo_device *dvo)
{
struct ns2501_priv *ns = dvo->dev_priv;
diff --git a/sys/dev/pci/drm/i915/dvo_sil164.c b/sys/dev/pci/drm/i915/dvo_sil164.c
index 6f96104ad52..d3c633ef9a0 100644
--- a/sys/dev/pci/drm/i915/dvo_sil164.c
+++ b/sys/dev/pci/drm/i915/dvo_sil164.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvo_sil164.c,v 1.2 2013/03/30 12:36:50 kettenis Exp $ */
+/* $OpenBSD: dvo_sil164.c,v 1.3 2013/08/13 10:23:49 jsg Exp $ */
/**************************************************************************
Copyright © 2006 Dave Airlie
@@ -66,21 +66,7 @@ struct sil164_priv {
#define SILPTR(d) ((SIL164Ptr)(d->DriverPrivate.ptr))
-bool sil164_readb(struct intel_dvo_device *, int, uint8_t *);
-bool sil164_writeb(struct intel_dvo_device *, int, uint8_t);
-bool sil164_init(struct intel_dvo_device *, struct i2c_controller *);
-enum drm_connector_status sil164_detect(struct intel_dvo_device *);
-enum drm_mode_status sil164_mode_valid(struct intel_dvo_device *,
- struct drm_display_mode *);
-void sil164_mode_set(struct intel_dvo_device *, struct drm_display_mode *,
- struct drm_display_mode *);
-void sil164_dpms(struct intel_dvo_device *, bool);
-bool sil164_get_hw_state(struct intel_dvo_device *);
-void sil164_dump_regs(struct intel_dvo_device *);
-void sil164_destroy(struct intel_dvo_device *);
-
-bool
-sil164_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
+static bool sil164_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
{
struct sil164_priv *sil = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -110,8 +96,7 @@ read_err:
return false;
}
-bool
-sil164_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
+static bool sil164_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
{
struct sil164_priv *sil = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -140,8 +125,7 @@ write_err:
}
/* Silicon Image 164 driver for chip on i2c bus */
-bool
-sil164_init(struct intel_dvo_device *dvo,
+static bool sil164_init(struct intel_dvo_device *dvo,
struct i2c_controller *adapter)
{
/* this will detect the SIL164 chip on the specified i2c bus */
@@ -183,8 +167,7 @@ out:
return false;
}
-enum drm_connector_status
-sil164_detect(struct intel_dvo_device *dvo)
+static enum drm_connector_status sil164_detect(struct intel_dvo_device *dvo)
{
uint8_t reg9;
@@ -196,15 +179,13 @@ sil164_detect(struct intel_dvo_device *dvo)
return connector_status_disconnected;
}
-enum drm_mode_status
-sil164_mode_valid(struct intel_dvo_device *dvo,
+static enum drm_mode_status sil164_mode_valid(struct intel_dvo_device *dvo,
struct drm_display_mode *mode)
{
return MODE_OK;
}
-void
-sil164_mode_set(struct intel_dvo_device *dvo,
+static void sil164_mode_set(struct intel_dvo_device *dvo,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -223,8 +204,7 @@ sil164_mode_set(struct intel_dvo_device *dvo,
}
/* set the SIL164 power state */
-void
-sil164_dpms(struct intel_dvo_device *dvo, bool enable)
+static void sil164_dpms(struct intel_dvo_device *dvo, bool enable)
{
int ret;
unsigned char ch;
@@ -242,8 +222,7 @@ sil164_dpms(struct intel_dvo_device *dvo, bool enable)
return;
}
-bool
-sil164_get_hw_state(struct intel_dvo_device *dvo)
+static bool sil164_get_hw_state(struct intel_dvo_device *dvo)
{
int ret;
unsigned char ch;
@@ -258,8 +237,7 @@ sil164_get_hw_state(struct intel_dvo_device *dvo)
return false;
}
-void
-sil164_dump_regs(struct intel_dvo_device *dvo)
+static void sil164_dump_regs(struct intel_dvo_device *dvo)
{
uint8_t val;
@@ -275,8 +253,7 @@ sil164_dump_regs(struct intel_dvo_device *dvo)
DRM_LOG_KMS("SIL164_REGC: 0x%02x\n", val);
}
-void
-sil164_destroy(struct intel_dvo_device *dvo)
+static void sil164_destroy(struct intel_dvo_device *dvo)
{
struct sil164_priv *sil = dvo->dev_priv;
diff --git a/sys/dev/pci/drm/i915/dvo_tfp410.c b/sys/dev/pci/drm/i915/dvo_tfp410.c
index b9fac4c13f8..084c237ba15 100644
--- a/sys/dev/pci/drm/i915/dvo_tfp410.c
+++ b/sys/dev/pci/drm/i915/dvo_tfp410.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvo_tfp410.c,v 1.2 2013/03/30 12:36:50 kettenis Exp $ */
+/* $OpenBSD: dvo_tfp410.c,v 1.3 2013/08/13 10:23:49 jsg Exp $ */
/*
* Copyright © 2007 Dave Mueller
*
@@ -91,22 +91,7 @@ struct tfp410_priv {
bool quiet;
};
-bool tfp410_readb(struct intel_dvo_device *, int, uint8_t *);
-bool tfp410_writeb(struct intel_dvo_device *, int, uint8_t);
-int tfp410_getid(struct intel_dvo_device *, int);
-bool tfp410_init(struct intel_dvo_device *, struct i2c_controller *);
-enum drm_connector_status tfp410_detect(struct intel_dvo_device *);
-enum drm_mode_status tfp410_mode_valid(struct intel_dvo_device *,
- struct drm_display_mode *);
-void tfp410_mode_set(struct intel_dvo_device *, struct drm_display_mode *,
- struct drm_display_mode *);
-void tfp410_dpms(struct intel_dvo_device *, bool);
-bool tfp410_get_hw_state(struct intel_dvo_device *);
-void tfp410_dump_regs(struct intel_dvo_device *);
-void tfp410_destroy(struct intel_dvo_device *);
-
-bool
-tfp410_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
+static bool tfp410_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
{
struct tfp410_priv *tfp = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -136,8 +121,7 @@ read_err:
return false;
}
-bool
-tfp410_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
+static bool tfp410_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
{
struct tfp410_priv *tfp = dvo->dev_priv;
struct i2c_controller *adapter = dvo->i2c_bus;
@@ -165,8 +149,7 @@ write_err:
return false;
}
-int
-tfp410_getid(struct intel_dvo_device *dvo, int addr)
+static int tfp410_getid(struct intel_dvo_device *dvo, int addr)
{
uint8_t ch1, ch2;
@@ -178,8 +161,7 @@ tfp410_getid(struct intel_dvo_device *dvo, int addr)
}
/* Ti TFP410 driver for chip on i2c bus */
-bool
-tfp410_init(struct intel_dvo_device *dvo,
+static bool tfp410_init(struct intel_dvo_device *dvo,
struct i2c_controller *adapter)
{
/* this will detect the tfp410 chip on the specified i2c bus */
@@ -214,8 +196,7 @@ out:
return false;
}
-enum drm_connector_status
-tfp410_detect(struct intel_dvo_device *dvo)
+static enum drm_connector_status tfp410_detect(struct intel_dvo_device *dvo)
{
enum drm_connector_status ret = connector_status_disconnected;
uint8_t ctl2;
@@ -230,15 +211,13 @@ tfp410_detect(struct intel_dvo_device *dvo)
return ret;
}
-enum drm_mode_status
-tfp410_mode_valid(struct intel_dvo_device *dvo,
+static enum drm_mode_status tfp410_mode_valid(struct intel_dvo_device *dvo,
struct drm_display_mode *mode)
{
return MODE_OK;
}
-void
-tfp410_mode_set(struct intel_dvo_device *dvo,
+static void tfp410_mode_set(struct intel_dvo_device *dvo,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -251,8 +230,7 @@ tfp410_mode_set(struct intel_dvo_device *dvo,
}
/* set the tfp410 power state */
-void
-tfp410_dpms(struct intel_dvo_device *dvo, bool enable)
+static void tfp410_dpms(struct intel_dvo_device *dvo, bool enable)
{
uint8_t ctl1;
@@ -267,8 +245,7 @@ tfp410_dpms(struct intel_dvo_device *dvo, bool enable)
tfp410_writeb(dvo, TFP410_CTL_1, ctl1);
}
-bool
-tfp410_get_hw_state(struct intel_dvo_device *dvo)
+static bool tfp410_get_hw_state(struct intel_dvo_device *dvo)
{
uint8_t ctl1;
@@ -281,8 +258,7 @@ tfp410_get_hw_state(struct intel_dvo_device *dvo)
return false;
}
-void
-tfp410_dump_regs(struct intel_dvo_device *dvo)
+static void tfp410_dump_regs(struct intel_dvo_device *dvo)
{
uint8_t val, val2;
@@ -316,8 +292,7 @@ tfp410_dump_regs(struct intel_dvo_device *dvo)
DRM_LOG_KMS("TFP410_V_RES: 0x%02X%02X\n", val2, val);
}
-void
-tfp410_destroy(struct intel_dvo_device *dvo)
+static void tfp410_destroy(struct intel_dvo_device *dvo)
{
struct tfp410_priv *tfp = dvo->dev_priv;
diff --git a/sys/dev/pci/drm/i915/i915_drv.h b/sys/dev/pci/drm/i915/i915_drv.h
index fd1d73d93bd..3b709fe866e 100644
--- a/sys/dev/pci/drm/i915/i915_drv.h
+++ b/sys/dev/pci/drm/i915/i915_drv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.h,v 1.26 2013/08/07 19:49:06 kettenis Exp $ */
+/* $OpenBSD: i915_drv.h,v 1.27 2013/08/13 10:23:49 jsg Exp $ */
/* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
*/
/*
@@ -1038,7 +1038,6 @@ struct drm_i915_gem_request {
};
u_int32_t inteldrm_read_hws(struct inteldrm_softc *, int);
-int ring_wait_for_space(struct intel_ring_buffer *, int n);
int intel_ring_begin(struct intel_ring_buffer *, int);
void intel_ring_emit(struct intel_ring_buffer *, u_int32_t);
void intel_ring_advance(struct intel_ring_buffer *);
@@ -1051,10 +1050,6 @@ unsigned long i915_mch_val(struct inteldrm_softc *dev_priv);
unsigned long i915_gfx_val(struct inteldrm_softc *dev_priv);
void i915_update_gfx_val(struct inteldrm_softc *);
-int intel_init_ring_buffer(struct drm_device *,
- struct intel_ring_buffer *);
-int init_ring_common(struct intel_ring_buffer *);
-
int intel_init_render_ring_buffer(struct drm_device *);
void intel_cleanup_ring_buffer(struct intel_ring_buffer *);
@@ -1062,15 +1057,13 @@ void intel_cleanup_ring_buffer(struct intel_ring_buffer *);
extern int i915_driver_irq_install(struct drm_device * dev);
extern void i915_driver_irq_uninstall(struct drm_device * dev);
-extern int i915_enable_vblank(struct drm_device *dev, int crtc);
-extern void i915_disable_vblank(struct drm_device *dev, int crtc);
-extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc);
extern void i915_user_irq_get(struct inteldrm_softc *);
extern void i915_user_irq_put(struct inteldrm_softc *);
void i915_enable_pipestat(struct inteldrm_softc *, int, u_int32_t);
void i915_disable_pipestat(struct inteldrm_softc *, int, u_int32_t);
void intel_irq_init(struct drm_device *dev);
void i915_hangcheck_elapsed(void *);
+void i915_handle_error(struct drm_device *dev, bool wedged);
void intel_enable_asle(struct drm_device *);
extern void intel_gt_init(struct drm_device *dev);
@@ -1105,6 +1098,7 @@ int i915_gem_set_caching_ioctl(struct drm_device *, void *,
/* GEM memory manager functions */
int i915_gem_init_object(struct drm_obj *);
+void i915_gem_object_init(struct drm_i915_gem_object *);
void i915_gem_free_object(struct drm_obj *);
int i915_gem_object_pin(struct drm_i915_gem_object *, uint32_t, bool, bool);
void i915_gem_object_unpin(struct drm_i915_gem_object *);
@@ -1117,10 +1111,7 @@ void i915_gem_retire_work_handler(void *, void*);
int i915_gem_idle(struct drm_device *);
void i915_gem_object_move_to_active(struct drm_i915_gem_object *,
struct intel_ring_buffer *);
-void i915_gem_object_move_to_inactive(struct drm_i915_gem_object *);
int i915_add_request(struct intel_ring_buffer *, struct drm_file *, u32 *);
-int init_pipe_control(struct intel_ring_buffer *);
-void cleanup_status_page(struct intel_ring_buffer *);
void i915_gem_init_swizzling(struct drm_device *);
void i915_gem_cleanup_ringbuffer(struct drm_device *);
int i915_gem_ring_throttle(struct drm_device *, struct drm_file *);
@@ -1133,9 +1124,6 @@ void i915_dispatch_gem_execbuffer(struct intel_ring_buffer *,
int i915_gem_object_pin_and_relocate(struct drm_obj *,
struct drm_file *, struct drm_i915_gem_exec_object2 *,
struct drm_i915_gem_relocation_entry *);
-int i915_gem_execbuffer_reserve_object(struct drm_i915_gem_object *,
- struct intel_ring_buffer *);
-void i915_gem_execbuffer_unreserve_object(struct drm_i915_gem_object *);
extern int i915_gem_get_seqno(struct drm_device *, u32 *);
@@ -1146,7 +1134,6 @@ int i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *,
int i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *,
bool);
int i915_gem_object_flush_gpu_write_domain(struct drm_i915_gem_object *);
-int i915_gem_object_wait_rendering(struct drm_i915_gem_object *, bool);
int i915_gem_init(struct drm_device *);
int i915_gem_mmap_gtt(struct drm_file *, struct drm_device *,
@@ -1154,15 +1141,6 @@ int i915_gem_mmap_gtt(struct drm_file *, struct drm_device *,
int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
enum i915_cache_level cache_level);
-void sandybridge_write_fence_reg(struct drm_device *, int,
- struct drm_i915_gem_object *);
-void i965_write_fence_reg(struct drm_device *, int,
- struct drm_i915_gem_object *);
-void i915_write_fence_reg(struct drm_device *, int,
- struct drm_i915_gem_object *);
-void i830_write_fence_reg(struct drm_device *, int,
- struct drm_i915_gem_object *);
-
int i915_gem_object_finish_gpu(struct drm_i915_gem_object *);
int i915_gem_init_hw(struct drm_device *);
@@ -1236,16 +1214,11 @@ int i915_gem_evict_inactive(struct inteldrm_softc *);
void i915_gem_detect_bit_6_swizzle(struct drm_device *);
void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *);
void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *);
-int i915_gem_swizzle_page(struct vm_page *page);
-bool i915_tiling_ok(struct drm_device *, int, int, int);
-bool i915_gem_object_fence_ok(struct drm_i915_gem_object *, int);
/* i915_gem_debug.c */
#define i915_verify_lists(dev) 0
/* i915_suspend.c */
-extern void i915_save_display(struct drm_device *);
-extern void i915_restore_display(struct drm_device *);
extern int i915_save_state(struct drm_device *);
extern int i915_restore_state(struct drm_device *);
@@ -1264,18 +1237,12 @@ static inline bool intel_gmbus_is_forced_bit(struct i2c_controller *i2c)
}
/* i915_gem.c */
-int i915_gem_create(struct drm_file *, struct drm_device *, uint64_t,
- uint32_t *);
-void init_ring_lists(struct intel_ring_buffer *);
int i915_gem_fault(struct drm_obj *, struct uvm_faultinfo *, off_t,
vaddr_t, vm_page_t *, int, int, vm_prot_t, int );
struct drm_i915_gem_object *
i915_gem_alloc_object(struct drm_device *, size_t);
int i915_gpu_idle(struct drm_device *);
void i915_gem_object_move_to_flushing(struct drm_i915_gem_object *);
-void i915_gem_write_fence(struct drm_device *, int,
- struct drm_i915_gem_object *);
-void i915_gem_reset_fences(struct drm_device *);
int i915_gem_object_get_fence(struct drm_i915_gem_object *);
int i915_gem_object_put_fence(struct drm_i915_gem_object *);
void i915_gem_reset(struct drm_device *);
@@ -1341,18 +1308,12 @@ 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);
-extern void ironlake_init_pch_refclk(struct drm_device *dev);
extern void gen6_set_rps(struct drm_device *dev, u8 val);
extern void intel_detect_pch(struct inteldrm_softc *dev_priv);
extern int intel_trans_dp_port_sel(struct drm_crtc *crtc);
int i915_load_modeset_init(struct drm_device *dev);
extern int intel_enable_rc6(const struct drm_device *dev);
-extern void __gen6_gt_force_wake_get(struct inteldrm_softc *dev_priv);
-extern void __gen6_gt_force_wake_mt_get(struct inteldrm_softc *dev_priv);
-extern void __gen6_gt_force_wake_put(struct inteldrm_softc *dev_priv);
-extern void __gen6_gt_force_wake_mt_put(struct inteldrm_softc *dev_priv);
-
extern struct intel_overlay_error_state *intel_overlay_capture_error_state(
struct drm_device *dev);
#ifdef notyet
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c
index 21f903171fb..c2c3432e97e 100644
--- a/sys/dev/pci/drm/i915/i915_gem.c
+++ b/sys/dev/pci/drm/i915/i915_gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem.c,v 1.32 2013/08/09 07:55:42 jsg Exp $ */
+/* $OpenBSD: i915_gem.c,v 1.33 2013/08/13 10:23:49 jsg Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -53,41 +53,30 @@
#include <sys/queue.h>
#include <sys/workq.h>
-int i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj);
-int i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj);
-void i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj);
-int i915_gem_object_put_pages(struct drm_i915_gem_object *obj);
-uint32_t i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size,
- int tiling_mode);
-uint32_t i915_gem_get_gtt_alignment(struct drm_device *dev,
- uint32_t size, int tiling_mode);
-void i915_gem_object_finish_gtt(struct drm_i915_gem_object *);
-void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *);
-int i915_gem_init_phys_object(struct drm_device *, int, int, int);
-int i915_gem_phys_pwrite(struct drm_device *, struct drm_i915_gem_object *,
- struct drm_i915_gem_pwrite *, struct drm_file *);
-bool intel_enable_blt(struct drm_device *);
-int i915_gem_handle_seqno_wrap(struct drm_device *);
-void i915_gem_object_update_fence(struct drm_i915_gem_object *,
- struct drm_i915_fence_reg *, bool);
-int i915_gem_object_flush_fence(struct drm_i915_gem_object *);
-struct drm_i915_fence_reg *i915_find_fence_reg(struct drm_device *);
-void i915_gem_reset_ring_lists(struct drm_i915_private *,
- struct intel_ring_buffer *);
-void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *);
-void i915_gem_request_remove_from_client(struct drm_i915_gem_request *);
-int i915_gem_object_flush_active(struct drm_i915_gem_object *);
-int i915_gem_check_olr(struct intel_ring_buffer *, u32);
-void i915_gem_object_truncate(struct drm_i915_gem_object *obj);
-void i915_gem_verify_gtt(struct drm_device *dev);
-int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
- unsigned alignment, bool map_and_fenceable,
- bool nonblocking);
-int i915_gem_wait_for_error(struct drm_device *);
-int __wait_seqno(struct intel_ring_buffer *, uint32_t, bool, struct timespec *);
-int i915_gem_object_create_mmap_offset(struct drm_i915_gem_object *);
-void i915_gem_object_free_mmap_offset(struct drm_i915_gem_object *);
-void i915_gem_object_init(struct drm_i915_gem_object *);
+static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
+static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj);
+static __must_check int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
+ unsigned alignment,
+ bool map_and_fenceable,
+ bool nonblocking);
+static int i915_gem_phys_pwrite(struct drm_device *dev,
+ struct drm_i915_gem_object *obj,
+ struct drm_i915_gem_pwrite *args,
+ struct drm_file *file);
+
+static void i915_gem_write_fence(struct drm_device *dev, int reg,
+ struct drm_i915_gem_object *obj);
+static void i915_gem_object_update_fence(struct drm_i915_gem_object *obj,
+ struct drm_i915_fence_reg *fence,
+ bool enable);
+
+#ifdef notyet
+static int i915_gem_inactive_shrink(struct shrinker *shrinker,
+ struct shrink_control *sc);
+static long i915_gem_purge(struct drm_i915_private *dev_priv, long target);
+static void i915_gem_shrink_all(struct drm_i915_private *dev_priv);
+#endif
+static void i915_gem_object_truncate(struct drm_i915_gem_object *obj);
extern int ticks;
@@ -118,7 +107,7 @@ static void i915_gem_info_remove_obj(struct drm_i915_private *dev_priv,
dev_priv->mm.object_memory -= size;
}
-int
+static int
i915_gem_wait_for_error(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -156,8 +145,7 @@ i915_gem_wait_for_error(struct drm_device *dev)
return 0;
}
-int
-i915_mutex_lock_interruptible(struct drm_device *dev)
+int i915_mutex_lock_interruptible(struct drm_device *dev)
{
int ret;
@@ -243,7 +231,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
return 0;
}
-int
+static int
i915_gem_create(struct drm_file *file,
struct drm_device *dev,
uint64_t size,
@@ -284,9 +272,9 @@ i915_gem_dumb_create(struct drm_file *file,
args->size, &args->handle);
}
-int
-i915_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
- uint32_t handle)
+int i915_gem_dumb_destroy(struct drm_file *file,
+ struct drm_device *dev,
+ uint32_t handle)
{
printf("%s stub\n", __func__);
return -ENOSYS;
@@ -306,8 +294,7 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
args->size, &args->handle);
}
-int
-i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj)
+static int i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj)
{
drm_i915_private_t *dev_priv = obj->base.dev->dev_private;
@@ -1022,7 +1009,7 @@ i915_gem_check_wedge(struct drm_i915_private *dev_priv,
* Compare seqno against outstanding lazy request. Emit a request if they are
* equal.
*/
-int
+static int
i915_gem_check_olr(struct intel_ring_buffer *ring, u32 seqno)
{
int ret;
@@ -1046,9 +1033,8 @@ i915_gem_check_olr(struct intel_ring_buffer *ring, u32 seqno)
* Returns 0 if the seqno was found within the alloted time. Else returns the
* errno with remaining time filled in timeout argument.
*/
-int
-__wait_seqno(struct intel_ring_buffer *ring, uint32_t seqno,
- bool interruptible, struct timespec *timeout)
+static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
+ bool interruptible, struct timespec *timeout)
{
struct drm_device *dev = ring->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -1104,7 +1090,7 @@ i915_wait_seqno(struct intel_ring_buffer *ring, uint32_t seqno)
* Ensures that all rendering to the object has completed and the object is
* safe to unbind from the GTT or access from the CPU.
*/
-int
+static __must_check int
i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj,
bool readonly)
{
@@ -1137,7 +1123,7 @@ i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj,
/* A nonblocking variant of the above wait. This is a highly dangerous routine
* as the object state may change during this call.
*/
-static int
+static __must_check int
i915_gem_object_wait_rendering__nonblocking(struct drm_i915_gem_object *obj,
bool readonly)
{
@@ -1472,7 +1458,7 @@ i915_gem_release_mmap(struct drm_i915_gem_object *obj)
obj->fault_mappable = false;
}
-uint32_t
+static uint32_t
i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode)
{
uint32_t gtt_size;
@@ -1500,7 +1486,7 @@ i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode)
* Return the required GTT alignment for an object, taking into account
* potential fence register mapping.
*/
-uint32_t
+static uint32_t
i915_gem_get_gtt_alignment(struct drm_device *dev,
uint32_t size,
int tiling_mode)
@@ -1549,8 +1535,7 @@ i915_gem_get_unfenced_gtt_alignment(struct drm_device *dev,
return i915_gem_get_gtt_size(dev, size, tiling_mode);
}
-int
-i915_gem_object_create_mmap_offset(struct drm_i915_gem_object *obj)
+static int i915_gem_object_create_mmap_offset(struct drm_i915_gem_object *obj)
{
#if 0
struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
@@ -1590,8 +1575,7 @@ out:
return ret;
}
-void
-i915_gem_object_free_mmap_offset(struct drm_i915_gem_object *obj)
+static void i915_gem_object_free_mmap_offset(struct drm_i915_gem_object *obj)
{
if (!obj->base.map)
return;
@@ -1668,7 +1652,7 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
}
/* Immediately discard the backing storage */
-void
+static void
i915_gem_object_truncate(struct drm_i915_gem_object *obj)
{
DRM_ASSERT_HELD(&obj->base);
@@ -1685,7 +1669,7 @@ i915_gem_object_truncate(struct drm_i915_gem_object *obj)
// i915_gem_object_is_purgeable
-void
+static void
i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj)
{
int page_count = obj->base.size / PAGE_SIZE;
@@ -1743,7 +1727,7 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj)
#endif
}
-int
+static int
i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
{
#if 0
@@ -1828,7 +1812,7 @@ i915_gem_shrink_all(struct drm_i915_private *dev_priv)
}
#endif /* notyet */
-int
+static int
i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
{
#if 0
@@ -2010,7 +1994,7 @@ i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,
}
}
-void
+static void
i915_gem_object_move_to_inactive(struct drm_i915_gem_object *obj)
{
struct drm_device *dev = obj->base.dev;
@@ -2037,7 +2021,7 @@ i915_gem_object_move_to_inactive(struct drm_i915_gem_object *obj)
WARN_ON(i915_verify_lists(dev));
}
-int
+static int
i915_gem_handle_seqno_wrap(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2164,7 +2148,7 @@ i915_add_request(struct intel_ring_buffer *ring,
return 0;
}
-void
+static inline void
i915_gem_request_remove_from_client(struct drm_i915_gem_request *request)
{
struct drm_i915_file_private *file_priv = request->file_priv;
@@ -2180,8 +2164,7 @@ i915_gem_request_remove_from_client(struct drm_i915_gem_request *request)
mtx_leave(&file_priv->mm.lock);
}
-void
-i915_gem_reset_ring_lists(struct drm_i915_private *dev_priv,
+static void i915_gem_reset_ring_lists(struct drm_i915_private *dev_priv,
struct intel_ring_buffer *ring)
{
while (!list_empty(&ring->request_list)) {
@@ -2207,8 +2190,7 @@ i915_gem_reset_ring_lists(struct drm_i915_private *dev_priv,
}
}
-void
-i915_gem_reset_fences(struct drm_device *dev)
+static void i915_gem_reset_fences(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i;
@@ -2229,8 +2211,7 @@ i915_gem_reset_fences(struct drm_device *dev)
INIT_LIST_HEAD(&dev_priv->mm.fence_list);
}
-void
-i915_gem_reset(struct drm_device *dev)
+void i915_gem_reset(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj;
@@ -2371,7 +2352,7 @@ i915_gem_retire_work_handler(void *arg1, void *unused)
* write domains, emitting any outstanding lazy request and retiring and
* completed requests.
*/
-int
+static int
i915_gem_object_flush_active(struct drm_i915_gem_object *obj)
{
int ret;
@@ -2520,8 +2501,7 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
return ret;
}
-void
-i915_gem_object_finish_gtt(struct drm_i915_gem_object *obj)
+static void i915_gem_object_finish_gtt(struct drm_i915_gem_object *obj)
{
u32 old_write_domain, old_read_domains;
@@ -2605,8 +2585,7 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
return 0;
}
-int
-i915_gpu_idle(struct drm_device *dev)
+int i915_gpu_idle(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring;
@@ -2626,8 +2605,7 @@ i915_gpu_idle(struct drm_device *dev)
return 0;
}
-void
-sandybridge_write_fence_reg(struct drm_device *dev, int reg,
+static void sandybridge_write_fence_reg(struct drm_device *dev, int reg,
struct drm_i915_gem_object *obj)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -2652,8 +2630,7 @@ sandybridge_write_fence_reg(struct drm_device *dev, int reg,
POSTING_READ(FENCE_REG_SANDYBRIDGE_0 + reg * 8);
}
-void
-i965_write_fence_reg(struct drm_device *dev, int reg,
+static void i965_write_fence_reg(struct drm_device *dev, int reg,
struct drm_i915_gem_object *obj)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -2676,8 +2653,7 @@ i965_write_fence_reg(struct drm_device *dev, int reg,
POSTING_READ(FENCE_REG_965_0 + reg * 8);
}
-void
-i915_write_fence_reg(struct drm_device *dev, int reg,
+static void i915_write_fence_reg(struct drm_device *dev, int reg,
struct drm_i915_gem_object *obj)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -2721,8 +2697,7 @@ i915_write_fence_reg(struct drm_device *dev, int reg,
POSTING_READ(reg);
}
-void
-i830_write_fence_reg(struct drm_device *dev, int reg,
+static void i830_write_fence_reg(struct drm_device *dev, int reg,
struct drm_i915_gem_object *obj)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -2754,8 +2729,7 @@ i830_write_fence_reg(struct drm_device *dev, int reg,
POSTING_READ(FENCE_REG_830_0 + reg * 4);
}
-void
-i915_gem_write_fence(struct drm_device *dev, int reg,
+static void i915_gem_write_fence(struct drm_device *dev, int reg,
struct drm_i915_gem_object *obj)
{
switch (INTEL_INFO(dev)->gen) {
@@ -2769,23 +2743,20 @@ i915_gem_write_fence(struct drm_device *dev, int reg,
}
}
-static inline int
-fence_number(struct drm_i915_private *dev_priv,
+static inline int fence_number(struct drm_i915_private *dev_priv,
struct drm_i915_fence_reg *fence)
{
return fence - dev_priv->fence_regs;
}
#ifdef __linux__
-void
-i915_gem_write_fence__ipi(void *data)
+static void i915_gem_write_fence__ipi(void *data)
{
wbinvd();
}
#endif
-void
-i915_gem_object_update_fence(struct drm_i915_gem_object *obj,
+static void i915_gem_object_update_fence(struct drm_i915_gem_object *obj,
struct drm_i915_fence_reg *fence,
bool enable)
{
@@ -2822,7 +2793,7 @@ i915_gem_object_update_fence(struct drm_i915_gem_object *obj,
}
}
-int
+static int
i915_gem_object_flush_fence(struct drm_i915_gem_object *obj)
{
if (obj->last_fenced_seqno) {
@@ -2864,7 +2835,7 @@ i915_gem_object_put_fence(struct drm_i915_gem_object *obj)
return 0;
}
-struct drm_i915_fence_reg *
+static struct drm_i915_fence_reg *
i915_find_fence_reg(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2961,15 +2932,14 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj)
// i915_gem_valid_gtt_space
-void
-i915_gem_verify_gtt(struct drm_device *dev)
+static void i915_gem_verify_gtt(struct drm_device *dev)
{
}
/**
* Finds free space in the GTT aperture and binds the object there.
*/
-int
+static int
i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
unsigned alignment,
bool map_and_fenceable,
@@ -3141,7 +3111,7 @@ i915_gem_clflush_object(struct drm_i915_gem_object *obj)
}
/** Flushes the GTT write domain for the object if it's dirty. */
-void
+static void
i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
{
uint32_t old_write_domain;
@@ -3168,7 +3138,7 @@ i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
}
/** Flushes the CPU write domain for the object if it's dirty. */
-void
+static void
i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj)
{
uint32_t old_write_domain;
@@ -3239,8 +3209,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
return 0;
}
-int
-i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
+int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
enum i915_cache_level cache_level)
{
struct drm_device *dev = obj->base.dev;
@@ -3309,8 +3278,7 @@ i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
return 0;
}
-int
-i915_gem_get_caching_ioctl(struct drm_device *dev, void *data,
+int i915_gem_get_caching_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_i915_gem_caching *args = data;
@@ -3335,8 +3303,7 @@ unlock:
return ret;
}
-int
-i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
+int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_i915_gem_caching *args = data;
@@ -3786,8 +3753,7 @@ unlock:
return ret;
}
-void
-i915_gem_object_init(struct drm_i915_gem_object *obj)
+void i915_gem_object_init(struct drm_i915_gem_object *obj)
{
INIT_LIST_HEAD(&obj->mm_list);
INIT_LIST_HEAD(&obj->gtt_list);
@@ -3802,8 +3768,8 @@ i915_gem_object_init(struct drm_i915_gem_object *obj)
i915_gem_info_add_obj(obj->base.dev->dev_private, obj->base.size);
}
-struct drm_i915_gem_object *
-i915_gem_alloc_object(struct drm_device *dev, size_t size)
+struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
+ size_t size)
{
struct drm_i915_gem_object *obj;
@@ -3841,16 +3807,14 @@ i915_gem_alloc_object(struct drm_device *dev, size_t size)
return obj;
}
-int
-i915_gem_init_object(struct drm_obj *obj)
+int i915_gem_init_object(struct drm_obj *obj)
{
BUG();
return 0;
}
-void
-i915_gem_free_object(struct drm_obj *gem_obj)
+void i915_gem_free_object(struct drm_obj *gem_obj)
{
struct drm_i915_gem_object *obj = to_intel_bo(gem_obj);
struct drm_device *dev = obj->base.dev;
@@ -3955,8 +3919,7 @@ void i915_gem_l3_remap(struct drm_device *dev)
}
#endif /* notyet */
-void
-i915_gem_init_swizzling(struct drm_device *dev)
+void i915_gem_init_swizzling(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -3977,7 +3940,7 @@ i915_gem_init_swizzling(struct drm_device *dev)
I915_WRITE(ARB_MODE, _MASKED_BIT_ENABLE(ARB_MODE_SWIZZLE_IVB));
}
-bool
+static bool
intel_enable_blt(struct drm_device *dev)
{
if (!HAS_BLT(dev))
@@ -4066,8 +4029,7 @@ intel_enable_ppgtt(struct drm_device *dev)
}
#endif /* notyet */
-int
-i915_gem_init(struct drm_device *dev)
+int i915_gem_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint64_t gtt_start, gtt_end;
@@ -4190,7 +4152,7 @@ i915_gem_lastclose(struct drm_device *dev)
}
#endif /* notyet */
-void
+static void
init_ring_lists(struct intel_ring_buffer *ring)
{
INIT_LIST_HEAD(&ring->active_list);
@@ -4257,9 +4219,8 @@ i915_gem_load(struct drm_device *dev)
* Create a physically contiguous memory object for this object
* e.g. for cursor + overlay regs
*/
-int
-i915_gem_init_phys_object(struct drm_device *dev,
- int id, int size, int align)
+static int i915_gem_init_phys_object(struct drm_device *dev,
+ int id, int size, int align)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_gem_phys_object *phys_obj;
@@ -4412,7 +4373,7 @@ i915_gem_attach_phys_object(struct drm_device *dev,
return 0;
}
-int
+static int
i915_gem_phys_pwrite(struct drm_device *dev,
struct drm_i915_gem_object *obj,
struct drm_i915_gem_pwrite *args,
@@ -4429,8 +4390,7 @@ i915_gem_phys_pwrite(struct drm_device *dev,
return ret;
}
-void
-i915_gem_release(struct drm_device *dev, struct drm_file *file)
+void i915_gem_release(struct drm_device *dev, struct drm_file *file)
{
struct drm_i915_file_private *file_priv = file->driver_priv;
diff --git a/sys/dev/pci/drm/i915/i915_gem_execbuffer.c b/sys/dev/pci/drm/i915/i915_gem_execbuffer.c
index 322d59b7350..f9fcff3ed6b 100644
--- a/sys/dev/pci/drm/i915/i915_gem_execbuffer.c
+++ b/sys/dev/pci/drm/i915/i915_gem_execbuffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem_execbuffer.c,v 1.12 2013/08/09 08:14:55 jsg Exp $ */
+/* $OpenBSD: i915_gem_execbuffer.c,v 1.13 2013/08/13 10:23:49 jsg Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -53,19 +53,6 @@
#include <sys/queue.h>
#include <sys/workq.h>
-int i915_reset_gen7_sol_offsets(struct drm_device *,
- struct intel_ring_buffer *);
-int i915_gem_execbuffer_wait_for_flips(struct intel_ring_buffer *, u32);
-int i915_gem_execbuffer_move_to_gpu(struct intel_ring_buffer *,
- struct drm_obj **, int);
-void i915_gem_execbuffer_move_to_active(struct drm_obj **, int,
- struct intel_ring_buffer *);
-void i915_gem_execbuffer_retire_commands(struct drm_device *,
- struct drm_file *, struct intel_ring_buffer *);
-int need_reloc_mappable(struct drm_i915_gem_object *);
-int i915_gem_execbuffer_reserve(struct intel_ring_buffer *,
- struct drm_file *, struct list_head *);
-
#ifdef notyet
struct eb_objects {
int and;
@@ -363,20 +350,19 @@ i915_gem_execbuffer_relocate(struct drm_device *dev,
#define __EXEC_OBJECT_HAS_PIN (1<<31)
#define __EXEC_OBJECT_HAS_FENCE (1<<30)
-int
+#ifdef notyet
+static int
need_reloc_mappable(struct drm_i915_gem_object *obj)
{
struct drm_i915_gem_exec_object2 *entry = obj->exec_entry;
return entry->relocation_count && !use_cpu_reloc(obj);
}
-int
+static int
i915_gem_execbuffer_reserve_object(struct drm_i915_gem_object *obj,
struct intel_ring_buffer *ring)
{
-#ifdef notyet
struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
-#endif
struct drm_i915_gem_exec_object2 *entry = obj->exec_entry;
bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4;
bool need_fence, need_mappable;
@@ -421,7 +407,7 @@ i915_gem_execbuffer_reserve_object(struct drm_i915_gem_object *obj,
return 0;
}
-void
+static void
i915_gem_execbuffer_unreserve_object(struct drm_i915_gem_object *obj)
{
struct drm_i915_gem_exec_object2 *entry;
@@ -440,7 +426,7 @@ i915_gem_execbuffer_unreserve_object(struct drm_i915_gem_object *obj)
entry->flags &= ~(__EXEC_OBJECT_HAS_FENCE | __EXEC_OBJECT_HAS_PIN);
}
-int
+static int
i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
struct drm_file *file,
struct list_head *objects)
@@ -539,7 +525,6 @@ err: /* Decrement pin count for bound objects */
} while (1);
}
-#ifdef notyet
static int
i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
struct drm_file *file,
@@ -665,7 +650,7 @@ err:
}
#endif /* notyet */
-int
+static int
i915_gem_execbuffer_wait_for_flips(struct intel_ring_buffer *ring, u32 flips)
{
u32 plane, flip_mask;
@@ -697,7 +682,7 @@ i915_gem_execbuffer_wait_for_flips(struct intel_ring_buffer *ring, u32 flips)
return 0;
}
-int
+static int
i915_gem_execbuffer_move_to_gpu(struct intel_ring_buffer *ring,
struct drm_obj **object_list, int buffer_count)
{
@@ -783,7 +768,7 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec,
}
#endif /* notyet */
-void
+static void
i915_gem_execbuffer_move_to_active(struct drm_obj **object_list,
int buffer_count, struct intel_ring_buffer *ring)
{
@@ -813,7 +798,7 @@ i915_gem_execbuffer_move_to_active(struct drm_obj **object_list,
}
}
-void
+static void
i915_gem_execbuffer_retire_commands(struct drm_device *dev,
struct drm_file *file,
struct intel_ring_buffer *ring)
@@ -825,7 +810,7 @@ i915_gem_execbuffer_retire_commands(struct drm_device *dev,
i915_add_request(ring, file, NULL);
}
-int
+static int
i915_reset_gen7_sol_offsets(struct drm_device *dev,
struct intel_ring_buffer *ring)
{
diff --git a/sys/dev/pci/drm/i915/i915_gem_gtt.c b/sys/dev/pci/drm/i915/i915_gem_gtt.c
index 7924b75f125..0f9f82f7553 100644
--- a/sys/dev/pci/drm/i915/i915_gem_gtt.c
+++ b/sys/dev/pci/drm/i915/i915_gem_gtt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem_gtt.c,v 1.2 2013/08/09 07:55:42 jsg Exp $ */
+/* $OpenBSD: i915_gem_gtt.c,v 1.3 2013/08/13 10:23:49 jsg Exp $ */
/*
* Copyright © 2010 Daniel Vetter
*
@@ -395,8 +395,7 @@ static void i915_ggtt_clear_range(struct drm_device *dev,
}
#endif /* notyet */
-void
-i915_gem_restore_gtt_mappings(struct drm_device *dev)
+void i915_gem_restore_gtt_mappings(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj;
diff --git a/sys/dev/pci/drm/i915/i915_gem_tiling.c b/sys/dev/pci/drm/i915/i915_gem_tiling.c
index 77b6ae97eb7..b4ef59cf64f 100644
--- a/sys/dev/pci/drm/i915/i915_gem_tiling.c
+++ b/sys/dev/pci/drm/i915/i915_gem_tiling.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem_tiling.c,v 1.6 2013/08/07 19:49:07 kettenis Exp $ */
+/* $OpenBSD: i915_gem_tiling.c,v 1.7 2013/08/13 10:23:49 jsg Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -221,7 +221,7 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
}
/* Check pitch constriants for all chips & tiling formats */
-bool
+static bool
i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
{
int tile_width;
@@ -272,7 +272,8 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
return true;
}
-bool
+/* Is the current GTT allocation valid for the change in tiling? */
+static bool
i915_gem_object_fence_ok(struct drm_i915_gem_object *obj, int tiling_mode)
{
u32 size;
@@ -473,7 +474,7 @@ i915_gem_get_tiling(struct drm_device *dev, void *data,
* bit 17 of its physical address and therefore being interpreted differently
* by the GPU.
*/
-int
+static int
i915_gem_swizzle_page(struct vm_page *pg)
{
char temp[64];
diff --git a/sys/dev/pci/drm/i915/i915_irq.c b/sys/dev/pci/drm/i915/i915_irq.c
index 1071dd3fab5..be6c805b72b 100644
--- a/sys/dev/pci/drm/i915/i915_irq.c
+++ b/sys/dev/pci/drm/i915/i915_irq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_irq.c,v 1.6 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: i915_irq.c,v 1.7 2013/08/13 10:23:50 jsg Exp $ */
/* i915_irq.c -- IRQ support for the I915 -*- linux-c -*-
*/
/*
@@ -34,67 +34,8 @@
#include "i915_drv.h"
#include "intel_drv.h"
-void ironlake_enable_display_irq(drm_i915_private_t *, u32);
-void intel_enable_asle(struct drm_device *);
-int i915_pipeconf_enabled(struct drm_device *, int);
-u32 gm45_get_vblank_counter(struct drm_device *, int);
-int i915_get_crtc_scanoutpos(struct drm_device *, int, int *, int *);
-int i915_get_vblank_timestamp(struct drm_device *, int, int *,
- struct timeval *, unsigned);
-void ironlake_handle_rps_change(struct drm_device *);
-void notify_ring(struct drm_device *, struct intel_ring_buffer *);
-void ivybridge_handle_parity_error(struct drm_device *);
-void snb_gt_irq_handler(struct drm_device *, struct drm_i915_private *, u32);
-void snb_gt_irq_handler(struct drm_device *, struct drm_i915_private *, u32);
-void gen6_queue_rps_work(struct drm_i915_private *, u32);
-int valleyview_intr(void *);
-void ibx_irq_handler(struct drm_device *, u32);
-void cpt_irq_handler(struct drm_device *, u32);
-int ivybridge_intr(void *);
-void ilk_gt_irq_handler(struct drm_device *, struct drm_i915_private *, u32);
-int ironlake_intr(void *);
-void i915_get_extra_instdone(struct drm_device *, uint32_t *);
-void i915_report_and_clear_eir(struct drm_device *);
-void i915_handle_error(struct drm_device *, bool);
-void i915_pageflip_stall_check(struct drm_device *, int);
-int ironlake_enable_vblank(struct drm_device *, int);
-int ivybridge_enable_vblank(struct drm_device *, int);
-int valleyview_enable_vblank(struct drm_device *, int);
-void ironlake_disable_vblank(struct drm_device *, int);
-void ivybridge_disable_vblank(struct drm_device *, int);
-void valleyview_disable_vblank(struct drm_device *, int);
-u32 ring_last_seqno(struct intel_ring_buffer *);
-bool i915_hangcheck_ring_idle(struct intel_ring_buffer *, bool *);
-bool kick_ring(struct intel_ring_buffer *);
-bool i915_hangcheck_hung(struct drm_device *);
-void ironlake_irq_preinstall(struct drm_device *);
-void valleyview_irq_preinstall(struct drm_device *);
-void ironlake_enable_pch_hotplug(struct drm_device *);
-int ironlake_irq_postinstall(struct drm_device *);
-int ivybridge_irq_postinstall(struct drm_device *);
-int valleyview_irq_postinstall(struct drm_device *);
-void valleyview_irq_uninstall(struct drm_device *);
-void ironlake_irq_uninstall(struct drm_device *);
-void i8xx_irq_preinstall(struct drm_device *);
-int i8xx_irq_postinstall(struct drm_device *);
-int i8xx_intr(void *);
-void i8xx_irq_uninstall(struct drm_device *);
-void i915_irq_preinstall(struct drm_device *);
-int i915_irq_postinstall(struct drm_device *);
-int i915_intr(void *);
-void i915_irq_uninstall(struct drm_device *);
-void i965_irq_preinstall(struct drm_device *);
-int i965_irq_postinstall(struct drm_device *);
-int i965_intr(void *);
-void i965_irq_uninstall(struct drm_device *);
-void intel_irq_init(struct drm_device *);
-void i915_hotplug_work_func(void *, void *);
-void i915_error_work_func(void *, void *);
-void ivybridge_parity_work(void *, void *);
-void gen6_pm_rps_work(void *, void *);
-
/* For display hotplug interrupt */
-void
+static void
ironlake_enable_display_irq(drm_i915_private_t *dev_priv, u32 mask)
{
if ((dev_priv->irq_mask & mask) != 0) {
@@ -142,8 +83,7 @@ i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
/**
* intel_enable_asle - enable ASLE interrupt for OpRegion
*/
-void
-intel_enable_asle(struct drm_device *dev)
+void intel_enable_asle(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -167,7 +107,7 @@ intel_enable_asle(struct drm_device *dev)
}
/**
- * i915_pipeconf_enabled - check if a pipe is enabled
+ * i915_pipe_enabled - check if a pipe is enabled
* @dev: DRM device
* @pipe: pipe to check
*
@@ -175,8 +115,8 @@ intel_enable_asle(struct drm_device *dev)
* Use this routine to make sure the PLL is running and the pipe is active
* before reading such registers if unsure.
*/
-int
-i915_pipeconf_enabled(struct drm_device *dev, int pipe)
+static int
+i915_pipe_enabled(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
@@ -188,15 +128,14 @@ i915_pipeconf_enabled(struct drm_device *dev, int pipe)
/* Called from drm generic code, passed a 'crtc', which
* we use as a pipe index
*/
-u32
-i915_get_vblank_counter(struct drm_device *dev, int pipe)
+static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
unsigned long high_frame;
unsigned long low_frame;
u32 high1, high2, low;
- if (!i915_pipeconf_enabled(dev, pipe)) {
+ if (!i915_pipe_enabled(dev, pipe)) {
DRM_DEBUG_DRIVER("trying to get vblank count for disabled "
"pipe %c\n", pipe_name(pipe));
return 0;
@@ -221,13 +160,12 @@ i915_get_vblank_counter(struct drm_device *dev, int pipe)
return (high1 << 8) | low;
}
-u32
-gm45_get_vblank_counter(struct drm_device *dev, int pipe)
+static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int reg = PIPE_FRMCOUNT_GM45(pipe);
- if (!i915_pipeconf_enabled(dev, pipe)) {
+ if (!i915_pipe_enabled(dev, pipe)) {
DRM_DEBUG_DRIVER("trying to get vblank count for disabled "
"pipe %c\n", pipe_name(pipe));
return 0;
@@ -236,8 +174,7 @@ gm45_get_vblank_counter(struct drm_device *dev, int pipe)
return I915_READ(reg);
}
-int
-i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
+static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
int *vpos, int *hpos)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -248,7 +185,7 @@ i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
pipe);
- if (!i915_pipeconf_enabled(dev, pipe)) {
+ if (!i915_pipe_enabled(dev, pipe)) {
DRM_DEBUG_DRIVER("trying to get scanoutpos for disabled "
"pipe %c\n", pipe_name(pipe));
return 0;
@@ -305,8 +242,7 @@ i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
return ret;
}
-int
-i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
+static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
int *max_error,
struct timeval *vblank_time,
unsigned flags)
@@ -340,8 +276,7 @@ i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
/*
* Handle hotplug events outside the interrupt handler proper.
*/
-void
-i915_hotplug_work_func(void *arg1, void *arg2)
+static void i915_hotplug_work_func(void *arg1, void *arg2)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *)arg1;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -364,8 +299,7 @@ i915_hotplug_work_func(void *arg1, void *arg2)
/* defined intel_pm.c */
extern struct mutex mchdev_lock;
-void
-ironlake_handle_rps_change(struct drm_device *dev)
+static void ironlake_handle_rps_change(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
u32 busy_up, busy_down, max_avg, min_avg;
@@ -404,8 +338,7 @@ ironlake_handle_rps_change(struct drm_device *dev)
return;
}
-void
-notify_ring(struct drm_device *dev,
+static void notify_ring(struct drm_device *dev,
struct intel_ring_buffer *ring)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -423,8 +356,7 @@ notify_ring(struct drm_device *dev,
}
}
-void
-gen6_pm_rps_work(void *arg1, void *arg2)
+static void gen6_pm_rps_work(void *arg1, void *arg2)
{
drm_i915_private_t *dev_priv = arg1;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -468,8 +400,7 @@ gen6_pm_rps_work(void *arg1, void *arg2)
* this event, userspace should try to remap the bad rows since statistically
* it is likely the same row is more likely to go bad again.
*/
-void
-ivybridge_parity_work(void *arg1, void *arg2)
+static void ivybridge_parity_work(void *arg1, void *arg2)
{
drm_i915_private_t *dev_priv = arg1;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -528,8 +459,7 @@ ivybridge_parity_work(void *arg1, void *arg2)
#endif
}
-void
-ivybridge_handle_parity_error(struct drm_device *dev)
+static void ivybridge_handle_parity_error(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -546,8 +476,7 @@ ivybridge_handle_parity_error(struct drm_device *dev)
}
-void
-snb_gt_irq_handler(struct drm_device *dev,
+static void snb_gt_irq_handler(struct drm_device *dev,
struct drm_i915_private *dev_priv,
u32 gt_iir)
{
@@ -571,8 +500,7 @@ snb_gt_irq_handler(struct drm_device *dev,
ivybridge_handle_parity_error(dev);
}
-void
-gen6_queue_rps_work(struct drm_i915_private *dev_priv,
+static void gen6_queue_rps_work(struct drm_i915_private *dev_priv,
u32 pm_iir)
{
/*
@@ -595,8 +523,7 @@ gen6_queue_rps_work(struct drm_i915_private *dev_priv,
dev_priv, NULL);
}
-int
-valleyview_intr(void *arg)
+static int valleyview_intr(void *arg)
{
drm_i915_private_t *dev_priv = arg;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -676,8 +603,7 @@ out:
return ret;
}
-void
-ibx_irq_handler(struct drm_device *dev, u32 pch_iir)
+static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -721,8 +647,7 @@ ibx_irq_handler(struct drm_device *dev, u32 pch_iir)
DRM_DEBUG_DRIVER("PCH transcoder A underrun interrupt\n");
}
-void
-cpt_irq_handler(struct drm_device *dev, u32 pch_iir)
+static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -755,8 +680,7 @@ cpt_irq_handler(struct drm_device *dev, u32 pch_iir)
I915_READ(FDI_RX_IIR(pipe)));
}
-int
-ivybridge_intr(void *arg)
+static int ivybridge_intr(void *arg)
{
drm_i915_private_t *dev_priv = arg;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -819,8 +743,7 @@ ivybridge_intr(void *arg)
return ret;
}
-void
-ilk_gt_irq_handler(struct drm_device *dev,
+static void ilk_gt_irq_handler(struct drm_device *dev,
struct drm_i915_private *dev_priv,
u32 gt_iir)
{
@@ -830,8 +753,7 @@ ilk_gt_irq_handler(struct drm_device *dev,
notify_ring(dev, &dev_priv->ring[VCS]);
}
-int
-ironlake_intr(void *arg)
+static int ironlake_intr(void *arg)
{
drm_i915_private_t *dev_priv = arg;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -914,8 +836,7 @@ done:
* Fire an error uevent so userspace can see that a hang or error
* was detected.
*/
-void
-i915_error_work_func(void *arg1, void *arg2)
+static void i915_error_work_func(void *arg1, void *arg2)
{
drm_i915_private_t *dev_priv = arg1;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -942,8 +863,7 @@ i915_error_work_func(void *arg1, void *arg2)
}
/* NB: please notice the memset */
-void
-i915_get_extra_instdone(struct drm_device *dev,
+static void i915_get_extra_instdone(struct drm_device *dev,
uint32_t *instdone)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -972,7 +892,7 @@ i915_get_extra_instdone(struct drm_device *dev,
}
#ifdef CONFIG_DEBUG_FS
-struct drm_i915_error_object *
+static struct drm_i915_error_object *
i915_error_object_create(struct drm_i915_private *dev_priv,
struct drm_i915_gem_object *src)
{
@@ -1044,7 +964,7 @@ unwind:
return NULL;
}
-void
+static void
i915_error_object_free(struct drm_i915_error_object *obj)
{
int page;
@@ -1075,9 +995,7 @@ i915_error_state_free(struct kref *error_ref)
kfree(error->overlay);
kfree(error);
}
-
-void
-capture_bo(struct drm_i915_error_buffer *err,
+static void capture_bo(struct drm_i915_error_buffer *err,
struct drm_i915_gem_object *obj)
{
err->size = obj->base.size;
@@ -1100,8 +1018,7 @@ capture_bo(struct drm_i915_error_buffer *err,
err->cache_level = obj->cache_level;
}
-u32
-capture_active_bo(struct drm_i915_error_buffer *err,
+static u32 capture_active_bo(struct drm_i915_error_buffer *err,
int count, struct list_head *head)
{
struct drm_i915_gem_object *obj;
@@ -1116,8 +1033,7 @@ capture_active_bo(struct drm_i915_error_buffer *err,
return i;
}
-u32
-capture_pinned_bo(struct drm_i915_error_buffer *err,
+static u32 capture_pinned_bo(struct drm_i915_error_buffer *err,
int count, struct list_head *head)
{
struct drm_i915_gem_object *obj;
@@ -1135,8 +1051,7 @@ capture_pinned_bo(struct drm_i915_error_buffer *err,
return i;
}
-void
-i915_gem_record_fences(struct drm_device *dev,
+static void i915_gem_record_fences(struct drm_device *dev,
struct drm_i915_error_state *error)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1166,7 +1081,7 @@ i915_gem_record_fences(struct drm_device *dev,
}
}
-struct drm_i915_error_object *
+static struct drm_i915_error_object *
i915_error_first_batchbuffer(struct drm_i915_private *dev_priv,
struct intel_ring_buffer *ring)
{
@@ -1208,8 +1123,7 @@ i915_error_first_batchbuffer(struct drm_i915_private *dev_priv,
return NULL;
}
-void
-i915_record_ring_state(struct drm_device *dev,
+static void i915_record_ring_state(struct drm_device *dev,
struct drm_i915_error_state *error,
struct intel_ring_buffer *ring)
{
@@ -1253,8 +1167,7 @@ i915_record_ring_state(struct drm_device *dev,
error->cpu_ring_tail[ring->id] = ring->tail;
}
-void
-i915_gem_record_rings(struct drm_device *dev,
+static void i915_gem_record_rings(struct drm_device *dev,
struct drm_i915_error_state *error)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1305,8 +1218,7 @@ i915_gem_record_rings(struct drm_device *dev,
* out a structure which becomes available in debugfs for user level tools
* to pick up.
*/
-void
-i915_capture_error_state(struct drm_device *dev)
+static void i915_capture_error_state(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_object *obj;
@@ -1421,8 +1333,7 @@ i915_capture_error_state(struct drm_device *dev)
i915_error_state_free(&error->ref);
}
-void
-i915_destroy_error_state(struct drm_device *dev)
+void i915_destroy_error_state(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_error_state *error;
@@ -1440,8 +1351,7 @@ i915_destroy_error_state(struct drm_device *dev)
#define i915_capture_error_state(x)
#endif
-void
-i915_report_and_clear_eir(struct drm_device *dev)
+static void i915_report_and_clear_eir(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t instdone[I915_NUM_INSTDONE_REG];
@@ -1543,8 +1453,7 @@ i915_report_and_clear_eir(struct drm_device *dev)
* so userspace knows something bad happened (should trigger collection
* of a ring dump etc.).
*/
-void
-i915_handle_error(struct drm_device *dev, bool wedged)
+void i915_handle_error(struct drm_device *dev, bool wedged)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring;
@@ -1568,8 +1477,7 @@ i915_handle_error(struct drm_device *dev, bool wedged)
i915_error_work_func, dev_priv, NULL);
}
-void
-i915_pageflip_stall_check(struct drm_device *dev, int pipe)
+static void i915_pageflip_stall_check(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
@@ -1617,12 +1525,11 @@ i915_pageflip_stall_check(struct drm_device *dev, int pipe)
/* Called from drm generic code, passed 'crtc' which
* we use as a pipe index
*/
-int
-i915_enable_vblank(struct drm_device *dev, int pipe)
+static int i915_enable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
- if (!i915_pipeconf_enabled(dev, pipe))
+ if (!i915_pipe_enabled(dev, pipe))
return -EINVAL;
mtx_enter(&dev_priv->irq_lock);
@@ -1641,12 +1548,11 @@ i915_enable_vblank(struct drm_device *dev, int pipe)
return 0;
}
-int
-ironlake_enable_vblank(struct drm_device *dev, int pipe)
+static int ironlake_enable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
- if (!i915_pipeconf_enabled(dev, pipe))
+ if (!i915_pipe_enabled(dev, pipe))
return -EINVAL;
mtx_enter(&dev_priv->irq_lock);
@@ -1657,12 +1563,11 @@ ironlake_enable_vblank(struct drm_device *dev, int pipe)
return 0;
}
-int
-ivybridge_enable_vblank(struct drm_device *dev, int pipe)
+static int ivybridge_enable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
- if (!i915_pipeconf_enabled(dev, pipe))
+ if (!i915_pipe_enabled(dev, pipe))
return -EINVAL;
mtx_enter(&dev_priv->irq_lock);
@@ -1673,13 +1578,12 @@ ivybridge_enable_vblank(struct drm_device *dev, int pipe)
return 0;
}
-int
-valleyview_enable_vblank(struct drm_device *dev, int pipe)
+static int valleyview_enable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u32 imr;
- if (!i915_pipeconf_enabled(dev, pipe))
+ if (!i915_pipe_enabled(dev, pipe))
return -EINVAL;
mtx_enter(&dev_priv->irq_lock);
@@ -1699,8 +1603,7 @@ valleyview_enable_vblank(struct drm_device *dev, int pipe)
/* Called from drm generic code, passed 'crtc' which
* we use as a pipe index
*/
-void
-i915_disable_vblank(struct drm_device *dev, int pipe)
+static void i915_disable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -1714,8 +1617,7 @@ i915_disable_vblank(struct drm_device *dev, int pipe)
mtx_leave(&dev_priv->irq_lock);
}
-void
-ironlake_disable_vblank(struct drm_device *dev, int pipe)
+static void ironlake_disable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -1725,8 +1627,7 @@ ironlake_disable_vblank(struct drm_device *dev, int pipe)
mtx_leave(&dev_priv->irq_lock);
}
-void
-ivybridge_disable_vblank(struct drm_device *dev, int pipe)
+static void ivybridge_disable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -1736,8 +1637,7 @@ ivybridge_disable_vblank(struct drm_device *dev, int pipe)
mtx_leave(&dev_priv->irq_lock);
}
-void
-valleyview_disable_vblank(struct drm_device *dev, int pipe)
+static void valleyview_disable_vblank(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u32 imr;
@@ -1754,15 +1654,14 @@ valleyview_disable_vblank(struct drm_device *dev, int pipe)
mtx_leave(&dev_priv->irq_lock);
}
-u32
+static u32
ring_last_seqno(struct intel_ring_buffer *ring)
{
return list_entry(ring->request_list.prev,
struct drm_i915_gem_request, list)->seqno;
}
-bool
-i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err)
+static bool i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err)
{
if (list_empty(&ring->request_list) ||
i915_seqno_passed(ring->get_seqno(ring, false),
@@ -1782,8 +1681,7 @@ i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err)
return false;
}
-bool
-kick_ring(struct intel_ring_buffer *ring)
+static bool kick_ring(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1797,8 +1695,7 @@ kick_ring(struct intel_ring_buffer *ring)
return false;
}
-bool
-i915_hangcheck_hung(struct drm_device *dev)
+static bool i915_hangcheck_hung(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -1833,8 +1730,7 @@ i915_hangcheck_hung(struct drm_device *dev)
* ACTHD. If ACTHD hasn't changed by the time the hangcheck timer elapses
* again, we assume the chip is wedged and try to fix it.
*/
-void
-i915_hangcheck_elapsed(void *arg)
+void i915_hangcheck_elapsed(void *arg)
{
drm_i915_private_t *dev_priv = arg;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1885,8 +1781,7 @@ repeat:
/* drm_dma.h hooks
*/
-void
-ironlake_irq_preinstall(struct drm_device *dev)
+static void ironlake_irq_preinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -1911,8 +1806,7 @@ ironlake_irq_preinstall(struct drm_device *dev)
POSTING_READ(SDEIER);
}
-void
-valleyview_irq_preinstall(struct drm_device *dev)
+static void valleyview_irq_preinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -1951,8 +1845,7 @@ valleyview_irq_preinstall(struct drm_device *dev)
* This register is the same on all known PCH chips.
*/
-void
-ironlake_enable_pch_hotplug(struct drm_device *dev)
+static void ironlake_enable_pch_hotplug(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u32 hotplug;
@@ -1965,8 +1858,7 @@ ironlake_enable_pch_hotplug(struct drm_device *dev)
I915_WRITE(PCH_PORT_HOTPLUG, hotplug);
}
-int
-ironlake_irq_postinstall(struct drm_device *dev)
+static int ironlake_irq_postinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
/* enable kind of interrupts always enabled */
@@ -2033,8 +1925,7 @@ ironlake_irq_postinstall(struct drm_device *dev)
return 0;
}
-int
-ivybridge_irq_postinstall(struct drm_device *dev)
+static int ivybridge_irq_postinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
/* enable kind of interrupts always enabled */
@@ -2084,8 +1975,7 @@ ivybridge_irq_postinstall(struct drm_device *dev)
return 0;
}
-int
-valleyview_irq_postinstall(struct drm_device *dev)
+static int valleyview_irq_postinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u32 enable_mask;
@@ -2167,8 +2057,7 @@ valleyview_irq_postinstall(struct drm_device *dev)
return 0;
}
-void
-valleyview_irq_uninstall(struct drm_device *dev)
+static void valleyview_irq_uninstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -2190,8 +2079,7 @@ valleyview_irq_uninstall(struct drm_device *dev)
POSTING_READ(VLV_IER);
}
-void
-ironlake_irq_uninstall(struct drm_device *dev)
+static void ironlake_irq_uninstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -2213,8 +2101,7 @@ ironlake_irq_uninstall(struct drm_device *dev)
I915_WRITE(SDEIIR, I915_READ(SDEIIR));
}
-void
-i8xx_irq_preinstall(struct drm_device * dev)
+static void i8xx_irq_preinstall(struct drm_device * dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -2228,8 +2115,7 @@ i8xx_irq_preinstall(struct drm_device * dev)
POSTING_READ16(IER);
}
-int
-i8xx_irq_postinstall(struct drm_device *dev)
+static int i8xx_irq_postinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -2258,8 +2144,7 @@ i8xx_irq_postinstall(struct drm_device *dev)
return 0;
}
-int
-i8xx_intr(void *arg)
+static int i8xx_intr(void *arg)
{
drm_i915_private_t *dev_priv = arg;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2336,8 +2221,7 @@ i8xx_intr(void *arg)
return 1;
}
-void
-i8xx_irq_uninstall(struct drm_device * dev)
+static void i8xx_irq_uninstall(struct drm_device * dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -2352,8 +2236,7 @@ i8xx_irq_uninstall(struct drm_device * dev)
I915_WRITE16(IIR, I915_READ16(IIR));
}
-void
-i915_irq_preinstall(struct drm_device * dev)
+static void i915_irq_preinstall(struct drm_device * dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -2373,8 +2256,7 @@ i915_irq_preinstall(struct drm_device * dev)
POSTING_READ(IER);
}
-int
-i915_irq_postinstall(struct drm_device *dev)
+static int i915_irq_postinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u32 enable_mask;
@@ -2439,8 +2321,7 @@ i915_irq_postinstall(struct drm_device *dev)
return 0;
}
-int
-i915_intr(void *arg)
+static int i915_intr(void *arg)
{
drm_i915_private_t *dev_priv = arg;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2553,8 +2434,7 @@ i915_intr(void *arg)
return ret;
}
-void
-i915_irq_uninstall(struct drm_device * dev)
+static void i915_irq_uninstall(struct drm_device * dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -2576,8 +2456,7 @@ i915_irq_uninstall(struct drm_device * dev)
I915_WRITE(IIR, I915_READ(IIR));
}
-void
-i965_irq_preinstall(struct drm_device * dev)
+static void i965_irq_preinstall(struct drm_device * dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -2595,8 +2474,7 @@ i965_irq_preinstall(struct drm_device * dev)
POSTING_READ(IER);
}
-int
-i965_irq_postinstall(struct drm_device *dev)
+static int i965_irq_postinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u32 hotplug_en;
@@ -2680,8 +2558,7 @@ i965_irq_postinstall(struct drm_device *dev)
return 0;
}
-int
-i965_intr(void *arg)
+static int i965_intr(void *arg)
{
drm_i915_private_t *dev_priv = arg;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2796,8 +2673,7 @@ i965_intr(void *arg)
return ret;
}
-void
-i965_irq_uninstall(struct drm_device * dev)
+static void i965_irq_uninstall(struct drm_device * dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -2820,8 +2696,7 @@ i965_irq_uninstall(struct drm_device * dev)
I915_WRITE(IIR, I915_READ(IIR));
}
-void
-intel_irq_init(struct drm_device *dev)
+void intel_irq_init(struct drm_device *dev)
{
dev->driver->get_vblank_counter = i915_get_vblank_counter;
diff --git a/sys/dev/pci/drm/i915/i915_suspend.c b/sys/dev/pci/drm/i915/i915_suspend.c
index 7da8cf98c00..370ff96924e 100644
--- a/sys/dev/pci/drm/i915/i915_suspend.c
+++ b/sys/dev/pci/drm/i915/i915_suspend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_suspend.c,v 1.3 2013/07/08 09:47:45 jsg Exp $ */
+/* $OpenBSD: i915_suspend.c,v 1.4 2013/08/13 10:23:50 jsg Exp $ */
/*
*
* Copyright 2008 (c) Intel Corporation
@@ -31,24 +31,7 @@
#include "intel_drv.h"
#include "i915_reg.h"
-bool i915_pipe_enabled(struct drm_device *, enum pipe);
-void i915_save_palette(struct drm_device *, enum pipe);
-void i915_restore_palette(struct drm_device *, enum pipe);
-u_int8_t i915_read_indexed(struct drm_device *, u_int16_t,
- u_int16_t, u_int8_t);
-void i915_write_indexed(struct drm_device *, u_int16_t,
- u_int16_t, u_int8_t, u_int8_t);
-void i915_write_ar(struct drm_device *, u_int16_t, u_int8_t,
- u_int8_t, u_int16_t);
-u_int8_t i915_read_ar(struct drm_device *, u_int16_t,
- u_int8_t, u_int16_t);
-void i915_save_vga(struct drm_device *);
-void i915_restore_vga(struct drm_device *);
-void i915_save_modeset_reg(struct drm_device *);
-void i915_restore_modeset_reg(struct drm_device *);
-
-bool
-i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
+static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 dpll_reg;
@@ -65,8 +48,7 @@ i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
return (I915_READ(dpll_reg) & DPLL_VCO_ENABLE);
}
-void
-i915_save_palette(struct drm_device *dev, enum pipe pipe)
+static void i915_save_palette(struct drm_device *dev, enum pipe pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
unsigned long reg = (pipe == PIPE_A ? _PALETTE_A : _PALETTE_B);
@@ -88,8 +70,7 @@ i915_save_palette(struct drm_device *dev, enum pipe pipe)
array[i] = I915_READ(reg + (i << 2));
}
-void
-i915_restore_palette(struct drm_device *dev, enum pipe pipe)
+static void i915_restore_palette(struct drm_device *dev, enum pipe pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
unsigned long reg = (pipe == PIPE_A ? _PALETTE_A : _PALETTE_B);
@@ -111,9 +92,7 @@ i915_restore_palette(struct drm_device *dev, enum pipe pipe)
I915_WRITE(reg + (i << 2), array[i]);
}
-u_int8_t
-i915_read_indexed(struct drm_device *dev, u_int16_t index_port,
- u_int16_t data_port, u_int8_t reg)
+static u8 i915_read_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -121,9 +100,7 @@ i915_read_indexed(struct drm_device *dev, u_int16_t index_port,
return I915_READ8(data_port);
}
-u_int8_t
-i915_read_ar(struct drm_device *dev, u_int16_t st01,
- u_int8_t reg, u_int16_t palette_enable)
+static u8 i915_read_ar(struct drm_device *dev, u16 st01, u8 reg, u16 palette_enable)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -132,9 +109,7 @@ i915_read_ar(struct drm_device *dev, u_int16_t st01,
return I915_READ8(VGA_AR_DATA_READ);
}
-void
-i915_write_ar(struct drm_device *dev, u_int16_t st01, u_int8_t reg,
- u_int8_t val, u_int16_t palette_enable)
+static void i915_write_ar(struct drm_device *dev, u16 st01, u8 reg, u8 val, u16 palette_enable)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -143,9 +118,7 @@ i915_write_ar(struct drm_device *dev, u_int16_t st01, u_int8_t reg,
I915_WRITE8(VGA_AR_DATA_WRITE, val);
}
-void
-i915_write_indexed(struct drm_device *dev, u_int16_t index_port,
- u_int16_t data_port, u_int8_t reg, u_int8_t val)
+static void i915_write_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg, u8 val)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -153,8 +126,7 @@ i915_write_indexed(struct drm_device *dev, u_int16_t index_port,
I915_WRITE8(data_port, val);
}
-void
-i915_save_vga(struct drm_device *dev)
+static void i915_save_vga(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i;
@@ -212,8 +184,7 @@ i915_save_vga(struct drm_device *dev)
i915_read_indexed(dev, VGA_SR_INDEX, VGA_SR_DATA, i);
}
-void
-i915_restore_vga(struct drm_device *dev)
+static void i915_restore_vga(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i;
@@ -266,8 +237,7 @@ i915_restore_vga(struct drm_device *dev)
I915_WRITE8(VGA_DACMASK, dev_priv->regfile.saveDACMASK);
}
-void
-i915_save_modeset_reg(struct drm_device *dev)
+static void i915_save_modeset_reg(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i;
@@ -435,8 +405,7 @@ i915_save_modeset_reg(struct drm_device *dev)
return;
}
-void
-i915_restore_modeset_reg(struct drm_device *dev)
+static void i915_restore_modeset_reg(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int dpll_a_reg, fpa0_reg, fpa1_reg;
@@ -648,8 +617,7 @@ i915_restore_modeset_reg(struct drm_device *dev)
return;
}
-void
-i915_save_display(struct drm_device *dev)
+static void i915_save_display(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -736,8 +704,7 @@ i915_save_display(struct drm_device *dev)
i915_save_vga(dev);
}
-void
-i915_restore_display(struct drm_device *dev)
+static void i915_restore_display(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -837,8 +804,7 @@ i915_restore_display(struct drm_device *dev)
i915_restore_vga(dev);
}
-int
-i915_save_state(struct drm_device *dev)
+int i915_save_state(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i;
@@ -888,8 +854,7 @@ i915_save_state(struct drm_device *dev)
return 0;
}
-int
-i915_restore_state(struct drm_device *dev)
+int i915_restore_state(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i;
diff --git a/sys/dev/pci/drm/i915/intel_bios.c b/sys/dev/pci/drm/i915/intel_bios.c
index 9bf44736f91..3a1ffbefe35 100644
--- a/sys/dev/pci/drm/i915/intel_bios.c
+++ b/sys/dev/pci/drm/i915/intel_bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_bios.c,v 1.4 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_bios.c,v 1.5 2013/08/13 10:23:50 jsg Exp $ */
/*
* Copyright © 2006 Intel Corporation
*
@@ -36,37 +36,9 @@
#define SLAVE_ADDR1 0x70
#define SLAVE_ADDR2 0x72
-void *find_section(struct bdb_header *, int);
-u16 get_blocksize(void *);
-void fill_detail_timing_data(struct drm_display_mode *,
- const struct lvds_dvo_timing *);
-bool lvds_dvo_timing_equal_size(const struct lvds_dvo_timing *,
- const struct lvds_dvo_timing *);
-const struct lvds_dvo_timing *
- get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *,
- const struct bdb_lvds_lfp_data_ptrs *, int);
-void parse_lfp_panel_data(struct drm_i915_private *, struct bdb_header *);
-void parse_sdvo_panel_data(struct drm_i915_private *, struct bdb_header *);
-int intel_bios_ssc_frequency(struct drm_device *, bool);
-void parse_general_features(struct drm_i915_private *, struct bdb_header *);
-void parse_general_definitions(struct drm_i915_private *,
- struct bdb_header *);
-void parse_sdvo_device_mapping(struct drm_i915_private *,
- struct bdb_header *);
-void parse_driver_features(struct drm_i915_private *, struct bdb_header *);
-void parse_edp(struct drm_i915_private *, struct bdb_header *);
-void parse_device_mapping(struct drm_i915_private *, struct bdb_header *);
-void init_vbt_defaults(struct drm_i915_private *);
-int intel_no_opregion_vbt_callback(const struct dmi_system_id *);
-const struct lvds_fp_timing *
- get_lvds_fp_timing(const struct bdb_header *,
- const struct bdb_lvds_lfp_data *,
- const struct bdb_lvds_lfp_data_ptrs *, int);
-bool dmi_found(const struct dmi_system_id *);
-
static int panel_type;
-void *
+static void *
find_section(struct bdb_header *bdb, int section_id)
{
u8 *base = (u8 *)bdb;
@@ -92,7 +64,7 @@ find_section(struct bdb_header *bdb, int section_id)
return NULL;
}
-u16
+static u16
get_blocksize(void *p)
{
u16 *block_ptr, block_size;
@@ -102,7 +74,7 @@ get_blocksize(void *p)
return block_size;
}
-void
+static void
fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
const struct lvds_dvo_timing *dvo_timing)
{
@@ -145,7 +117,7 @@ fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
drm_mode_set_name(panel_fixed_mode);
}
-bool
+static bool
lvds_dvo_timing_equal_size(const struct lvds_dvo_timing *a,
const struct lvds_dvo_timing *b)
{
@@ -181,7 +153,7 @@ lvds_dvo_timing_equal_size(const struct lvds_dvo_timing *a,
return true;
}
-const struct lvds_dvo_timing *
+static const struct lvds_dvo_timing *
get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs,
int index)
@@ -206,7 +178,7 @@ get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
/* get lvds_fp_timing entry
* this function may return NULL if the corresponding entry is invalid
*/
-const struct lvds_fp_timing *
+static const struct lvds_fp_timing *
get_lvds_fp_timing(const struct bdb_header *bdb,
const struct bdb_lvds_lfp_data *data,
const struct bdb_lvds_lfp_data_ptrs *ptrs,
@@ -226,7 +198,7 @@ get_lvds_fp_timing(const struct bdb_header *bdb,
}
/* Try to find integrated panel data */
-void
+static void
parse_lfp_panel_data(struct drm_i915_private *dev_priv,
struct bdb_header *bdb)
{
@@ -313,7 +285,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
}
/* Try to find sdvo panel data */
-void
+static void
parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
struct bdb_header *bdb)
{
@@ -354,8 +326,7 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
drm_mode_debug_printmodeline(panel_fixed_mode);
}
-int
-intel_bios_ssc_frequency(struct drm_device *dev,
+static int intel_bios_ssc_frequency(struct drm_device *dev,
bool alternate)
{
switch (INTEL_INFO(dev)->gen) {
@@ -369,7 +340,7 @@ intel_bios_ssc_frequency(struct drm_device *dev,
}
}
-void
+static void
parse_general_features(struct drm_i915_private *dev_priv,
struct bdb_header *bdb)
{
@@ -395,7 +366,7 @@ parse_general_features(struct drm_i915_private *dev_priv,
}
}
-void
+static void
parse_general_definitions(struct drm_i915_private *dev_priv,
struct bdb_header *bdb)
{
@@ -416,7 +387,7 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
}
}
-void
+static void
parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
struct bdb_header *bdb)
{
@@ -506,7 +477,7 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
return;
}
-void
+static void
parse_driver_features(struct drm_i915_private *dev_priv,
struct bdb_header *bdb)
{
@@ -525,7 +496,7 @@ parse_driver_features(struct drm_i915_private *dev_priv,
dev_priv->render_reclock_avail = true;
}
-void
+static void
parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -602,7 +573,7 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
}
}
-void
+static void
parse_device_mapping(struct drm_i915_private *dev_priv,
struct bdb_header *bdb)
{
@@ -668,7 +639,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
return;
}
-void
+static void
init_vbt_defaults(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -692,8 +663,7 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
DRM_DEBUG_KMS("Set default to SSC at %dMHz\n", dev_priv->lvds_ssc_freq);
}
-int
-intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
+static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
{
DRM_DEBUG_KMS("Falling back to manually reading VBT from "
"VBIOS ROM for %s\n",
@@ -715,7 +685,7 @@ static const struct dmi_system_id intel_no_opregion_vbt[] = {
extern char *hw_vendor, *hw_prod;
-bool
+static bool
dmi_found(const struct dmi_system_id *dsi)
{
int i, slot;
@@ -837,8 +807,7 @@ intel_parse_bios(struct drm_device *dev)
/* Ensure that vital registers have been initialised, even if the BIOS
* is absent or just failing to do its job.
*/
-void
-intel_setup_bios(struct drm_device *dev)
+void intel_setup_bios(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
diff --git a/sys/dev/pci/drm/i915/intel_crt.c b/sys/dev/pci/drm/i915/intel_crt.c
index 6088af5ff3d..483e0560aae 100644
--- a/sys/dev/pci/drm/i915/intel_crt.c
+++ b/sys/dev/pci/drm/i915/intel_crt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_crt.c,v 1.4 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_crt.c,v 1.5 2013/08/13 10:23:50 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
*
@@ -50,52 +50,18 @@ struct intel_crt {
u32 adpa_reg;
};
-struct intel_crt *intel_attached_crt(struct drm_connector *);
-void intel_crt_dpms(struct drm_connector *, int);
-int intel_crt_mode_valid(struct drm_connector *,
- struct drm_display_mode *);
-bool intel_crt_mode_fixup(struct drm_encoder *, const struct drm_display_mode *,
- struct drm_display_mode *);
-void intel_crt_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-bool intel_ironlake_crt_detect_hotplug(struct drm_connector *);
-bool intel_crt_detect_hotplug(struct drm_connector *);
-bool intel_crt_detect_ddc(struct drm_connector *);
-enum drm_connector_status intel_crt_load_detect(struct intel_crt *);
-enum drm_connector_status intel_crt_detect(struct drm_connector *, bool);
-void intel_crt_destroy(struct drm_connector *);
-int intel_crt_get_modes(struct drm_connector *);
-int intel_crt_set_property(struct drm_connector *, struct drm_property *,
- uint64_t);
-void intel_crt_reset(struct drm_connector *);
-int intel_no_crt_dmi_callback(const struct dmi_system_id *);
-struct intel_crt *
- intel_encoder_to_crt(struct intel_encoder *);
-bool intel_crt_get_hw_state(struct intel_encoder *, enum pipe *);
-void intel_disable_crt(struct intel_encoder *);
-void intel_enable_crt(struct intel_encoder *);
-void intel_crt_set_dpms(struct intel_encoder *, int);
-bool valleyview_crt_detect_hotplug(struct drm_connector *);
-struct edid *
- intel_crt_get_edid(struct drm_connector *, struct i2c_controller *);
-int intel_crt_ddc_get_modes(struct drm_connector *,
- struct i2c_controller *);
-
-struct intel_crt *
-intel_attached_crt(struct drm_connector *connector)
+static struct intel_crt *intel_attached_crt(struct drm_connector *connector)
{
return container_of(intel_attached_encoder(connector),
struct intel_crt, base);
}
-struct intel_crt *
-intel_encoder_to_crt(struct intel_encoder *encoder)
+static struct intel_crt *intel_encoder_to_crt(struct intel_encoder *encoder)
{
return container_of(encoder, struct intel_crt, base);
}
-bool
-intel_crt_get_hw_state(struct intel_encoder *encoder,
+static bool intel_crt_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct drm_device *dev = encoder->base.dev;
@@ -118,8 +84,7 @@ intel_crt_get_hw_state(struct intel_encoder *encoder,
/* Note: The caller is required to filter out dpms modes not supported by the
* platform. */
-void
-intel_crt_set_dpms(struct intel_encoder *encoder, int mode)
+static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -148,22 +113,20 @@ intel_crt_set_dpms(struct intel_encoder *encoder, int mode)
I915_WRITE(crt->adpa_reg, temp);
}
-void
-intel_disable_crt(struct intel_encoder *encoder)
+static void intel_disable_crt(struct intel_encoder *encoder)
{
intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF);
}
-void
-intel_enable_crt(struct intel_encoder *encoder)
+static void intel_enable_crt(struct intel_encoder *encoder)
{
struct intel_crt *crt = intel_encoder_to_crt(encoder);
intel_crt_set_dpms(encoder, crt->connector->base.dpms);
}
-void
-intel_crt_dpms(struct drm_connector *connector, int mode)
+
+static void intel_crt_dpms(struct drm_connector *connector, int mode)
{
struct drm_device *dev = connector->dev;
struct intel_encoder *encoder = intel_attached_encoder(connector);
@@ -207,8 +170,7 @@ intel_crt_dpms(struct drm_connector *connector, int mode)
intel_modeset_check_state(connector->dev);
}
-int
-intel_crt_mode_valid(struct drm_connector *connector,
+static int intel_crt_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct drm_device *dev = connector->dev;
@@ -235,16 +197,14 @@ intel_crt_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
-bool
-intel_crt_mode_fixup(struct drm_encoder *encoder,
+static bool intel_crt_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
return true;
}
-void
-intel_crt_mode_set(struct drm_encoder *encoder,
+static void intel_crt_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -283,8 +243,7 @@ intel_crt_mode_set(struct drm_encoder *encoder,
I915_WRITE(crt->adpa_reg, adpa);
}
-bool
-intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
+static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct intel_crt *crt = intel_attached_crt(connector);
@@ -335,8 +294,7 @@ intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
return ret;
}
-bool
-valleyview_crt_detect_hotplug(struct drm_connector *connector)
+static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -387,8 +345,7 @@ valleyview_crt_detect_hotplug(struct drm_connector *connector)
* \return true if CRT is connected.
* \return false if CRT is disconnected.
*/
-bool
-intel_crt_detect_hotplug(struct drm_connector *connector)
+static bool intel_crt_detect_hotplug(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -441,8 +398,7 @@ intel_crt_detect_hotplug(struct drm_connector *connector)
return ret;
}
-struct edid *
-intel_crt_get_edid(struct drm_connector *connector,
+static struct edid *intel_crt_get_edid(struct drm_connector *connector,
struct i2c_controller *i2c)
{
struct edid *edid;
@@ -460,8 +416,7 @@ intel_crt_get_edid(struct drm_connector *connector,
}
/* local version of intel_ddc_get_modes() to use intel_crt_get_edid() */
-int
-intel_crt_ddc_get_modes(struct drm_connector *connector,
+static int intel_crt_ddc_get_modes(struct drm_connector *connector,
struct i2c_controller *adapter)
{
struct edid *edid;
@@ -477,8 +432,7 @@ intel_crt_ddc_get_modes(struct drm_connector *connector,
return ret;
}
-bool
-intel_crt_detect_ddc(struct drm_connector *connector)
+static bool intel_crt_detect_ddc(struct drm_connector *connector)
{
struct intel_crt *crt = intel_attached_crt(connector);
struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private;
@@ -512,7 +466,7 @@ intel_crt_detect_ddc(struct drm_connector *connector)
return false;
}
-enum drm_connector_status
+static enum drm_connector_status
intel_crt_load_detect(struct intel_crt *crt)
{
struct drm_device *dev = crt->base.base.dev;
@@ -632,7 +586,7 @@ intel_crt_load_detect(struct intel_crt *crt)
return status;
}
-enum drm_connector_status
+static enum drm_connector_status
intel_crt_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
@@ -678,8 +632,7 @@ intel_crt_detect(struct drm_connector *connector, bool force)
return status;
}
-void
-intel_crt_destroy(struct drm_connector *connector)
+static void intel_crt_destroy(struct drm_connector *connector)
{
#if 0
drm_sysfs_connector_remove(connector);
@@ -688,8 +641,7 @@ intel_crt_destroy(struct drm_connector *connector)
free(connector, M_DRM);
}
-int
-intel_crt_get_modes(struct drm_connector *connector)
+static int intel_crt_get_modes(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -706,16 +658,14 @@ intel_crt_get_modes(struct drm_connector *connector)
return intel_crt_ddc_get_modes(connector, i2c);
}
-int
-intel_crt_set_property(struct drm_connector *connector,
+static int intel_crt_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t value)
{
return 0;
}
-void
-intel_crt_reset(struct drm_connector *connector)
+static void intel_crt_reset(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -765,8 +715,7 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = {
.destroy = intel_encoder_destroy,
};
-int
-intel_no_crt_dmi_callback(const struct dmi_system_id *id)
+static int __init intel_no_crt_dmi_callback(const struct dmi_system_id *id)
{
printf("Skipping CRT initialization for %s\n", id->ident);
return 1;
@@ -784,8 +733,7 @@ static const struct dmi_system_id intel_no_crt[] = {
{ }
};
-void
-intel_crt_init(struct drm_device *dev)
+void intel_crt_init(struct drm_device *dev)
{
struct drm_connector *connector;
struct intel_crt *crt;
diff --git a/sys/dev/pci/drm/i915/intel_ddi.c b/sys/dev/pci/drm/i915/intel_ddi.c
index 15399503913..d60adf2e883 100644
--- a/sys/dev/pci/drm/i915/intel_ddi.c
+++ b/sys/dev/pci/drm/i915/intel_ddi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_ddi.c,v 1.4 2013/07/08 09:47:45 jsg Exp $ */
+/* $OpenBSD: intel_ddi.c,v 1.5 2013/08/13 10:23:50 jsg Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
@@ -29,6 +29,8 @@
#include "i915_drv.h"
#include "intel_drv.h"
+void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port, bool use_fdi_mode);
+
/* HDMI/DVI modes ignore everything but the last 2 items. So we share
* them for both DP and FDI transports, allowing those ports to
* automatically adapt to HDMI connections as well
@@ -59,27 +61,7 @@ static const u32 hsw_ddi_translations_fdi[] = {
0x00FFFFFF, 0x00040006 /* HDMI parameters */
};
-enum port
- intel_ddi_get_encoder_port(struct intel_encoder *);
-void intel_prepare_ddi_buffers(struct drm_device *, enum port, bool);
-void intel_wait_ddi_buf_idle(struct drm_i915_private *, enum port);
-void intel_ddi_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-struct intel_encoder *
- intel_ddi_get_crtc_encoder(struct drm_crtc *);
-void intel_ddi_calculate_wrpll(int, int *, int *, int *);
-uint32_t intel_ddi_get_crtc_pll(struct drm_i915_private *, enum pipe);
-void intel_ddi_pre_enable(struct intel_encoder *);
-void intel_ddi_post_disable(struct intel_encoder *);
-void intel_enable_ddi(struct intel_encoder *);
-void intel_disable_ddi(struct intel_encoder *);
-void intel_ddi_hot_plug(struct intel_encoder *);
-void intel_ddi_destroy(struct drm_encoder *);
-bool intel_ddi_mode_fixup(struct drm_encoder *,
- const struct drm_display_mode *, struct drm_display_mode *);
-
-enum port
-intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
+static enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
{
struct drm_encoder *encoder = &intel_encoder->base;
int type = intel_encoder->type;
@@ -104,8 +86,7 @@ intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
* in either FDI or DP modes only, as HDMI connections will work with both
* of those
*/
-void
-intel_prepare_ddi_buffers(struct drm_device *dev, enum port port, bool use_fdi_mode)
+void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port, bool use_fdi_mode)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 reg;
@@ -131,8 +112,7 @@ intel_prepare_ddi_buffers(struct drm_device *dev, enum port port, bool use_fdi_m
/* Program DDI buffers translations for DP. By default, program ports A-D in DP
* mode and port E for FDI.
*/
-void
-intel_prepare_ddi(struct drm_device *dev)
+void intel_prepare_ddi(struct drm_device *dev)
{
int port;
@@ -160,8 +140,7 @@ static const long hsw_ddi_buf_ctl_values[] = {
DDI_BUF_EMP_800MV_3_5DB_HSW
};
-void
-intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
+static void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
enum port port)
{
uint32_t reg = DDI_BUF_CTL(port);
@@ -184,8 +163,7 @@ intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
* DDI A (which is used for eDP)
*/
-void
-hsw_fdi_link_train(struct drm_crtc *crtc)
+void hsw_fdi_link_train(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -686,8 +664,7 @@ static const struct wrpll_tmds_clock wrpll_tmds_clock_table[] = {
{298000, 2, 21, 19},
};
-void
-intel_ddi_mode_set(struct drm_encoder *encoder,
+static void intel_ddi_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -758,7 +735,7 @@ intel_ddi_mode_set(struct drm_encoder *encoder,
}
}
-struct intel_encoder *
+static struct intel_encoder *
intel_ddi_get_crtc_encoder(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
@@ -779,8 +756,7 @@ intel_ddi_get_crtc_encoder(struct drm_crtc *crtc)
return ret;
}
-void
-intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
+void intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = crtc->dev->dev_private;
struct intel_ddi_plls *plls = &dev_priv->ddi_plls;
@@ -827,8 +803,7 @@ intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
intel_crtc->ddi_pll_sel = PORT_CLK_SEL_NONE;
}
-void
-intel_ddi_calculate_wrpll(int clock, int *p, int *n2, int *r2)
+static void intel_ddi_calculate_wrpll(int clock, int *p, int *n2, int *r2)
{
u32 i;
@@ -851,8 +826,7 @@ intel_ddi_calculate_wrpll(int clock, int *p, int *n2, int *r2)
clock, *p, *n2, *r2);
}
-bool
-intel_ddi_pll_mode_set(struct drm_crtc *crtc, int clock)
+bool intel_ddi_pll_mode_set(struct drm_crtc *crtc, int clock)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
@@ -945,8 +919,7 @@ intel_ddi_pll_mode_set(struct drm_crtc *crtc, int clock)
return true;
}
-void
-intel_ddi_set_pipe_settings(struct drm_crtc *crtc)
+void intel_ddi_set_pipe_settings(struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = crtc->dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -980,8 +953,7 @@ intel_ddi_set_pipe_settings(struct drm_crtc *crtc)
}
}
-void
-intel_ddi_enable_pipe_func(struct drm_crtc *crtc)
+void intel_ddi_enable_pipe_func(struct drm_crtc *crtc)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
@@ -1079,8 +1051,7 @@ intel_ddi_enable_pipe_func(struct drm_crtc *crtc)
I915_WRITE(TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
}
-void
-intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
+void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
enum transcoder cpu_transcoder)
{
uint32_t reg = TRANS_DDI_FUNC_CTL(cpu_transcoder);
@@ -1091,8 +1062,7 @@ intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
I915_WRITE(reg, val);
}
-bool
-intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector)
+bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector)
{
struct drm_device *dev = intel_connector->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1132,8 +1102,7 @@ intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector)
}
}
-bool
-intel_ddi_get_hw_state(struct intel_encoder *encoder,
+bool intel_ddi_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct drm_device *dev = encoder->base.dev;
@@ -1181,8 +1150,7 @@ intel_ddi_get_hw_state(struct intel_encoder *encoder,
return true;
}
-uint32_t
-intel_ddi_get_crtc_pll(struct drm_i915_private *dev_priv,
+static uint32_t intel_ddi_get_crtc_pll(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
uint32_t temp, ret;
@@ -1210,8 +1178,7 @@ intel_ddi_get_crtc_pll(struct drm_i915_private *dev_priv,
return ret;
}
-void
-intel_ddi_setup_hw_pll_state(struct drm_device *dev)
+void intel_ddi_setup_hw_pll_state(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
enum pipe pipe;
@@ -1241,8 +1208,7 @@ intel_ddi_setup_hw_pll_state(struct drm_device *dev)
}
}
-void
-intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc)
+void intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc)
{
struct drm_crtc *crtc = &intel_crtc->base;
struct drm_i915_private *dev_priv = crtc->dev->dev_private;
@@ -1255,8 +1221,7 @@ intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc)
TRANS_CLK_SEL_PORT(port));
}
-void
-intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc)
+void intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc)
{
struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private;
enum transcoder cpu_transcoder = intel_crtc->cpu_transcoder;
@@ -1266,8 +1231,7 @@ intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc)
TRANS_CLK_SEL_DISABLED);
}
-void
-intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
+static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
{
struct drm_encoder *encoder = &intel_encoder->base;
struct drm_crtc *crtc = encoder->crtc;
@@ -1295,8 +1259,7 @@ intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
}
}
-void
-intel_ddi_post_disable(struct intel_encoder *intel_encoder)
+static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
{
struct drm_encoder *encoder = &intel_encoder->base;
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
@@ -1329,8 +1292,7 @@ intel_ddi_post_disable(struct intel_encoder *intel_encoder)
I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE);
}
-void
-intel_enable_ddi(struct intel_encoder *intel_encoder)
+static void intel_enable_ddi(struct intel_encoder *intel_encoder)
{
struct drm_encoder *encoder = &intel_encoder->base;
struct drm_device *dev = encoder->dev;
@@ -1355,8 +1317,7 @@ intel_enable_ddi(struct intel_encoder *intel_encoder)
}
}
-void
-intel_disable_ddi(struct intel_encoder *intel_encoder)
+static void intel_disable_ddi(struct intel_encoder *intel_encoder)
{
struct drm_encoder *encoder = &intel_encoder->base;
int type = intel_encoder->type;
@@ -1368,8 +1329,7 @@ intel_disable_ddi(struct intel_encoder *intel_encoder)
}
}
-int
-intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv)
+int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1384,8 +1344,7 @@ intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv)
return 540;
}
-void
-intel_ddi_pll_init(struct drm_device *dev)
+void intel_ddi_pll_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t val = I915_READ(LCPLL_CTL);
@@ -1405,8 +1364,7 @@ intel_ddi_pll_init(struct drm_device *dev)
DRM_ERROR("LCPLL is disabled\n");
}
-void
-intel_ddi_prepare_link_retrain(struct drm_encoder *encoder)
+void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder)
{
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
struct intel_dp *intel_dp = &intel_dig_port->dp;
@@ -1447,8 +1405,7 @@ intel_ddi_prepare_link_retrain(struct drm_encoder *encoder)
udelay(600);
}
-void
-intel_ddi_fdi_disable(struct drm_crtc *crtc)
+void intel_ddi_fdi_disable(struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = crtc->dev->dev_private;
struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
@@ -1474,8 +1431,7 @@ intel_ddi_fdi_disable(struct drm_crtc *crtc)
I915_WRITE(_FDI_RXA_CTL, val);
}
-void
-intel_ddi_hot_plug(struct intel_encoder *intel_encoder)
+static void intel_ddi_hot_plug(struct intel_encoder *intel_encoder)
{
struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
int type = intel_encoder->type;
@@ -1484,15 +1440,13 @@ intel_ddi_hot_plug(struct intel_encoder *intel_encoder)
intel_dp_check_link_status(intel_dp);
}
-void
-intel_ddi_destroy(struct drm_encoder *encoder)
+static void intel_ddi_destroy(struct drm_encoder *encoder)
{
/* HDMI has nothing special to destroy, so we can go with this. */
intel_dp_encoder_destroy(encoder);
}
-bool
-intel_ddi_mode_fixup(struct drm_encoder *encoder,
+static bool intel_ddi_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -1517,8 +1471,7 @@ static const struct drm_encoder_helper_funcs intel_ddi_helper_funcs = {
.disable = intel_encoder_noop,
};
-void
-intel_ddi_init(struct drm_device *dev, enum port port)
+void intel_ddi_init(struct drm_device *dev, enum port port)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_digital_port *intel_dig_port;
diff --git a/sys/dev/pci/drm/i915/intel_display.c b/sys/dev/pci/drm/i915/intel_display.c
index 8843a5afae5..1e2c869ca06 100644
--- a/sys/dev/pci/drm/i915/intel_display.c
+++ b/sys/dev/pci/drm/i915/intel_display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_display.c,v 1.10 2013/08/09 07:55:42 jsg Exp $ */
+/* $OpenBSD: intel_display.c,v 1.11 2013/08/13 10:23:50 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
*
@@ -33,6 +33,10 @@
#include <dev/pci/drm/drm_dp_helper.h>
#include <dev/pci/drm/drm_crtc_helper.h>
+bool intel_pipe_has_type(struct drm_crtc *crtc, int type);
+static void intel_increase_pllclock(struct drm_crtc *crtc);
+static void intel_crtc_update_cursor(struct drm_crtc *crtc, bool on);
+
typedef struct {
/* given values */
int n;
@@ -64,338 +68,8 @@ struct intel_limit {
};
/* FDI */
-struct fdi_m_n {
- u32 tu;
- u32 gmch_m;
- u32 gmch_n;
- u32 link_m;
- u32 link_n;
-};
-
#define IRONLAKE_FDI_FREQ 2700000 /* in kHz for mode->clock */
-bool intel_pipe_has_type(struct drm_crtc *crtc, int type);
-void intel_increase_pllclock(struct drm_crtc *crtc);
-void intel_crtc_update_cursor(struct drm_crtc *crtc, bool on);
-
-const intel_limit_t *intel_ironlake_limit(struct drm_crtc *, int);
-const intel_limit_t *intel_g4x_limit(struct drm_crtc *);
-const intel_limit_t *intel_limit(struct drm_crtc *, int);
-
-void pineview_clock(int, intel_clock_t *);
-void intel_clock(struct drm_device *, int, intel_clock_t *clock);
-bool intel_PLL_is_valid(struct drm_device *, const intel_limit_t *,
- const intel_clock_t *);
-void assert_pll(struct drm_i915_private *, enum pipe, bool);
-void assert_pch_pll(struct drm_i915_private *, struct intel_pch_pll *,
- struct intel_crtc *, bool);
-void assert_fdi_tx(struct drm_i915_private *, enum pipe, bool);
-void assert_fdi_rx(struct drm_i915_private *, enum pipe, bool);
-void assert_fdi_tx_pll_enabled(struct drm_i915_private *, enum pipe);
-void assert_fdi_rx_pll_enabled(struct drm_i915_private *, enum pipe);
-void assert_panel_unlocked(struct drm_i915_private *, enum pipe);
-void assert_plane(struct drm_i915_private *, enum plane, bool);
-void assert_planes_disabled(struct drm_i915_private *, enum pipe);
-void assert_pch_refclk_enabled(struct drm_i915_private *);
-void assert_transcoder_disabled(struct drm_i915_private *, enum pipe);
-bool hdmi_pipe_enabled(struct drm_i915_private *, enum pipe, u32);
-bool lvds_pipe_enabled(struct drm_i915_private *, enum pipe, u32);
-bool adpa_pipe_enabled(struct drm_i915_private *, enum pipe, u32);
-bool dp_pipe_enabled(struct drm_i915_private *, enum pipe, u32, u32);
-void assert_pch_dp_disabled(struct drm_i915_private *, enum pipe, int, u32);
-void assert_pch_hdmi_disabled(struct drm_i915_private *, enum pipe, int);
-void assert_pch_ports_disabled(struct drm_i915_private *, enum pipe);
-void intel_enable_pll(struct drm_i915_private *, enum pipe);
-void intel_disable_pll(struct drm_i915_private *, enum pipe);
-void intel_enable_pch_pll(struct drm_i915_private *, enum pipe);
-void intel_disable_pch_pll(struct intel_crtc *);
-void intel_enable_transcoder(struct drm_i915_private *, enum pipe);
-void intel_disable_transcoder(struct drm_i915_private *, enum pipe);
-void intel_enable_pipe(struct drm_i915_private *, enum pipe, bool);
-void intel_disable_pipe(struct drm_i915_private *, enum pipe);
-void intel_flush_display_plane(struct drm_i915_private *, enum plane);
-void intel_enable_plane(struct drm_i915_private *, enum plane, enum pipe);
-void intel_disable_plane(struct drm_i915_private *, enum plane, enum pipe);
-void disable_pch_dp(struct drm_i915_private *, enum pipe, int, u32);
-void disable_pch_hdmi(struct drm_i915_private *, enum pipe, int);
-void intel_disable_pch_ports(struct drm_i915_private *, enum pipe);
-void i8xx_disable_fbc(struct drm_device *);
-void i8xx_enable_fbc(struct drm_crtc *, unsigned long);
-bool i8xx_fbc_enabled(struct drm_device *);
-void g4x_enable_fbc(struct drm_crtc *, unsigned long);
-void g4x_disable_fbc(struct drm_device *);
-bool g4x_fbc_enabled(struct drm_device *);
-void sandybridge_blit_fbc_update(struct drm_device *);
-void ironlake_enable_fbc(struct drm_crtc *, unsigned long);
-void ironlake_disable_fbc(struct drm_device *);
-bool ironlake_fbc_enabled(struct drm_device *);
-void intel_fbc_work_fn(void *, int);
-void intel_cancel_fbc_work(struct drm_i915_private *);
-void intel_enable_fbc(struct drm_crtc *, unsigned long);
-void intel_update_fbc(struct drm_device *);
-int i9xx_update_plane(struct drm_crtc *, struct drm_framebuffer *, int,
- int);
-int ironlake_update_plane(struct drm_crtc *, struct drm_framebuffer *, int,
- int);
-int intel_pipe_set_base_atomic(struct drm_crtc *, struct drm_framebuffer *,
- int, int, enum mode_set_atomic);
-int intel_finish_fb(struct drm_framebuffer *);
-int intel_pipe_set_base(struct drm_crtc *, int, int,
- struct drm_framebuffer *);
-void ironlake_set_pll_edp(struct drm_crtc *, int);
-void intel_fdi_normal_train(struct drm_crtc *);
-void cpt_phase_pointer_enable(struct drm_device *, int);
-void ironlake_fdi_link_train(struct drm_crtc *);
-void gen6_fdi_link_train(struct drm_crtc *);
-void ivb_manual_fdi_link_train(struct drm_crtc *);
-void ironlake_fdi_pll_enable(struct intel_crtc *);
-void cpt_phase_pointer_disable(struct drm_device *, int);
-void ironlake_fdi_disable(struct drm_crtc *);
-void intel_clear_scanline_wait(struct drm_device *);
-void intel_crtc_wait_for_pending_flips(struct drm_crtc *);
-bool intel_crtc_driving_pch(struct drm_crtc *);
-void ironlake_pch_enable(struct drm_crtc *);
-void ironlake_crtc_enable(struct drm_crtc *);
-void ironlake_crtc_disable(struct drm_crtc *);
-void ironlake_crtc_dpms(struct drm_crtc *, int);
-void intel_crtc_dpms_overlay(struct intel_crtc *, bool);
-void i9xx_crtc_enable(struct drm_crtc *);
-void i9xx_crtc_disable(struct drm_crtc *);
-void i9xx_crtc_dpms(struct drm_crtc *, int);
-void intel_crtc_dpms(struct drm_crtc *, int);
-void intel_crtc_disable(struct drm_crtc *);
-void i9xx_crtc_prepare(struct drm_crtc *);
-void i9xx_crtc_commit(struct drm_crtc *);
-void ironlake_crtc_prepare(struct drm_crtc *);
-void ironlake_crtc_commit(struct drm_crtc *);
-bool intel_crtc_mode_fixup(struct drm_crtc *, const struct drm_display_mode *,
- struct drm_display_mode *);
-int i945_get_display_clock_speed(struct drm_device *);
-int i915_get_display_clock_speed(struct drm_device *);
-int i9xx_misc_get_display_clock_speed(struct drm_device *);
-int i915gm_get_display_clock_speed(struct drm_device *);
-int i865_get_display_clock_speed(struct drm_device *);
-int i855_get_display_clock_speed(struct drm_device *);
-int i830_get_display_clock_speed(struct drm_device *);
-void fdi_reduce_ratio(u32 *, u32 *);
-void ironlake_compute_m_n(int, int, int, int, struct fdi_m_n *);
-unsigned long intel_calculate_wm(unsigned long,
- const struct intel_watermark_params *, int, int,
- unsigned long);
-const struct cxsr_latency *intel_get_cxsr_latency(int, int, int, int);
-void pineview_disable_cxsr(struct drm_device *);
-int i9xx_get_fifo_size(struct drm_device *, int);
-int i85x_get_fifo_size(struct drm_device *, int);
-int i845_get_fifo_size(struct drm_device *, int);
-int i830_get_fifo_size(struct drm_device *, int);
-struct drm_crtc *single_enabled_crtc(struct drm_device *);
-void pineview_update_wm(struct drm_device *);
-bool g4x_compute_wm0(struct drm_device *, int,
- const struct intel_watermark_params *, int,
- const struct intel_watermark_params *, int, int *, int *);
-bool g4x_check_srwm(struct drm_device *, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *);
-bool g4x_compute_srwm(struct drm_device *, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *, int *, int *);
-void g4x_update_wm(struct drm_device *);
-void i965_update_wm(struct drm_device *);
-void i9xx_update_wm(struct drm_device *);
-void i830_update_wm(struct drm_device *);
-bool ironlake_check_srwm(struct drm_device *, int, int, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *);
-bool ironlake_compute_srwm(struct drm_device *, int, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *, int *, int *, int *);
-void ironlake_update_wm(struct drm_device *);
-bool sandybridge_compute_sprite_wm(struct drm_device *, int, uint32_t, int,
- const struct intel_watermark_params *, int, int *);
-bool sandybridge_compute_sprite_srwm(struct drm_device *, int, uint32_t,
- int, const struct intel_watermark_params *, int, int *);
-void sandybridge_update_sprite_wm(struct drm_device *, int, uint32_t, int);
-bool intel_choose_pipe_bpp_dither(struct drm_crtc *, struct drm_framebuffer *,
- unsigned int *, struct drm_display_mode *);
-int i9xx_get_refclk(struct drm_crtc *, int);
-void i9xx_adjust_sdvo_tv_clock(struct drm_display_mode *, intel_clock_t *);
-void i9xx_update_pll_dividers(struct drm_crtc *, intel_clock_t *,
- intel_clock_t *);
-int i9xx_crtc_mode_set(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *, int, int, struct drm_framebuffer *);
-int ironlake_get_refclk(struct drm_crtc *);
-int ironlake_crtc_mode_set(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *, int, int, struct drm_framebuffer *);
-int intel_crtc_mode_set(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *, int, int, struct drm_framebuffer *);
-bool intel_eld_uptodate(struct drm_connector *, int, uint32_t, int,
- uint32_t, int);
-void g4x_write_eld(struct drm_connector *, struct drm_crtc *);
-void ironlake_write_eld(struct drm_connector *, struct drm_crtc *);
-void i845_update_cursor(struct drm_crtc *, u32);
-void i9xx_update_cursor(struct drm_crtc *, u32);
-void ivb_update_cursor(struct drm_crtc *, u32);
-int intel_crtc_cursor_set(struct drm_crtc *, struct drm_file *, uint32_t,
- uint32_t, uint32_t);
-int intel_crtc_cursor_move(struct drm_crtc *, int, int);
-void intel_crtc_gamma_set(struct drm_crtc *, u16 *, u16 *, u16 *, uint32_t,
- uint32_t);
-struct drm_framebuffer *
- intel_framebuffer_create(struct drm_device *,
- struct drm_mode_fb_cmd2 *, struct drm_i915_gem_object *);
-u32 intel_framebuffer_pitch_for_width(int, int);
-u32 intel_framebuffer_size_for_mode(struct drm_display_mode *, int);
-struct drm_framebuffer *
- intel_framebuffer_create_for_mode(struct drm_device *,
- struct drm_display_mode *, int, int);
-struct drm_framebuffer *
- mode_fits_in_fbdev(struct drm_device *, struct drm_display_mode *);
-int intel_crtc_clock_get(struct drm_device *, struct drm_crtc *);
-void intel_crtc_destroy(struct drm_crtc *);
-void do_intel_finish_page_flip(struct drm_device *, struct drm_crtc *);
-int intel_crtc_page_flip(struct drm_crtc *, struct drm_framebuffer *,
- struct drm_pending_vblank_event *);
-void intel_sanitize_modesetting(struct drm_device *, int, int);
-void intel_crtc_reset(struct drm_crtc *);
-void intel_crtc_init(struct drm_device *, int);
-int intel_encoder_clones(struct intel_encoder *);
-bool has_edp_a(struct drm_device *);
-void intel_setup_outputs(struct drm_device *);
-void intel_user_framebuffer_destroy(struct drm_framebuffer *);
-int intel_user_framebuffer_create_handle(struct drm_framebuffer *,
- struct drm_file *, unsigned int *);
-struct drm_framebuffer *
- intel_user_framebuffer_create(struct drm_device *,
- struct drm_file *, struct drm_mode_fb_cmd2 *);
-unsigned long intel_pxfreq(u32);
-void ironlake_init_clock_gating(struct drm_device *);
-void gen6_init_clock_gating(struct drm_device *);
-void ivybridge_init_clock_gating(struct drm_device *);
-void g4x_init_clock_gating(struct drm_device *);
-void crestline_init_clock_gating(struct drm_device *);
-void broadwater_init_clock_gating(struct drm_device *);
-void gen3_init_clock_gating(struct drm_device *);
-void i85x_init_clock_gating(struct drm_device *);
-void i830_init_clock_gating(struct drm_device *);
-void ibx_init_clock_gating(struct drm_device *);
-void cpt_init_clock_gating(struct drm_device *);
-void ironlake_teardown_rc6(struct drm_device *);
-void ironlake_disable_rc6(struct drm_device *);
-int ironlake_setup_rc6(struct drm_device *);
-void intel_init_display(struct drm_device *);
-void quirk_pipea_force(struct drm_device *);
-void quirk_ssc_force_disable(struct drm_device *);
-void intel_init_quirks(struct drm_device *);
-void i915_disable_vga(struct drm_device *);
-void intel_crtc_idle_timer(void *);
-void intel_gpu_idle_timer(void *);
-void intel_idle_update(void *, int);
-void intel_decrease_pllclock(struct drm_crtc *);
-int intel_default_queue_flip(struct drm_device *, struct drm_crtc *,
- struct drm_framebuffer *, struct drm_i915_gem_object *);
-int intel_gen2_queue_flip(struct drm_device *, struct drm_crtc *,
- struct drm_framebuffer *, struct drm_i915_gem_object *);
-int intel_gen3_queue_flip(struct drm_device *, struct drm_crtc *,
- struct drm_framebuffer *, struct drm_i915_gem_object *);
-int intel_gen4_queue_flip(struct drm_device *, struct drm_crtc *,
- struct drm_framebuffer *, struct drm_i915_gem_object *);
-int intel_gen6_queue_flip(struct drm_device *, struct drm_crtc *,
- struct drm_framebuffer *, struct drm_i915_gem_object *);
-int intel_gen7_queue_flip(struct drm_device *, struct drm_crtc *,
- struct drm_framebuffer *, struct drm_i915_gem_object *);
-void intel_unpin_work_fn(void *, void *);
-void intel_dpio_write(struct drm_i915_private *, int, u32);
-void vlv_init_dpio(struct drm_device *);
-int intel_dual_link_lvds_callback(const struct dmi_system_id *);
-bool is_dual_link_lvds(struct drm_i915_private *, unsigned int);
-void ironlake_wait_for_vblank(struct drm_device *, int);
-const char *state_string(bool);
-void intel_sbi_write(struct drm_i915_private *, u16, u32,
- enum intel_sbi_destination);
-u32 intel_sbi_read(struct drm_i915_private *, u16,
- enum intel_sbi_destination);
-void ironlake_enable_pch_pll(struct intel_crtc *);
-void ironlake_enable_pch_transcoder(struct drm_i915_private *, enum pipe);
-void lpt_enable_pch_transcoder(struct drm_i915_private *, enum transcoder);
-void ironlake_disable_pch_transcoder(struct drm_i915_private *, enum pipe);
-void lpt_disable_pch_transcoder(struct drm_i915_private *);
-void intel_crtc_update_sarea_pos(struct drm_crtc *, int, int);
-void ivb_modeset_global_resources(struct drm_device *);
-void ironlake_fdi_pll_disable(struct intel_crtc *);
-bool intel_crtc_has_pending_flip(struct drm_crtc *);
-bool ironlake_crtc_driving_pch(struct drm_crtc *);
-bool haswell_crtc_driving_pch(struct drm_crtc *);
-void lpt_program_iclkip(struct drm_crtc *);
-void lpt_pch_enable(struct drm_crtc *);
-void intel_put_pch_pll(struct intel_crtc *);
-void haswell_crtc_enable(struct drm_crtc *);
-void haswell_crtc_disable(struct drm_crtc *);
-void ironlake_crtc_off(struct drm_crtc *);
-void haswell_crtc_off(struct drm_crtc *);
-void i9xx_crtc_off(struct drm_crtc *);
-void intel_crtc_update_sarea(struct drm_crtc *, bool);
-void intel_crtc_noop(struct drm_crtc *);
-void intel_connector_check_state(struct intel_connector *);
-int valleyview_get_display_clock_speed(struct drm_device *);
-int vlv_get_refclk(struct drm_crtc *);
-void intel_update_lvds(struct drm_crtc *, intel_clock_t *,
- struct drm_display_mode *);
-void vlv_update_pll(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *, intel_clock_t *, intel_clock_t *, int);
-void i9xx_update_pll(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *, intel_clock_t *, intel_clock_t *, int);
-void i8xx_update_pll(struct drm_crtc *, struct drm_display_mode *,
- intel_clock_t *, intel_clock_t *, int);
-void intel_set_pipe_timings(struct intel_crtc *, struct drm_display_mode *,
- struct drm_display_mode *);
-void lpt_init_pch_refclk(struct drm_device *);
-void ironlake_set_pipeconf(struct drm_crtc *, struct drm_display_mode *,
- bool);
-void haswell_set_pipeconf(struct drm_crtc *, struct drm_display_mode *,
- bool);
-bool ironlake_compute_clocks(struct drm_crtc *, struct drm_display_mode *,
- intel_clock_t *, bool *, intel_clock_t *);
-void cpt_enable_fdi_bc_bifurcation(struct drm_device *);
-bool ironlake_check_fdi_lanes(struct intel_crtc *);
-void ironlake_set_m_n(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *);
-uint32_t ironlake_compute_dpll(struct intel_crtc *, struct drm_display_mode *,
- intel_clock_t *, u32);
-int haswell_crtc_mode_set(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *, int, int, struct drm_framebuffer *);
-void haswell_write_eld(struct drm_connector *, struct drm_crtc *);
-bool intel_encoder_crtc_ok(struct drm_encoder *, struct drm_crtc *);
-void intel_modeset_update_staged_output_state(struct drm_device *);
-void intel_modeset_commit_output_state(struct drm_device *);
-struct drm_display_mode *
- intel_modeset_adjusted_mode(struct drm_crtc *, struct drm_display_mode *);
-void intel_modeset_affected_pipes(struct drm_crtc *, unsigned *,
- unsigned *, unsigned *);
-void intel_modeset_affected_pipes(struct drm_crtc *, unsigned *,
- unsigned *, unsigned *);
-bool intel_crtc_in_use(struct drm_crtc *);
-void intel_modeset_update_state(struct drm_device *, unsigned);
-void intel_set_config_free(struct intel_set_config *);
-int intel_set_config_save_state(struct drm_device *,
- struct intel_set_config *);
-void intel_set_config_restore_state(struct drm_device *,
- struct intel_set_config *);
-void intel_set_config_compute_mode_changes(struct drm_mode_set *,
- struct intel_set_config *);
-int intel_modeset_stage_output_state(struct drm_device *,
- struct drm_mode_set *, struct intel_set_config *);
-int intel_crtc_set_config(struct drm_mode_set *);
-void intel_cpu_pll_init(struct drm_device *);
-void i915_redisable_vga(struct drm_device *);
-void intel_pch_pll_init(struct drm_device *);
-void quirk_invert_brightness(struct drm_device *);
-int intel_dmi_reverse_brightness(const struct dmi_system_id *);
-void intel_connector_break_all_links(struct intel_connector *);
-void intel_enable_pipe_a(struct drm_device *);
-bool intel_check_plane_mapping(struct intel_crtc *);
-void intel_sanitize_crtc(struct intel_crtc *);
-void intel_sanitize_encoder(struct intel_encoder *);
-
int
intel_pch_rawclk(struct drm_device *dev)
{
@@ -732,8 +406,7 @@ static const intel_limit_t intel_limits_vlv_dp = {
.find_pll = intel_vlv_find_best_pll,
};
-u32
-intel_dpio_read(struct drm_i915_private *dev_priv, int reg)
+u32 intel_dpio_read(struct drm_i915_private *dev_priv, int reg)
{
u32 val = 0;
int retries;
@@ -768,8 +441,7 @@ out_unlock:
return val;
}
-void
-intel_dpio_write(struct drm_i915_private *dev_priv, int reg,
+static void intel_dpio_write(struct drm_i915_private *dev_priv, int reg,
u32 val)
{
int retries;
@@ -801,8 +473,7 @@ out_unlock:
mtx_leave(&dev_priv->dpio_lock);
}
-void
-vlv_init_dpio(struct drm_device *dev)
+static void vlv_init_dpio(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -813,8 +484,7 @@ vlv_init_dpio(struct drm_device *dev)
POSTING_READ(DPIO_CTL);
}
-int
-intel_dual_link_lvds_callback(const struct dmi_system_id *id)
+static int intel_dual_link_lvds_callback(const struct dmi_system_id *id)
{
printf("Forcing lvds to dual link mode on %s\n", id->ident);
return 1;
@@ -832,8 +502,7 @@ static const struct dmi_system_id intel_dual_link_lvds[] = {
{ } /* terminating entry */
};
-bool
-is_dual_link_lvds(struct drm_i915_private *dev_priv,
+static bool is_dual_link_lvds(struct drm_i915_private *dev_priv,
unsigned int reg)
{
unsigned int val;
@@ -861,8 +530,7 @@ is_dual_link_lvds(struct drm_i915_private *dev_priv,
return (val & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP;
}
-const intel_limit_t *
-intel_ironlake_limit(struct drm_crtc *crtc,
+static const intel_limit_t *intel_ironlake_limit(struct drm_crtc *crtc,
int refclk)
{
struct drm_device *dev = crtc->dev;
@@ -891,8 +559,7 @@ intel_ironlake_limit(struct drm_crtc *crtc,
return limit;
}
-const intel_limit_t *
-intel_g4x_limit(struct drm_crtc *crtc)
+static const intel_limit_t *intel_g4x_limit(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -918,8 +585,7 @@ intel_g4x_limit(struct drm_crtc *crtc)
return limit;
}
-const intel_limit_t *
-intel_limit(struct drm_crtc *crtc, int refclk)
+static const intel_limit_t *intel_limit(struct drm_crtc *crtc, int refclk)
{
struct drm_device *dev = crtc->dev;
const intel_limit_t *limit;
@@ -955,8 +621,7 @@ intel_limit(struct drm_crtc *crtc, int refclk)
}
/* m1 is reserved as 0 in Pineview, n is a ring counter */
-void
-pineview_clock(int refclk, intel_clock_t *clock)
+static void pineview_clock(int refclk, intel_clock_t *clock)
{
clock->m = clock->m2 + 2;
clock->p = clock->p1 * clock->p2;
@@ -964,8 +629,7 @@ pineview_clock(int refclk, intel_clock_t *clock)
clock->dot = clock->vco / clock->p;
}
-void
-intel_clock(struct drm_device *dev, int refclk, intel_clock_t *clock)
+static void intel_clock(struct drm_device *dev, int refclk, intel_clock_t *clock)
{
if (IS_PINEVIEW(dev)) {
pineview_clock(refclk, clock);
@@ -980,8 +644,7 @@ intel_clock(struct drm_device *dev, int refclk, intel_clock_t *clock)
/**
* Returns whether any output on the specified pipe is of the specified type
*/
-bool
-intel_pipe_has_type(struct drm_crtc *crtc, int type)
+bool intel_pipe_has_type(struct drm_crtc *crtc, int type)
{
struct drm_device *dev = crtc->dev;
struct intel_encoder *encoder;
@@ -999,8 +662,7 @@ intel_pipe_has_type(struct drm_crtc *crtc, int type)
* the given connectors.
*/
-bool
-intel_PLL_is_valid(struct drm_device *dev,
+static bool intel_PLL_is_valid(struct drm_device *dev,
const intel_limit_t *limit,
const intel_clock_t *clock)
{
@@ -1029,7 +691,7 @@ intel_PLL_is_valid(struct drm_device *dev,
return true;
}
-bool
+static bool
intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock)
@@ -1095,7 +757,7 @@ intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
return (err != target);
}
-bool
+static bool
intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock)
@@ -1163,7 +825,7 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
return found;
}
-bool
+static bool
intel_find_pll_ironlake_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock)
@@ -1190,7 +852,7 @@ intel_find_pll_ironlake_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
}
/* DisplayPort has only two frequencies, 162MHz and 270MHz */
-bool
+static bool
intel_find_pll_g4x_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock)
@@ -1216,8 +878,7 @@ intel_find_pll_g4x_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
memcpy(best_clock, &clock, sizeof(intel_clock_t));
return true;
}
-
-bool
+static bool
intel_vlv_find_best_pll(const intel_limit_t *limit, struct drm_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock)
@@ -1286,8 +947,7 @@ intel_vlv_find_best_pll(const intel_limit_t *limit, struct drm_crtc *crtc,
return true;
}
-enum transcoder
-intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
+enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
@@ -1296,8 +956,7 @@ intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
return intel_crtc->cpu_transcoder;
}
-void
-ironlake_wait_for_vblank(struct drm_device *dev, int pipe)
+static void ironlake_wait_for_vblank(struct drm_device *dev, int pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 frame, frame_reg = PIPEFRAME(pipe);
@@ -1322,8 +981,7 @@ ironlake_wait_for_vblank(struct drm_device *dev, int pipe)
* Wait for vblank to occur on a given pipe. Needed for various bits of
* mode setting code.
*/
-void
-intel_wait_for_vblank(struct drm_device *dev, int pipe)
+void intel_wait_for_vblank(struct drm_device *dev, int pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int pipestat_reg = PIPESTAT(pipe);
@@ -1377,8 +1035,7 @@ intel_wait_for_vblank(struct drm_device *dev, int pipe)
* ends up stopping at the start of the next frame).
*
*/
-void
-intel_wait_for_pipe_off(struct drm_device *dev, int pipe)
+void intel_wait_for_pipe_off(struct drm_device *dev, int pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
@@ -1417,15 +1074,13 @@ intel_wait_for_pipe_off(struct drm_device *dev, int pipe)
}
}
-const char *
-state_string(bool enabled)
+static const char *state_string(bool enabled)
{
return enabled ? "on" : "off";
}
/* Only for pre-ILK configs */
-void
-assert_pll(struct drm_i915_private *dev_priv,
+static void assert_pll(struct drm_i915_private *dev_priv,
enum pipe pipe, bool state)
{
int reg;
@@ -1443,8 +1098,7 @@ assert_pll(struct drm_i915_private *dev_priv,
#define assert_pll_disabled(d, p) assert_pll(d, p, false)
/* For ILK+ */
-void
-assert_pch_pll(struct drm_i915_private *dev_priv,
+static void assert_pch_pll(struct drm_i915_private *dev_priv,
struct intel_pch_pll *pll,
struct intel_crtc *crtc,
bool state)
@@ -1490,8 +1144,7 @@ assert_pch_pll(struct drm_i915_private *dev_priv,
#define assert_pch_pll_enabled(d, p, c) assert_pch_pll(d, p, c, true)
#define assert_pch_pll_disabled(d, p, c) assert_pch_pll(d, p, c, false)
-void
-assert_fdi_tx(struct drm_i915_private *dev_priv,
+static void assert_fdi_tx(struct drm_i915_private *dev_priv,
enum pipe pipe, bool state)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1518,8 +1171,7 @@ assert_fdi_tx(struct drm_i915_private *dev_priv,
#define assert_fdi_tx_enabled(d, p) assert_fdi_tx(d, p, true)
#define assert_fdi_tx_disabled(d, p) assert_fdi_tx(d, p, false)
-void
-assert_fdi_rx(struct drm_i915_private *dev_priv,
+static void assert_fdi_rx(struct drm_i915_private *dev_priv,
enum pipe pipe, bool state)
{
int reg;
@@ -1536,8 +1188,7 @@ assert_fdi_rx(struct drm_i915_private *dev_priv,
#define assert_fdi_rx_enabled(d, p) assert_fdi_rx(d, p, true)
#define assert_fdi_rx_disabled(d, p) assert_fdi_rx(d, p, false)
-void
-assert_fdi_tx_pll_enabled(struct drm_i915_private *dev_priv,
+static void assert_fdi_tx_pll_enabled(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1557,8 +1208,7 @@ assert_fdi_tx_pll_enabled(struct drm_i915_private *dev_priv,
WARN(!(val & FDI_TX_PLL_ENABLE), "FDI TX PLL assertion failure, should be active but is disabled\n");
}
-void
-assert_fdi_rx_pll_enabled(struct drm_i915_private *dev_priv,
+static void assert_fdi_rx_pll_enabled(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
int reg;
@@ -1569,8 +1219,7 @@ assert_fdi_rx_pll_enabled(struct drm_i915_private *dev_priv,
WARN(!(val & FDI_RX_PLL_ENABLE), "FDI RX PLL assertion failure, should be active but is disabled\n");
}
-void
-assert_panel_unlocked(struct drm_i915_private *dev_priv,
+static void assert_panel_unlocked(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1600,8 +1249,7 @@ assert_panel_unlocked(struct drm_i915_private *dev_priv,
pipe_name(pipe));
}
-void
-assert_pipe(struct drm_i915_private *dev_priv,
+void assert_pipe(struct drm_i915_private *dev_priv,
enum pipe pipe, bool state)
{
int reg;
@@ -1622,8 +1270,7 @@ assert_pipe(struct drm_i915_private *dev_priv,
pipe_name(pipe), state_string(state), state_string(cur_state));
}
-void
-assert_plane(struct drm_i915_private *dev_priv,
+static void assert_plane(struct drm_i915_private *dev_priv,
enum plane plane, bool state)
{
int reg;
@@ -1641,8 +1288,7 @@ assert_plane(struct drm_i915_private *dev_priv,
#define assert_plane_enabled(d, p) assert_plane(d, p, true)
#define assert_plane_disabled(d, p) assert_plane(d, p, false)
-void
-assert_planes_disabled(struct drm_i915_private *dev_priv,
+static void assert_planes_disabled(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1672,8 +1318,7 @@ assert_planes_disabled(struct drm_i915_private *dev_priv,
}
}
-void
-assert_pch_refclk_enabled(struct drm_i915_private *dev_priv)
+static void assert_pch_refclk_enabled(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
u32 val;
@@ -1690,8 +1335,7 @@ assert_pch_refclk_enabled(struct drm_i915_private *dev_priv)
WARN(!enabled, "PCH refclk assertion failure, should be active but is disabled\n");
}
-void
-assert_transcoder_disabled(struct drm_i915_private *dev_priv,
+static void assert_transcoder_disabled(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
int reg;
@@ -1706,8 +1350,7 @@ assert_transcoder_disabled(struct drm_i915_private *dev_priv,
pipe_name(pipe));
}
-bool
-dp_pipe_enabled(struct drm_i915_private *dev_priv,
+static bool dp_pipe_enabled(struct drm_i915_private *dev_priv,
enum pipe pipe, u32 port_sel, u32 val)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1727,8 +1370,7 @@ dp_pipe_enabled(struct drm_i915_private *dev_priv,
return true;
}
-bool
-hdmi_pipe_enabled(struct drm_i915_private *dev_priv,
+static bool hdmi_pipe_enabled(struct drm_i915_private *dev_priv,
enum pipe pipe, u32 val)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1746,8 +1388,7 @@ hdmi_pipe_enabled(struct drm_i915_private *dev_priv,
return true;
}
-bool
-lvds_pipe_enabled(struct drm_i915_private *dev_priv,
+static bool lvds_pipe_enabled(struct drm_i915_private *dev_priv,
enum pipe pipe, u32 val)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1765,8 +1406,7 @@ lvds_pipe_enabled(struct drm_i915_private *dev_priv,
return true;
}
-bool
-adpa_pipe_enabled(struct drm_i915_private *dev_priv,
+static bool adpa_pipe_enabled(struct drm_i915_private *dev_priv,
enum pipe pipe, u32 val)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1783,8 +1423,7 @@ adpa_pipe_enabled(struct drm_i915_private *dev_priv,
return true;
}
-void
-assert_pch_dp_disabled(struct drm_i915_private *dev_priv,
+static void assert_pch_dp_disabled(struct drm_i915_private *dev_priv,
enum pipe pipe, int reg, u32 port_sel)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1798,8 +1437,7 @@ assert_pch_dp_disabled(struct drm_i915_private *dev_priv,
"IBX PCH dp port still using transcoder B\n");
}
-void
-assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv,
+static void assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv,
enum pipe pipe, int reg)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -1813,8 +1451,7 @@ assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv,
"IBX PCH hdmi port still using transcoder B\n");
}
-void
-assert_pch_ports_disabled(struct drm_i915_private *dev_priv,
+static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
int reg;
@@ -1854,8 +1491,7 @@ assert_pch_ports_disabled(struct drm_i915_private *dev_priv,
*
* Unfortunately needed by dvo_ns2501 since the dvo depends on it running.
*/
-void
-intel_enable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
+static void intel_enable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
int reg;
@@ -1893,8 +1529,7 @@ intel_enable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
*
* Note! This is for pre-ILK only.
*/
-void
-intel_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
+static void intel_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
{
int reg;
u32 val;
@@ -1914,7 +1549,7 @@ intel_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
}
/* SBI access */
-void
+static void
intel_sbi_write(struct drm_i915_private *dev_priv, u16 reg, u32 value,
enum intel_sbi_destination destination)
{
@@ -1955,7 +1590,7 @@ out_unlock:
mtx_leave(&dev_priv->dpio_lock);
}
-u32
+static u32
intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg,
enum intel_sbi_destination destination)
{
@@ -2006,8 +1641,7 @@ out_unlock:
* The PCH PLL needs to be enabled before the PCH transcoder, since it
* drives the transcoder clock.
*/
-void
-ironlake_enable_pch_pll(struct intel_crtc *intel_crtc)
+static void ironlake_enable_pch_pll(struct intel_crtc *intel_crtc)
{
struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private;
struct intel_pch_pll *pll;
@@ -2047,8 +1681,7 @@ ironlake_enable_pch_pll(struct intel_crtc *intel_crtc)
pll->on = true;
}
-void
-intel_disable_pch_pll(struct intel_crtc *intel_crtc)
+static void intel_disable_pch_pll(struct intel_crtc *intel_crtc)
{
struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private;
struct intel_pch_pll *pll = intel_crtc->pch_pll;
@@ -2092,8 +1725,7 @@ intel_disable_pch_pll(struct intel_crtc *intel_crtc)
pll->on = false;
}
-void
-ironlake_enable_pch_transcoder(struct drm_i915_private *dev_priv,
+static void ironlake_enable_pch_transcoder(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2155,8 +1787,7 @@ ironlake_enable_pch_transcoder(struct drm_i915_private *dev_priv,
DRM_ERROR("failed to enable transcoder %d\n", pipe);
}
-void
-lpt_enable_pch_transcoder(struct drm_i915_private *dev_priv,
+static void lpt_enable_pch_transcoder(struct drm_i915_private *dev_priv,
enum transcoder cpu_transcoder)
{
u32 val, pipeconf_val;
@@ -2193,8 +1824,7 @@ lpt_enable_pch_transcoder(struct drm_i915_private *dev_priv,
DRM_ERROR("Failed to enable PCH transcoder\n");
}
-void
-ironlake_disable_pch_transcoder(struct drm_i915_private *dev_priv,
+static void ironlake_disable_pch_transcoder(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2230,8 +1860,7 @@ ironlake_disable_pch_transcoder(struct drm_i915_private *dev_priv,
}
}
-void
-lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv)
+static void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv)
{
u32 val;
int retries;
@@ -2268,8 +1897,7 @@ lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv)
* Will wait until the pipe is actually running (i.e. first vblank) before
* returning.
*/
-void
-intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
+static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
bool pch_port)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2321,8 +1949,7 @@ intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
*
* Will wait until the pipe has shut down before returning.
*/
-void
-intel_disable_pipe(struct drm_i915_private *dev_priv,
+static void intel_disable_pipe(struct drm_i915_private *dev_priv,
enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2354,8 +1981,7 @@ intel_disable_pipe(struct drm_i915_private *dev_priv,
* Plane regs are double buffered, going from enabled->disabled needs a
* trigger in order to latch. The display address reg provides this.
*/
-void
-intel_flush_display_plane(struct drm_i915_private *dev_priv,
+void intel_flush_display_plane(struct drm_i915_private *dev_priv,
enum plane plane)
{
if (dev_priv->info->gen >= 4)
@@ -2372,8 +1998,7 @@ intel_flush_display_plane(struct drm_i915_private *dev_priv,
*
* Enable @plane on @pipe, making sure that @pipe is running first.
*/
-void
-intel_enable_plane(struct drm_i915_private *dev_priv,
+static void intel_enable_plane(struct drm_i915_private *dev_priv,
enum plane plane, enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2401,8 +2026,7 @@ intel_enable_plane(struct drm_i915_private *dev_priv,
*
* Disable @plane; should be an independent operation.
*/
-void
-intel_disable_plane(struct drm_i915_private *dev_priv,
+static void intel_disable_plane(struct drm_i915_private *dev_priv,
enum plane plane, enum pipe pipe)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -2480,8 +2104,7 @@ err_interruptible:
return ret;
}
-void
-intel_unpin_fb_obj(struct drm_i915_gem_object *obj)
+void intel_unpin_fb_obj(struct drm_i915_gem_object *obj)
{
i915_gem_object_unpin_fence(obj);
i915_gem_object_unpin(obj);
@@ -2489,8 +2112,7 @@ intel_unpin_fb_obj(struct drm_i915_gem_object *obj)
/* Computes the linear offset to the base tile and adjusts x, y. bytes per pixel
* is assumed to be a power-of-two. */
-unsigned long
-intel_gen4_compute_page_offset(int *x, int *y,
+unsigned long intel_gen4_compute_page_offset(int *x, int *y,
unsigned int tiling_mode,
unsigned int cpp,
unsigned int pitch)
@@ -2515,8 +2137,7 @@ intel_gen4_compute_page_offset(int *x, int *y,
}
}
-int
-i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
+static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
int x, int y)
{
struct drm_device *dev = crtc->dev;
@@ -2613,8 +2234,7 @@ i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
return 0;
}
-int
-ironlake_update_plane(struct drm_crtc *crtc,
+static int ironlake_update_plane(struct drm_crtc *crtc,
struct drm_framebuffer *fb, int x, int y)
{
struct drm_device *dev = crtc->dev;
@@ -2706,7 +2326,7 @@ ironlake_update_plane(struct drm_crtc *crtc,
}
/* Assume fb object is pinned & idle & fenced and just update base pointers */
-int
+static int
intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
int x, int y, enum mode_set_atomic state)
{
@@ -2720,7 +2340,7 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
return dev_priv->display.update_plane(crtc, fb, x, y);
}
-int
+static int
intel_finish_fb(struct drm_framebuffer *old_fb)
{
struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj;
@@ -2748,8 +2368,7 @@ intel_finish_fb(struct drm_framebuffer *old_fb)
return ret;
}
-void
-intel_crtc_update_sarea_pos(struct drm_crtc *crtc, int x, int y)
+static void intel_crtc_update_sarea_pos(struct drm_crtc *crtc, int x, int y)
{
#if 0
struct drm_device *dev = crtc->dev;
@@ -2778,7 +2397,7 @@ intel_crtc_update_sarea_pos(struct drm_crtc *crtc, int x, int y)
#endif
}
-int
+static int
intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
struct drm_framebuffer *fb)
{
@@ -2840,8 +2459,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
return 0;
}
-void
-ironlake_set_pll_edp(struct drm_crtc *crtc, int clock)
+static void ironlake_set_pll_edp(struct drm_crtc *crtc, int clock)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2878,8 +2496,7 @@ ironlake_set_pll_edp(struct drm_crtc *crtc, int clock)
udelay(500);
}
-void
-intel_fdi_normal_train(struct drm_crtc *crtc)
+static void intel_fdi_normal_train(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2920,8 +2537,7 @@ intel_fdi_normal_train(struct drm_crtc *crtc)
FDI_FE_ERRC_ENABLE);
}
-void
-ivb_modeset_global_resources(struct drm_device *dev)
+static void ivb_modeset_global_resources(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *pipe_B_crtc =
@@ -2945,8 +2561,7 @@ ivb_modeset_global_resources(struct drm_device *dev)
}
/* The FDI link training functions for ILK/Ibexpeak. */
-void
-ironlake_fdi_link_train(struct drm_crtc *crtc)
+static void ironlake_fdi_link_train(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3048,8 +2663,7 @@ static const int snb_b_fdi_train_param[] = {
};
/* The FDI link training functions for SNB/Cougarpoint. */
-void
-gen6_fdi_link_train(struct drm_crtc *crtc)
+static void gen6_fdi_link_train(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3181,8 +2795,7 @@ gen6_fdi_link_train(struct drm_crtc *crtc)
}
/* Manual link training for Ivy Bridge A0 parts */
-void
-ivb_manual_fdi_link_train(struct drm_crtc *crtc)
+static void ivb_manual_fdi_link_train(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3298,8 +2911,7 @@ ivb_manual_fdi_link_train(struct drm_crtc *crtc)
DRM_DEBUG_KMS("FDI train done.\n");
}
-void
-ironlake_fdi_pll_enable(struct intel_crtc *intel_crtc)
+static void ironlake_fdi_pll_enable(struct intel_crtc *intel_crtc)
{
struct drm_device *dev = intel_crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3340,8 +2952,7 @@ ironlake_fdi_pll_enable(struct intel_crtc *intel_crtc)
}
}
-void
-ironlake_fdi_pll_disable(struct intel_crtc *intel_crtc)
+static void ironlake_fdi_pll_disable(struct intel_crtc *intel_crtc)
{
struct drm_device *dev = intel_crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3370,8 +2981,7 @@ ironlake_fdi_pll_disable(struct intel_crtc *intel_crtc)
udelay(100);
}
-void
-ironlake_fdi_disable(struct drm_crtc *crtc)
+static void ironlake_fdi_disable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3424,8 +3034,7 @@ ironlake_fdi_disable(struct drm_crtc *crtc)
udelay(100);
}
-bool
-intel_crtc_has_pending_flip(struct drm_crtc *crtc)
+static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3441,8 +3050,7 @@ intel_crtc_has_pending_flip(struct drm_crtc *crtc)
return pending;
}
-void
-intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
+static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3458,8 +3066,7 @@ intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
DRM_UNLOCK();
}
-bool
-ironlake_crtc_driving_pch(struct drm_crtc *crtc)
+static bool ironlake_crtc_driving_pch(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct intel_encoder *intel_encoder;
@@ -3480,15 +3087,13 @@ ironlake_crtc_driving_pch(struct drm_crtc *crtc)
return true;
}
-bool
-haswell_crtc_driving_pch(struct drm_crtc *crtc)
+static bool haswell_crtc_driving_pch(struct drm_crtc *crtc)
{
return intel_pipe_has_type(crtc, INTEL_OUTPUT_ANALOG);
}
/* Program iCLKIP clock to the desired frequency */
-void
-lpt_program_iclkip(struct drm_crtc *crtc)
+static void lpt_program_iclkip(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3579,8 +3184,7 @@ lpt_program_iclkip(struct drm_crtc *crtc)
* - DP transcoding bits
* - transcoder
*/
-void
-ironlake_pch_enable(struct drm_crtc *crtc)
+static void ironlake_pch_enable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3685,8 +3289,7 @@ ironlake_pch_enable(struct drm_crtc *crtc)
ironlake_enable_pch_transcoder(dev_priv, pipe);
}
-void
-lpt_pch_enable(struct drm_crtc *crtc)
+static void lpt_pch_enable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3710,8 +3313,7 @@ lpt_pch_enable(struct drm_crtc *crtc)
lpt_enable_pch_transcoder(dev_priv, cpu_transcoder);
}
-void
-intel_put_pch_pll(struct intel_crtc *intel_crtc)
+static void intel_put_pch_pll(struct intel_crtc *intel_crtc)
{
struct intel_pch_pll *pll = intel_crtc->pch_pll;
@@ -3727,8 +3329,7 @@ intel_put_pch_pll(struct intel_crtc *intel_crtc)
intel_crtc->pch_pll = NULL;
}
-static struct intel_pch_pll *
-intel_get_pch_pll(struct intel_crtc *intel_crtc, u32 dpll, u32 fp)
+static struct intel_pch_pll *intel_get_pch_pll(struct intel_crtc *intel_crtc, u32 dpll, u32 fp)
{
struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private;
struct drm_device *dev = intel_crtc->base.dev;
@@ -3800,8 +3401,7 @@ prepare: /* separate function? */
return pll;
}
-void
-intel_cpt_verify_modeset(struct drm_device *dev, int pipe)
+void intel_cpt_verify_modeset(struct drm_device *dev, int pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int dslreg = PIPEDSL(pipe);
@@ -3820,8 +3420,7 @@ intel_cpt_verify_modeset(struct drm_device *dev, int pipe)
}
}
-void
-ironlake_crtc_enable(struct drm_crtc *crtc)
+static void ironlake_crtc_enable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3914,8 +3513,7 @@ ironlake_crtc_enable(struct drm_crtc *crtc)
intel_wait_for_vblank(dev, intel_crtc->pipe);
}
-void
-haswell_crtc_enable(struct drm_crtc *crtc)
+static void haswell_crtc_enable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3992,8 +3590,7 @@ haswell_crtc_enable(struct drm_crtc *crtc)
intel_wait_for_vblank(dev, intel_crtc->pipe);
}
-void
-ironlake_crtc_disable(struct drm_crtc *crtc)
+static void ironlake_crtc_disable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4073,8 +3670,7 @@ ironlake_crtc_disable(struct drm_crtc *crtc)
DRM_UNLOCK();
}
-void
-haswell_crtc_disable(struct drm_crtc *crtc)
+static void haswell_crtc_disable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4129,15 +3725,13 @@ haswell_crtc_disable(struct drm_crtc *crtc)
DRM_UNLOCK();
}
-void
-ironlake_crtc_off(struct drm_crtc *crtc)
+static void ironlake_crtc_off(struct drm_crtc *crtc)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
intel_put_pch_pll(intel_crtc);
}
-void
-haswell_crtc_off(struct drm_crtc *crtc)
+static void haswell_crtc_off(struct drm_crtc *crtc)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -4148,8 +3742,7 @@ haswell_crtc_off(struct drm_crtc *crtc)
intel_ddi_put_crtc_pll(crtc);
}
-void
-intel_crtc_dpms_overlay(struct intel_crtc *intel_crtc, bool enable)
+static void intel_crtc_dpms_overlay(struct intel_crtc *intel_crtc, bool enable)
{
if (!enable && intel_crtc->overlay) {
struct drm_device *dev = intel_crtc->base.dev;
@@ -4167,8 +3760,7 @@ intel_crtc_dpms_overlay(struct intel_crtc *intel_crtc, bool enable)
*/
}
-void
-i9xx_crtc_enable(struct drm_crtc *crtc)
+static void i9xx_crtc_enable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4200,8 +3792,7 @@ i9xx_crtc_enable(struct drm_crtc *crtc)
encoder->enable(encoder);
}
-void
-i9xx_crtc_disable(struct drm_crtc *crtc)
+static void i9xx_crtc_disable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4243,13 +3834,11 @@ i9xx_crtc_disable(struct drm_crtc *crtc)
intel_update_watermarks(dev);
}
-void
-i9xx_crtc_off(struct drm_crtc *crtc)
+static void i9xx_crtc_off(struct drm_crtc *crtc)
{
}
-void
-intel_crtc_update_sarea(struct drm_crtc *crtc,
+static void intel_crtc_update_sarea(struct drm_crtc *crtc,
bool enabled)
{
#if 0
@@ -4284,8 +3873,7 @@ intel_crtc_update_sarea(struct drm_crtc *crtc,
/**
* Sets the power management mode of the pipe and plane.
*/
-void
-intel_crtc_update_dpms(struct drm_crtc *crtc)
+void intel_crtc_update_dpms(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4303,13 +3891,11 @@ intel_crtc_update_dpms(struct drm_crtc *crtc)
intel_crtc_update_sarea(crtc, enable);
}
-void
-intel_crtc_noop(struct drm_crtc *crtc)
+static void intel_crtc_noop(struct drm_crtc *crtc)
{
}
-void
-intel_crtc_disable(struct drm_crtc *crtc)
+static void intel_crtc_disable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_connector *connector;
@@ -4345,8 +3931,7 @@ intel_crtc_disable(struct drm_crtc *crtc)
}
}
-void
-intel_modeset_disable(struct drm_device *dev)
+void intel_modeset_disable(struct drm_device *dev)
{
struct drm_crtc *crtc;
@@ -4356,13 +3941,11 @@ intel_modeset_disable(struct drm_device *dev)
}
}
-void
-intel_encoder_noop(struct drm_encoder *encoder)
+void intel_encoder_noop(struct drm_encoder *encoder)
{
}
-void
-intel_encoder_destroy(struct drm_encoder *encoder)
+void intel_encoder_destroy(struct drm_encoder *encoder)
{
struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
@@ -4373,8 +3956,7 @@ intel_encoder_destroy(struct drm_encoder *encoder)
/* Simple dpms helper for encodres with just one connector, no cloning and only
* one kind of off state. It clamps all !ON modes to fully OFF and changes the
* state of the entire output pipe. */
-void
-intel_encoder_dpms(struct intel_encoder *encoder, int mode)
+void intel_encoder_dpms(struct intel_encoder *encoder, int mode)
{
if (mode == DRM_MODE_DPMS_ON) {
encoder->connectors_active = true;
@@ -4389,8 +3971,7 @@ intel_encoder_dpms(struct intel_encoder *encoder, int mode)
/* Cross check the actual hw state with our own modeset state tracking (and it's
* internal consistency). */
-void
-intel_connector_check_state(struct intel_connector *connector)
+static void intel_connector_check_state(struct intel_connector *connector)
{
if (connector->get_hw_state(connector)) {
struct intel_encoder *encoder = connector->encoder;
@@ -4425,8 +4006,7 @@ intel_connector_check_state(struct intel_connector *connector)
/* Even simpler default implementation, if there's really no special case to
* consider. */
-void
-intel_connector_dpms(struct drm_connector *connector, int mode)
+void intel_connector_dpms(struct drm_connector *connector, int mode)
{
struct intel_encoder *encoder = intel_attached_encoder(connector);
@@ -4451,8 +4031,7 @@ intel_connector_dpms(struct drm_connector *connector, int mode)
/* Simple connector->get_hw_state implementation for encoders that support only
* one connector and no cloning and hence the encoder state determines the state
* of the connector. */
-bool
-intel_connector_get_hw_state(struct intel_connector *connector)
+bool intel_connector_get_hw_state(struct intel_connector *connector)
{
enum pipe pipe = 0;
struct intel_encoder *encoder = connector->encoder;
@@ -4460,8 +4039,7 @@ intel_connector_get_hw_state(struct intel_connector *connector)
return encoder->get_hw_state(encoder, &pipe);
}
-bool
-intel_crtc_mode_fixup(struct drm_crtc *crtc,
+static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -4489,32 +4067,27 @@ intel_crtc_mode_fixup(struct drm_crtc *crtc,
return true;
}
-int
-valleyview_get_display_clock_speed(struct drm_device *dev)
+static int valleyview_get_display_clock_speed(struct drm_device *dev)
{
return 400000; /* FIXME */
}
-int
-i945_get_display_clock_speed(struct drm_device *dev)
+static int i945_get_display_clock_speed(struct drm_device *dev)
{
return 400000;
}
-int
-i915_get_display_clock_speed(struct drm_device *dev)
+static int i915_get_display_clock_speed(struct drm_device *dev)
{
return 333000;
}
-int
-i9xx_misc_get_display_clock_speed(struct drm_device *dev)
+static int i9xx_misc_get_display_clock_speed(struct drm_device *dev)
{
return 200000;
}
-int
-i915gm_get_display_clock_speed(struct drm_device *dev)
+static int i915gm_get_display_clock_speed(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u16 gcfgc = 0;
@@ -4534,14 +4107,12 @@ i915gm_get_display_clock_speed(struct drm_device *dev)
}
}
-int
-i865_get_display_clock_speed(struct drm_device *dev)
+static int i865_get_display_clock_speed(struct drm_device *dev)
{
return 266000;
}
-int
-i855_get_display_clock_speed(struct drm_device *dev)
+static int i855_get_display_clock_speed(struct drm_device *dev)
{
u16 hpllcc = 0;
/* Assume that the hardware is in the high speed state. This
@@ -4561,13 +4132,20 @@ i855_get_display_clock_speed(struct drm_device *dev)
return 0;
}
-int
-i830_get_display_clock_speed(struct drm_device *dev)
+static int i830_get_display_clock_speed(struct drm_device *dev)
{
return 133000;
}
-void
+struct fdi_m_n {
+ u32 tu;
+ u32 gmch_m;
+ u32 gmch_n;
+ u32 link_m;
+ u32 link_n;
+};
+
+static void
fdi_reduce_ratio(u32 *num, u32 *den)
{
while (*num > 0xffffff || *den > 0xffffff) {
@@ -4576,7 +4154,7 @@ fdi_reduce_ratio(u32 *num, u32 *den)
}
}
-void
+static void
ironlake_compute_m_n(int bits_per_pixel, int nlanes, int pixel_clock,
int link_clock, struct fdi_m_n *m_n)
{
@@ -4592,8 +4170,7 @@ ironlake_compute_m_n(int bits_per_pixel, int nlanes, int pixel_clock,
fdi_reduce_ratio(&m_n->link_m, &m_n->link_n);
}
-static inline bool
-intel_panel_use_ssc(struct drm_i915_private *dev_priv)
+static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
{
if (i915_panel_use_ssc >= 0)
return i915_panel_use_ssc != 0;
@@ -4622,8 +4199,7 @@ intel_panel_use_ssc(struct drm_i915_private *dev_priv)
* Dithering requirement (i.e. false if display bpc and pipe bpc match,
* true if they don't match).
*/
-bool
-intel_choose_pipe_bpp_dither(struct drm_crtc *crtc,
+static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc,
struct drm_framebuffer *fb,
unsigned int *pipe_bpp,
struct drm_display_mode *mode)
@@ -4738,8 +4314,7 @@ intel_choose_pipe_bpp_dither(struct drm_crtc *crtc,
return display_bpc != bpc;
}
-int
-vlv_get_refclk(struct drm_crtc *crtc)
+static int vlv_get_refclk(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4761,8 +4336,7 @@ vlv_get_refclk(struct drm_crtc *crtc)
return refclk;
}
-int
-i9xx_get_refclk(struct drm_crtc *crtc, int num_connectors)
+static int i9xx_get_refclk(struct drm_crtc *crtc, int num_connectors)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4784,8 +4358,7 @@ i9xx_get_refclk(struct drm_crtc *crtc, int num_connectors)
return refclk;
}
-void
-i9xx_adjust_sdvo_tv_clock(struct drm_display_mode *adjusted_mode,
+static void i9xx_adjust_sdvo_tv_clock(struct drm_display_mode *adjusted_mode,
intel_clock_t *clock)
{
/* SDVO TV has fixed PLL values depend on its clock range,
@@ -4807,8 +4380,7 @@ i9xx_adjust_sdvo_tv_clock(struct drm_display_mode *adjusted_mode,
}
}
-void
-i9xx_update_pll_dividers(struct drm_crtc *crtc,
+static void i9xx_update_pll_dividers(struct drm_crtc *crtc,
intel_clock_t *clock,
intel_clock_t *reduced_clock)
{
@@ -4842,8 +4414,7 @@ i9xx_update_pll_dividers(struct drm_crtc *crtc,
}
}
-void
-intel_update_lvds(struct drm_crtc *crtc, intel_clock_t *clock,
+static void intel_update_lvds(struct drm_crtc *crtc, intel_clock_t *clock,
struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = crtc->dev;
@@ -4888,8 +4459,7 @@ intel_update_lvds(struct drm_crtc *crtc, intel_clock_t *clock,
I915_WRITE(LVDS, temp);
}
-void
-vlv_update_pll(struct drm_crtc *crtc,
+static void vlv_update_pll(struct drm_crtc *crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
intel_clock_t *clock, intel_clock_t *reduced_clock,
@@ -4995,8 +4565,7 @@ vlv_update_pll(struct drm_crtc *crtc,
}
}
-void
-i9xx_update_pll(struct drm_crtc *crtc,
+static void i9xx_update_pll(struct drm_crtc *crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
intel_clock_t *clock, intel_clock_t *reduced_clock,
@@ -5109,8 +4678,7 @@ i9xx_update_pll(struct drm_crtc *crtc,
}
}
-void
-i8xx_update_pll(struct drm_crtc *crtc,
+static void i8xx_update_pll(struct drm_crtc *crtc,
struct drm_display_mode *adjusted_mode,
intel_clock_t *clock, intel_clock_t *reduced_clock,
int num_connectors)
@@ -5172,8 +4740,7 @@ i8xx_update_pll(struct drm_crtc *crtc,
I915_WRITE(DPLL(pipe), dpll);
}
-void
-intel_set_pipe_timings(struct intel_crtc *intel_crtc,
+static void intel_set_pipe_timings(struct intel_crtc *intel_crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -5231,8 +4798,7 @@ intel_set_pipe_timings(struct intel_crtc *intel_crtc,
((mode->hdisplay - 1) << 16) | (mode->vdisplay - 1));
}
-int
-i9xx_crtc_mode_set(struct drm_crtc *crtc,
+static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
int x, int y,
@@ -5411,8 +4977,7 @@ i9xx_crtc_mode_set(struct drm_crtc *crtc,
return ret;
}
-void
-ironlake_init_pch_refclk(struct drm_device *dev)
+static void ironlake_init_pch_refclk(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_mode_config *mode_config = &dev->mode_config;
@@ -5527,8 +5092,7 @@ ironlake_init_pch_refclk(struct drm_device *dev)
}
/* Sequence to enable CLKOUT_DP for FDI usage and configure PCH FDI I/O. */
-void
-lpt_init_pch_refclk(struct drm_device *dev)
+static void lpt_init_pch_refclk(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_mode_config *mode_config = &dev->mode_config;
@@ -5703,8 +5267,7 @@ lpt_init_pch_refclk(struct drm_device *dev)
/*
* Initialize reference clocks when the driver loads
*/
-void
-intel_init_pch_refclk(struct drm_device *dev)
+void intel_init_pch_refclk(struct drm_device *dev)
{
if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
ironlake_init_pch_refclk(dev);
@@ -5712,8 +5275,7 @@ intel_init_pch_refclk(struct drm_device *dev)
lpt_init_pch_refclk(dev);
}
-int
-ironlake_get_refclk(struct drm_crtc *crtc)
+static int ironlake_get_refclk(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -5743,8 +5305,7 @@ ironlake_get_refclk(struct drm_crtc *crtc)
return 120000;
}
-void
-ironlake_set_pipeconf(struct drm_crtc *crtc,
+static void ironlake_set_pipeconf(struct drm_crtc *crtc,
struct drm_display_mode *adjusted_mode,
bool dither)
{
@@ -5788,8 +5349,7 @@ ironlake_set_pipeconf(struct drm_crtc *crtc,
POSTING_READ(PIPECONF(pipe));
}
-void
-haswell_set_pipeconf(struct drm_crtc *crtc,
+static void haswell_set_pipeconf(struct drm_crtc *crtc,
struct drm_display_mode *adjusted_mode,
bool dither)
{
@@ -5814,8 +5374,7 @@ haswell_set_pipeconf(struct drm_crtc *crtc,
POSTING_READ(PIPECONF(cpu_transcoder));
}
-bool
-ironlake_compute_clocks(struct drm_crtc *crtc,
+static bool ironlake_compute_clocks(struct drm_crtc *crtc,
struct drm_display_mode *adjusted_mode,
intel_clock_t *clock,
bool *has_reduced_clock,
@@ -5878,8 +5437,7 @@ ironlake_compute_clocks(struct drm_crtc *crtc,
return true;
}
-void
-cpt_enable_fdi_bc_bifurcation(struct drm_device *dev)
+static void cpt_enable_fdi_bc_bifurcation(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t temp;
@@ -5897,8 +5455,7 @@ cpt_enable_fdi_bc_bifurcation(struct drm_device *dev)
POSTING_READ(SOUTH_CHICKEN1);
}
-bool
-ironlake_check_fdi_lanes(struct intel_crtc *intel_crtc)
+static bool ironlake_check_fdi_lanes(struct intel_crtc *intel_crtc)
{
struct drm_device *dev = intel_crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -5962,8 +5519,7 @@ ironlake_check_fdi_lanes(struct intel_crtc *intel_crtc)
}
}
-int
-ironlake_get_lanes_required(int target_clock, int link_bw, int bpp)
+int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp)
{
/*
* Account for spread spectrum to avoid
@@ -5974,8 +5530,7 @@ ironlake_get_lanes_required(int target_clock, int link_bw, int bpp)
return bps / (link_bw * 8) + 1;
}
-void
-ironlake_set_m_n(struct drm_crtc *crtc,
+static void ironlake_set_m_n(struct drm_crtc *crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -6045,8 +5600,7 @@ ironlake_set_m_n(struct drm_crtc *crtc,
I915_WRITE(PIPE_LINK_N1(cpu_transcoder), m_n.link_n);
}
-uint32_t
-ironlake_compute_dpll(struct intel_crtc *intel_crtc,
+static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc,
struct drm_display_mode *adjusted_mode,
intel_clock_t *clock, u32 fp)
{
@@ -6149,8 +5703,7 @@ ironlake_compute_dpll(struct intel_crtc *intel_crtc,
return dpll;
}
-int
-ironlake_crtc_mode_set(struct drm_crtc *crtc,
+static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
int x, int y,
@@ -6333,8 +5886,7 @@ ironlake_crtc_mode_set(struct drm_crtc *crtc,
return fdi_config_ok ? ret : -EINVAL;
}
-int
-haswell_crtc_mode_set(struct drm_crtc *crtc,
+static int haswell_crtc_mode_set(struct drm_crtc *crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
int x, int y,
@@ -6545,8 +6097,7 @@ haswell_crtc_mode_set(struct drm_crtc *crtc,
return ret;
}
-int
-intel_crtc_mode_set(struct drm_crtc *crtc,
+static int intel_crtc_mode_set(struct drm_crtc *crtc,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
int x, int y,
@@ -6581,8 +6132,7 @@ intel_crtc_mode_set(struct drm_crtc *crtc,
return 0;
}
-bool
-intel_eld_uptodate(struct drm_connector *connector,
+static bool intel_eld_uptodate(struct drm_connector *connector,
int reg_eldv, uint32_t bits_eldv,
int reg_elda, uint32_t bits_elda,
int reg_edid)
@@ -6611,8 +6161,7 @@ intel_eld_uptodate(struct drm_connector *connector,
return true;
}
-void
-g4x_write_eld(struct drm_connector *connector,
+static void g4x_write_eld(struct drm_connector *connector,
struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = connector->dev->dev_private;
@@ -6653,8 +6202,7 @@ g4x_write_eld(struct drm_connector *connector,
I915_WRITE(G4X_AUD_CNTL_ST, i);
}
-void
-haswell_write_eld(struct drm_connector *connector,
+static void haswell_write_eld(struct drm_connector *connector,
struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = connector->dev->dev_private;
@@ -6739,8 +6287,7 @@ haswell_write_eld(struct drm_connector *connector,
}
-void
-ironlake_write_eld(struct drm_connector *connector,
+static void ironlake_write_eld(struct drm_connector *connector,
struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = connector->dev->dev_private;
@@ -6815,8 +6362,7 @@ ironlake_write_eld(struct drm_connector *connector,
I915_WRITE(aud_cntrl_st2, i);
}
-void
-intel_write_eld(struct drm_encoder *encoder,
+void intel_write_eld(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{
struct drm_crtc *crtc = encoder->crtc;
@@ -6841,8 +6387,7 @@ intel_write_eld(struct drm_encoder *encoder,
}
/** Loads the palette/gamma unit for the CRTC with the prepared values */
-void
-intel_crtc_load_lut(struct drm_crtc *crtc)
+void intel_crtc_load_lut(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -6866,8 +6411,7 @@ intel_crtc_load_lut(struct drm_crtc *crtc)
}
}
-void
-i845_update_cursor(struct drm_crtc *crtc, u32 base)
+static void i845_update_cursor(struct drm_crtc *crtc, u32 base)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -6897,8 +6441,7 @@ i845_update_cursor(struct drm_crtc *crtc, u32 base)
intel_crtc->cursor_visible = visible;
}
-void
-i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
+static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -6924,8 +6467,7 @@ i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
I915_WRITE(CURBASE(pipe), base);
}
-void
-ivb_update_cursor(struct drm_crtc *crtc, u32 base)
+static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -6951,8 +6493,7 @@ ivb_update_cursor(struct drm_crtc *crtc, u32 base)
}
/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
-void
-intel_crtc_update_cursor(struct drm_crtc *crtc,
+static void intel_crtc_update_cursor(struct drm_crtc *crtc,
bool on)
{
struct drm_device *dev = crtc->dev;
@@ -7010,8 +6551,7 @@ intel_crtc_update_cursor(struct drm_crtc *crtc,
}
}
-int
-intel_crtc_cursor_set(struct drm_crtc *crtc,
+static int intel_crtc_cursor_set(struct drm_crtc *crtc,
struct drm_file *file,
uint32_t handle,
uint32_t width, uint32_t height)
@@ -7114,8 +6654,7 @@ fail:
return ret;
}
-int
-intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
+static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -7128,8 +6667,7 @@ intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
}
/** Sets the color ramps on behalf of RandR */
-void
-intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
+void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
u16 blue, int regno)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -7139,8 +6677,7 @@ intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
intel_crtc->lut_b[regno] = blue >> 8;
}
-void
-intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
+void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, int regno)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -7150,8 +6687,7 @@ intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
*blue = intel_crtc->lut_b[regno] << 8;
}
-void
-intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
+static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t start, uint32_t size)
{
int end = (start + size > 256) ? 256 : start + size, i;
@@ -7186,7 +6722,7 @@ static struct drm_display_mode load_detect_mode = {
704, 832, 0, 480, 489, 491, 520, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
};
-struct drm_framebuffer *
+static struct drm_framebuffer *
intel_framebuffer_create(struct drm_device *dev,
struct drm_mode_fb_cmd2 *mode_cmd,
struct drm_i915_gem_object *obj)
@@ -7210,21 +6746,21 @@ intel_framebuffer_create(struct drm_device *dev,
return &intel_fb->base;
}
-u32
+static u32
intel_framebuffer_pitch_for_width(int width, int bpp)
{
u32 pitch = howmany(width * bpp, 8);
return roundup2(pitch, 64);
}
-u32
+static u32
intel_framebuffer_size_for_mode(struct drm_display_mode *mode, int bpp)
{
u32 pitch = intel_framebuffer_pitch_for_width(mode->hdisplay, bpp);
return roundup2(pitch * mode->vdisplay, PAGE_SIZE);
}
-struct drm_framebuffer *
+static struct drm_framebuffer *
intel_framebuffer_create_for_mode(struct drm_device *dev,
struct drm_display_mode *mode,
int depth, int bpp)
@@ -7246,7 +6782,7 @@ intel_framebuffer_create_for_mode(struct drm_device *dev,
return intel_framebuffer_create(dev, &mode_cmd, obj);
}
-struct drm_framebuffer *
+static struct drm_framebuffer *
mode_fits_in_fbdev(struct drm_device *dev,
struct drm_display_mode *mode)
{
@@ -7272,8 +6808,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
return fb;
}
-bool
-intel_get_load_detect_pipe(struct drm_connector *connector,
+bool intel_get_load_detect_pipe(struct drm_connector *connector,
struct drm_display_mode *mode,
struct intel_load_detect_pipe *old)
{
@@ -7376,8 +6911,7 @@ intel_get_load_detect_pipe(struct drm_connector *connector,
return true;
}
-void
-intel_release_load_detect_pipe(struct drm_connector *connector,
+void intel_release_load_detect_pipe(struct drm_connector *connector,
struct intel_load_detect_pipe *old)
{
struct intel_encoder *intel_encoder =
@@ -7407,8 +6941,7 @@ intel_release_load_detect_pipe(struct drm_connector *connector,
}
/* Returns the clock of the currently programmed mode of the given pipe. */
-int
-intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
+static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -7495,8 +7028,7 @@ intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
}
/** Returns the currently programmed mode of the given pipe. */
-struct drm_display_mode *
-intel_crtc_mode_get(struct drm_device *dev,
+struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
struct drm_crtc *crtc)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -7527,8 +7059,7 @@ intel_crtc_mode_get(struct drm_device *dev,
return mode;
}
-void
-intel_increase_pllclock(struct drm_crtc *crtc)
+static void intel_increase_pllclock(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -7559,8 +7090,7 @@ intel_increase_pllclock(struct drm_crtc *crtc)
}
}
-void
-intel_decrease_pllclock(struct drm_crtc *crtc)
+static void intel_decrease_pllclock(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -7596,14 +7126,12 @@ intel_decrease_pllclock(struct drm_crtc *crtc)
}
-void
-intel_mark_busy(struct drm_device *dev)
+void intel_mark_busy(struct drm_device *dev)
{
i915_update_gfx_val(dev->dev_private);
}
-void
-intel_mark_idle(struct drm_device *dev)
+void intel_mark_idle(struct drm_device *dev)
{
struct drm_crtc *crtc;
@@ -7618,8 +7146,7 @@ intel_mark_idle(struct drm_device *dev)
}
}
-void
-intel_mark_fb_busy(struct drm_i915_gem_object *obj)
+void intel_mark_fb_busy(struct drm_i915_gem_object *obj)
{
struct drm_device *dev = obj->base.dev;
struct drm_crtc *crtc;
@@ -7636,8 +7163,7 @@ intel_mark_fb_busy(struct drm_i915_gem_object *obj)
}
}
-void
-intel_crtc_destroy(struct drm_crtc *crtc)
+static void intel_crtc_destroy(struct drm_crtc *crtc)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct drm_device *dev = crtc->dev;
@@ -7658,8 +7184,7 @@ intel_crtc_destroy(struct drm_crtc *crtc)
free(intel_crtc, M_DRM);
}
-void
-intel_unpin_work_fn(void *arg1, void *arg2)
+static void intel_unpin_work_fn(void *arg1, void *arg2)
{
struct intel_unpin_work *work = arg1;
struct drm_device *dev = work->crtc->dev;
@@ -7678,8 +7203,7 @@ intel_unpin_work_fn(void *arg1, void *arg2)
free(work, M_DRM);
}
-void
-do_intel_finish_page_flip(struct drm_device *dev,
+static void do_intel_finish_page_flip(struct drm_device *dev,
struct drm_crtc *crtc)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -7724,8 +7248,7 @@ do_intel_finish_page_flip(struct drm_device *dev,
// trace_i915_flip_complete(intel_crtc->plane, work->pending_flip_obj);
}
-void
-intel_finish_page_flip(struct drm_device *dev, int pipe)
+void intel_finish_page_flip(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
@@ -7733,8 +7256,7 @@ intel_finish_page_flip(struct drm_device *dev, int pipe)
do_intel_finish_page_flip(dev, crtc);
}
-void
-intel_finish_page_flip_plane(struct drm_device *dev, int plane)
+void intel_finish_page_flip_plane(struct drm_device *dev, int plane)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_crtc *crtc = dev_priv->plane_to_crtc_mapping[plane];
@@ -7742,8 +7264,7 @@ intel_finish_page_flip_plane(struct drm_device *dev, int plane)
do_intel_finish_page_flip(dev, crtc);
}
-void
-intel_prepare_page_flip(struct drm_device *dev, int plane)
+void intel_prepare_page_flip(struct drm_device *dev, int plane)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc =
@@ -7759,8 +7280,7 @@ intel_prepare_page_flip(struct drm_device *dev, int plane)
mtx_leave(&dev->event_lock);
}
-static inline void
-intel_mark_page_flip_active(struct intel_crtc *intel_crtc)
+static inline void intel_mark_page_flip_active(struct intel_crtc *intel_crtc)
{
/* Ensure that the work item is consistent when activating it ... */
DRM_WRITEMEMORYBARRIER();
@@ -7769,8 +7289,7 @@ intel_mark_page_flip_active(struct intel_crtc *intel_crtc)
DRM_WRITEMEMORYBARRIER();
}
-int
-intel_gen2_queue_flip(struct drm_device *dev,
+static int intel_gen2_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj)
@@ -7814,8 +7333,7 @@ err:
return ret;
}
-int
-intel_gen3_queue_flip(struct drm_device *dev,
+static int intel_gen3_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj)
@@ -7856,8 +7374,7 @@ err:
return ret;
}
-int
-intel_gen4_queue_flip(struct drm_device *dev,
+static int intel_gen4_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj)
@@ -7905,8 +7422,7 @@ err:
return ret;
}
-int
-intel_gen6_queue_flip(struct drm_device *dev,
+static int intel_gen6_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj)
@@ -7956,8 +7472,7 @@ err:
* means clients will hang after the first flip is queued. Fortunately the
* blit ring generates interrupts properly, so use it instead.
*/
-int
-intel_gen7_queue_flip(struct drm_device *dev,
+static int intel_gen7_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj)
@@ -8009,8 +7524,7 @@ err:
return ret;
}
-int
-intel_default_queue_flip(struct drm_device *dev,
+static int intel_default_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj)
@@ -8018,8 +7532,7 @@ intel_default_queue_flip(struct drm_device *dev,
return -ENODEV;
}
-int
-intel_crtc_page_flip(struct drm_crtc *crtc,
+static int intel_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event)
{
@@ -8132,8 +7645,7 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = {
.disable = intel_crtc_noop,
};
-bool
-intel_encoder_check_is_cloned(struct intel_encoder *encoder)
+bool intel_encoder_check_is_cloned(struct intel_encoder *encoder)
{
struct intel_encoder *other_encoder;
struct drm_crtc *crtc = &encoder->new_crtc->base;
@@ -8155,8 +7667,7 @@ intel_encoder_check_is_cloned(struct intel_encoder *encoder)
return false;
}
-bool
-intel_encoder_crtc_ok(struct drm_encoder *encoder,
+static bool intel_encoder_crtc_ok(struct drm_encoder *encoder,
struct drm_crtc *crtc)
{
struct drm_device *dev;
@@ -8184,8 +7695,7 @@ intel_encoder_crtc_ok(struct drm_encoder *encoder,
* Updates the staged output configuration state, e.g. after we've read out the
* current hw state.
*/
-void
-intel_modeset_update_staged_output_state(struct drm_device *dev)
+static void intel_modeset_update_staged_output_state(struct drm_device *dev)
{
struct intel_encoder *encoder;
struct intel_connector *connector;
@@ -8208,8 +7718,7 @@ intel_modeset_update_staged_output_state(struct drm_device *dev)
*
* This function copies the stage display pipe configuration to the real one.
*/
-void
-intel_modeset_commit_output_state(struct drm_device *dev)
+static void intel_modeset_commit_output_state(struct drm_device *dev)
{
struct intel_encoder *encoder;
struct intel_connector *connector;
@@ -8225,7 +7734,7 @@ intel_modeset_commit_output_state(struct drm_device *dev)
}
}
-struct drm_display_mode *
+static struct drm_display_mode *
intel_modeset_adjusted_mode(struct drm_crtc *crtc,
struct drm_display_mode *mode)
{
@@ -8269,7 +7778,7 @@ fail:
/* Computes which crtcs are affected and sets the relevant bits in the mask. For
* simplicity we use the crtc's pipe number (because it's easier to obtain). */
-void
+static void
intel_modeset_affected_pipes(struct drm_crtc *crtc, unsigned *modeset_pipes,
unsigned *prepare_pipes, unsigned *disable_pipes)
{
@@ -8362,8 +7871,7 @@ intel_modeset_affected_pipes(struct drm_crtc *crtc, unsigned *modeset_pipes,
*prepare_pipes &= 1 << intel_crtc->pipe;
}
-bool
-intel_crtc_in_use(struct drm_crtc *crtc)
+static bool intel_crtc_in_use(struct drm_crtc *crtc)
{
struct drm_encoder *encoder;
struct drm_device *dev = crtc->dev;
@@ -8375,7 +7883,7 @@ intel_crtc_in_use(struct drm_crtc *crtc)
return false;
}
-void
+static void
intel_modeset_update_state(struct drm_device *dev, unsigned prepare_pipes)
{
struct intel_encoder *intel_encoder;
@@ -8527,8 +8035,7 @@ intel_modeset_check_state(struct drm_device *dev)
}
}
-bool
-intel_set_mode(struct drm_crtc *crtc,
+bool intel_set_mode(struct drm_crtc *crtc,
struct drm_display_mode *mode,
int x, int y, struct drm_framebuffer *fb)
{
@@ -8623,8 +8130,7 @@ done:
#undef for_each_intel_crtc_masked
-void
-intel_set_config_free(struct intel_set_config *config)
+static void intel_set_config_free(struct intel_set_config *config)
{
if (!config)
return;
@@ -8634,8 +8140,7 @@ intel_set_config_free(struct intel_set_config *config)
free(config, M_DRM);
}
-int
-intel_set_config_save_state(struct drm_device *dev,
+static int intel_set_config_save_state(struct drm_device *dev,
struct intel_set_config *config)
{
struct drm_encoder *encoder;
@@ -8671,8 +8176,7 @@ intel_set_config_save_state(struct drm_device *dev,
return 0;
}
-void
-intel_set_config_restore_state(struct drm_device *dev,
+static void intel_set_config_restore_state(struct drm_device *dev,
struct intel_set_config *config)
{
struct intel_encoder *encoder;
@@ -8692,7 +8196,7 @@ intel_set_config_restore_state(struct drm_device *dev,
}
}
-void
+static void
intel_set_config_compute_mode_changes(struct drm_mode_set *set,
struct intel_set_config *config)
{
@@ -8726,7 +8230,7 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
}
}
-int
+static int
intel_modeset_stage_output_state(struct drm_device *dev,
struct drm_mode_set *set,
struct intel_set_config *config)
@@ -8827,8 +8331,7 @@ next_encoder:
return 0;
}
-int
-intel_crtc_set_config(struct drm_mode_set *set)
+static int intel_crtc_set_config(struct drm_mode_set *set)
{
struct drm_device *dev;
struct drm_mode_set save_set;
@@ -8929,15 +8432,13 @@ static const struct drm_crtc_funcs intel_crtc_funcs = {
.page_flip = intel_crtc_page_flip,
};
-void
-intel_cpu_pll_init(struct drm_device *dev)
+static void intel_cpu_pll_init(struct drm_device *dev)
{
if (IS_HASWELL(dev))
intel_ddi_pll_init(dev);
}
-void
-intel_pch_pll_init(struct drm_device *dev)
+static void intel_pch_pll_init(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
int i;
@@ -8954,8 +8455,7 @@ intel_pch_pll_init(struct drm_device *dev)
}
}
-void
-intel_crtc_init(struct drm_device *dev, int pipe)
+static void intel_crtc_init(struct drm_device *dev, int pipe)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc;
@@ -8995,8 +8495,7 @@ intel_crtc_init(struct drm_device *dev, int pipe)
drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);
}
-int
-intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
+int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
@@ -9020,8 +8519,7 @@ intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
return 0;
}
-int
-intel_encoder_clones(struct intel_encoder *encoder)
+static int intel_encoder_clones(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct intel_encoder *source_encoder;
@@ -9044,8 +8542,7 @@ intel_encoder_clones(struct intel_encoder *encoder)
return index_mask;
}
-bool
-has_edp_a(struct drm_device *dev)
+static bool has_edp_a(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -9062,8 +8559,7 @@ has_edp_a(struct drm_device *dev)
return true;
}
-void
-intel_setup_outputs(struct drm_device *dev)
+static void intel_setup_outputs(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_encoder *encoder;
@@ -9203,8 +8699,7 @@ intel_setup_outputs(struct drm_device *dev)
drm_helper_move_panel_connectors_to_head(dev);
}
-void
-intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
+static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
@@ -9214,8 +8709,7 @@ intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
free(intel_fb, M_DRM);
}
-int
-intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
+static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
struct drm_file *file,
unsigned int *handle)
{
@@ -9231,8 +8725,7 @@ static const struct drm_framebuffer_funcs intel_fb_funcs = {
.create_handle = intel_user_framebuffer_create_handle,
};
-int
-intel_framebuffer_init(struct drm_device *dev,
+int intel_framebuffer_init(struct drm_device *dev,
struct intel_framebuffer *intel_fb,
struct drm_mode_fb_cmd2 *mode_cmd,
struct drm_i915_gem_object *obj)
@@ -9318,7 +8811,7 @@ intel_framebuffer_init(struct drm_device *dev,
return 0;
}
-struct drm_framebuffer *
+static struct drm_framebuffer *
intel_user_framebuffer_create(struct drm_device *dev,
struct drm_file *filp,
struct drm_mode_fb_cmd2 *mode_cmd)
@@ -9339,8 +8832,7 @@ static const struct drm_mode_config_funcs intel_mode_funcs = {
};
/* Set up chip specific display functions */
-void
-intel_init_display(struct drm_device *dev)
+static void intel_init_display(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -9444,8 +8936,7 @@ intel_init_display(struct drm_device *dev)
* resume, or other times. This quirk makes sure that's the case for
* affected systems.
*/
-void
-quirk_pipea_force(struct drm_device *dev)
+static void quirk_pipea_force(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -9456,8 +8947,7 @@ quirk_pipea_force(struct drm_device *dev)
/*
* Some machines (Lenovo U160) do not work with SSC on LVDS for some reason
*/
-void
-quirk_ssc_force_disable(struct drm_device *dev)
+static void quirk_ssc_force_disable(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
dev_priv->quirks |= QUIRK_LVDS_SSC_DISABLE;
@@ -9468,8 +8958,7 @@ quirk_ssc_force_disable(struct drm_device *dev)
* A machine (e.g. Acer Aspire 5734Z) may need to invert the panel backlight
* brightness value
*/
-void
-quirk_invert_brightness(struct drm_device *dev)
+static void quirk_invert_brightness(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
dev_priv->quirks |= QUIRK_INVERT_BRIGHTNESS;
@@ -9489,12 +8978,13 @@ struct intel_dmi_quirk {
const struct dmi_system_id (*dmi_id_list)[];
};
-int
-intel_dmi_reverse_brightness(const struct dmi_system_id *id)
+#ifdef notyet
+static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
{
printf("Backlight polarity reversed on %s\n", id->ident);
return 1;
}
+#endif
#define PCI_ANY_ID (u_int16_t) (~0U)
@@ -9534,8 +9024,7 @@ static struct intel_quirk intel_quirks[] = {
{ 0x2a42, 0x1025, 0x034b, quirk_invert_brightness },
};
-void
-intel_init_quirks(struct drm_device *dev)
+static void intel_init_quirks(struct drm_device *dev)
{
int i;
@@ -9552,8 +9041,7 @@ intel_init_quirks(struct drm_device *dev)
}
/* Disable the VGA plane that we never use */
-void
-i915_disable_vga(struct drm_device *dev)
+static void i915_disable_vga(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u8 sr1;
@@ -9579,8 +9067,7 @@ i915_disable_vga(struct drm_device *dev)
POSTING_READ(vga_reg);
}
-void
-intel_modeset_init_hw(struct drm_device *dev)
+void intel_modeset_init_hw(struct drm_device *dev)
{
/* We attempt to init the necessary power wells early in the initialization
* time, so the subsystems that expect power to be enabled can work.
@@ -9596,8 +9083,7 @@ intel_modeset_init_hw(struct drm_device *dev)
DRM_UNLOCK();
}
-void
-intel_modeset_init(struct drm_device *dev)
+void intel_modeset_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i, ret;
@@ -9652,7 +9138,7 @@ intel_modeset_init(struct drm_device *dev)
intel_setup_outputs(dev);
}
-void
+static void
intel_connector_break_all_links(struct intel_connector *connector)
{
connector->base.dpms = DRM_MODE_DPMS_OFF;
@@ -9661,8 +9147,7 @@ intel_connector_break_all_links(struct intel_connector *connector)
connector->encoder->base.crtc = NULL;
}
-void
-intel_enable_pipe_a(struct drm_device *dev)
+static void intel_enable_pipe_a(struct drm_device *dev)
{
struct intel_connector *connector;
struct drm_connector *crt = NULL;
@@ -9689,7 +9174,7 @@ intel_enable_pipe_a(struct drm_device *dev)
}
-bool
+static bool
intel_check_plane_mapping(struct intel_crtc *crtc)
{
struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
@@ -9708,8 +9193,7 @@ intel_check_plane_mapping(struct intel_crtc *crtc)
return true;
}
-void
-intel_sanitize_crtc(struct intel_crtc *crtc)
+static void intel_sanitize_crtc(struct intel_crtc *crtc)
{
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -9790,8 +9274,7 @@ intel_sanitize_crtc(struct intel_crtc *crtc)
}
}
-void
-intel_sanitize_encoder(struct intel_encoder *encoder)
+static void intel_sanitize_encoder(struct intel_encoder *encoder)
{
struct intel_connector *connector;
struct drm_device *dev = encoder->base.dev;
@@ -9834,8 +9317,7 @@ intel_sanitize_encoder(struct intel_encoder *encoder)
* the crtc fixup. */
}
-void
-i915_redisable_vga(struct drm_device *dev)
+static void i915_redisable_vga(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 vga_reg;
@@ -9854,8 +9336,7 @@ i915_redisable_vga(struct drm_device *dev)
/* Scan out the current hw modeset state, sanitizes it and maps it into the drm
* and i915 state tracking structures. */
-void
-intel_modeset_setup_hw_state(struct drm_device *dev,
+void intel_modeset_setup_hw_state(struct drm_device *dev,
bool force_restore)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -9972,8 +9453,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
drm_mode_config_reset(dev);
}
-void
-intel_modeset_gem_init(struct drm_device *dev)
+void intel_modeset_gem_init(struct drm_device *dev)
{
intel_modeset_init_hw(dev);
@@ -9982,8 +9462,7 @@ intel_modeset_gem_init(struct drm_device *dev)
intel_modeset_setup_hw_state(dev, false);
}
-void
-intel_modeset_cleanup(struct drm_device *dev)
+void intel_modeset_cleanup(struct drm_device *dev)
{
// struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc;
@@ -10039,14 +9518,12 @@ intel_modeset_cleanup(struct drm_device *dev)
/*
* Return which encoder is currently attached for connector.
*/
-struct drm_encoder *
-intel_best_encoder(struct drm_connector *connector)
+struct drm_encoder *intel_best_encoder(struct drm_connector *connector)
{
return &intel_attached_encoder(connector)->base;
}
-void
-intel_connector_attach_encoder(struct intel_connector *connector,
+void intel_connector_attach_encoder(struct intel_connector *connector,
struct intel_encoder *encoder)
{
connector->encoder = encoder;
@@ -10057,8 +9534,7 @@ intel_connector_attach_encoder(struct intel_connector *connector,
/*
* set vga decode state - true == enable VGA decode
*/
-int
-intel_modeset_vga_set_state(struct drm_device *dev, bool state)
+int intel_modeset_vga_set_state(struct drm_device *dev, bool state)
{
printf("%s stub\n", __func__);
return EINVAL;
diff --git a/sys/dev/pci/drm/i915/intel_dp.c b/sys/dev/pci/drm/i915/intel_dp.c
index fe5587bd96f..ba29465bbeb 100644
--- a/sys/dev/pci/drm/i915/intel_dp.c
+++ b/sys/dev/pci/drm/i915/intel_dp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_dp.c,v 1.7 2013/07/08 09:47:45 jsg Exp $ */
+/* $OpenBSD: intel_dp.c,v 1.8 2013/08/13 10:23:51 jsg Exp $ */
/*
* Copyright © 2008 Intel Corporation
*
@@ -36,126 +36,6 @@
#define DP_LINK_CHECK_TIMEOUT (10 * 1000)
-struct intel_dp_m_n {
- uint32_t tu;
- uint32_t gmch_m;
- uint32_t gmch_n;
- uint32_t link_m;
- uint32_t link_n;
-};
-
-bool is_edp(struct intel_dp *);
-bool is_pch_edp(struct intel_dp *);
-bool is_cpu_edp(struct intel_dp *);
-struct intel_dp *enc_to_intel_dp(struct drm_encoder *);
-struct intel_dp *intel_attached_dp(struct drm_connector *);
-int intel_dp_max_lane_count(struct intel_dp *);
-int intel_dp_max_link_bw(struct intel_dp *);
-int intel_dp_link_clock(uint8_t);
-int intel_dp_link_required(int, int);
-int intel_dp_max_data_rate(int, int);
-bool intel_dp_adjust_dithering(struct intel_dp *,
- struct drm_display_mode *, bool);
-int intel_dp_mode_valid(struct drm_connector *, struct drm_display_mode *);
-uint32_t pack_aux(uint8_t *, int);
-void unpack_aux(uint32_t, uint8_t *, int);
-int intel_hrawclk(struct drm_device *);
-bool ironlake_edp_have_panel_power(struct intel_dp *);
-bool ironlake_edp_have_panel_vdd(struct intel_dp *);
-void intel_dp_check_edp(struct intel_dp *);
-int intel_dp_aux_ch(struct intel_dp *, uint8_t *, int, uint8_t *, int);
-int intel_dp_aux_native_write(struct intel_dp *, uint16_t, uint8_t *,
- int);
-int intel_dp_aux_native_write_1(struct intel_dp *, uint16_t, uint8_t);
-int intel_dp_aux_native_read(struct intel_dp *, uint16_t, uint8_t *, int);
-int intel_dp_i2c_init(struct intel_dp *, struct intel_connector *,
- const char *);
-bool intel_dp_mode_fixup(struct drm_encoder *, const struct drm_display_mode *,
- struct drm_display_mode *);
-void intel_reduce_ratio(uint32_t *, uint32_t *);
-void intel_dp_compute_m_n(int, int, int, int, struct intel_dp_m_n *);
-void intel_dp_set_m_n(struct drm_crtc *, struct drm_display_mode *,
- struct drm_display_mode *);
-void intel_dp_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-void ironlake_wait_panel_status(struct intel_dp *, u32, u32);
-void ironlake_wait_panel_on(struct intel_dp *);
-void ironlake_wait_panel_off(struct intel_dp *);
-void ironlake_wait_panel_power_cycle(struct intel_dp *);
-u32 ironlake_get_pp_control(struct drm_i915_private *);
-void ironlake_edp_panel_vdd_on(struct intel_dp *);
-void ironlake_panel_vdd_off_sync(struct intel_dp *);
-void ironlake_edp_panel_vdd_off(struct intel_dp *, bool);
-void ironlake_edp_panel_on(struct intel_dp *);
-void ironlake_edp_panel_off(struct intel_dp *);
-void ironlake_edp_backlight_on(struct intel_dp *);
-void ironlake_edp_backlight_off(struct intel_dp *);
-void ironlake_edp_pll_on(struct intel_dp *);
-void ironlake_edp_pll_off(struct intel_dp *);
-void intel_dp_sink_dpms(struct intel_dp *, int);
-void intel_dp_prepare(struct drm_encoder *);
-void intel_dp_commit(struct drm_encoder *);
-void intel_dp_start_link_train(struct intel_dp *);
-void intel_dp_complete_link_train(struct intel_dp *);
-void intel_dp_dpms(struct drm_encoder *, int);
-bool intel_dp_aux_native_read_retry(struct intel_dp *, uint16_t, uint8_t *,
- int);
-bool intel_dp_get_link_status(struct intel_dp *,
- uint8_t link_status[DP_LINK_STATUS_SIZE]);
-uint8_t intel_dp_link_status(uint8_t link_status[DP_LINK_STATUS_SIZE], int);
-uint8_t intel_get_adjust_request_voltage(uint8_t adjust_request[2], int);
-uint8_t intel_get_adjust_request_pre_emphasis(uint8_t adjust_request[2], int);
-uint8_t intel_dp_voltage_max(struct intel_dp *);
-uint8_t intel_dp_pre_emphasis_max(struct intel_dp *, uint8_t);
-void intel_get_adjust_train(struct intel_dp *,
- uint8_t link_status[DP_LINK_STATUS_SIZE]);
-uint32_t intel_dp_signal_levels(uint8_t);
-uint32_t intel_gen6_edp_signal_levels(uint8_t);
-uint32_t intel_gen7_edp_signal_levels(uint8_t);
-uint8_t intel_get_lane_status(uint8_t link_status[DP_LINK_STATUS_SIZE], int);
-bool intel_clock_recovery_ok(uint8_t link_status[DP_LINK_STATUS_SIZE], int);
-bool intel_channel_eq_ok(struct intel_dp *,
- uint8_t link_status[DP_LINK_STATUS_SIZE]);
-bool intel_dp_set_link_train(struct intel_dp *, uint32_t, uint8_t);
-void intel_dp_start_link_train(struct intel_dp *);
-void intel_dp_complete_link_train(struct intel_dp *);
-void intel_dp_link_down(struct intel_dp *);
-bool intel_dp_get_dpcd(struct intel_dp *);
-bool intel_dp_get_sink_irq(struct intel_dp *, u8 *);
-void intel_dp_handle_test_request(struct intel_dp *);
-void intel_dp_check_link_status(struct intel_dp *);
-enum drm_connector_status intel_dp_detect_dpcd(struct intel_dp *);
-enum drm_connector_status ironlake_dp_detect(struct intel_dp *);
-enum drm_connector_status g4x_dp_detect(struct intel_dp *);
-struct edid *intel_dp_get_edid(struct drm_connector *,
- struct i2c_controller *);
-int intel_dp_get_edid_modes(struct drm_connector *,
- struct i2c_controller *);
-enum drm_connector_status intel_dp_detect(struct drm_connector *, bool);
-int intel_dp_get_modes(struct drm_connector *);
-bool intel_dp_detect_audio(struct drm_connector *);
-int intel_dp_set_property(struct drm_connector *, struct drm_property *,
- uint64_t);
-void intel_dp_destroy(struct drm_connector *);
-void intel_dp_encoder_destroy(struct drm_encoder *);
-void intel_dp_hot_plug(struct intel_encoder *);
-void intel_dp_add_properties(struct intel_dp *, struct drm_connector *);
-struct drm_device *intel_dp_to_dev(struct intel_dp *);
-bool intel_dp_get_hw_state(struct intel_encoder *, enum pipe *);
-void intel_disable_dp(struct intel_encoder *);
-void intel_post_disable_dp(struct intel_encoder *);
-void intel_enable_dp(struct intel_encoder *);
-void intel_pre_enable_dp(struct intel_encoder *);
-uint32_t intel_dp_signal_levels_hsw(uint8_t);
-void intel_dp_probe_oui(struct intel_dp *);
-void intel_dp_init_panel_power_sequencer(struct drm_device *,
- struct intel_dp *, struct edp_power_seq *);
-void intel_dp_init_panel_power_sequencer_registers(struct drm_device *,
- struct intel_dp *, struct edp_power_seq *);
-void ironlake_panel_vdd_tick(void *);
-void ironlake_panel_vdd_work(void *, void *);
-int intel_dp_i2c_aux_ch(struct i2c_controller *, int, uint8_t, uint8_t *);
-
/**
* is_edp - is the given port attached to an eDP panel (either CPU or PCH)
* @intel_dp: DP struct
@@ -163,8 +43,7 @@ int intel_dp_i2c_aux_ch(struct i2c_controller *, int, uint8_t, uint8_t *);
* If a CPU or PCH DP output is attached to an eDP panel, this function
* will return true, and false otherwise.
*/
-bool
-is_edp(struct intel_dp *intel_dp)
+static bool is_edp(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
@@ -179,8 +58,7 @@ is_edp(struct intel_dp *intel_dp)
* to an eDP panel, false otherwise. Helpful for determining whether we
* may need FDI resources for a given DP output or not.
*/
-bool
-is_pch_edp(struct intel_dp *intel_dp)
+static bool is_pch_edp(struct intel_dp *intel_dp)
{
return intel_dp->is_pch_edp;
}
@@ -191,22 +69,19 @@ is_pch_edp(struct intel_dp *intel_dp)
*
* Returns true if the given DP struct corresponds to a CPU eDP port.
*/
-bool
-is_cpu_edp(struct intel_dp *intel_dp)
+static bool is_cpu_edp(struct intel_dp *intel_dp)
{
return is_edp(intel_dp) && !is_pch_edp(intel_dp);
}
-struct drm_device *
-intel_dp_to_dev(struct intel_dp *intel_dp)
+static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
return intel_dig_port->base.base.dev;
}
-struct intel_dp *
-intel_attached_dp(struct drm_connector *connector)
+static struct intel_dp *intel_attached_dp(struct drm_connector *connector)
{
return enc_to_intel_dp(&intel_attached_encoder(connector)->base);
}
@@ -218,8 +93,7 @@ intel_attached_dp(struct drm_connector *connector)
* Return true if @encoder corresponds to a PCH attached eDP panel. Needed
* by intel_display.c.
*/
-bool
-intel_encoder_is_pch_edp(struct drm_encoder *encoder)
+bool intel_encoder_is_pch_edp(struct drm_encoder *encoder)
{
struct intel_dp *intel_dp;
@@ -231,6 +105,8 @@ intel_encoder_is_pch_edp(struct drm_encoder *encoder)
return is_pch_edp(intel_dp);
}
+static void intel_dp_link_down(struct intel_dp *intel_dp);
+
void
intel_edp_link_config(struct intel_encoder *intel_encoder,
int *lane_num, int *link_bw)
@@ -254,7 +130,7 @@ intel_edp_target_clock(struct intel_encoder *intel_encoder,
return mode->clock;
}
-int
+static int
intel_dp_max_link_bw(struct intel_dp *intel_dp)
{
int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
@@ -270,7 +146,7 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
return max_link_bw;
}
-int
+static int
intel_dp_link_clock(uint8_t link_bw)
{
if (link_bw == DP_LINK_BW_2_7)
@@ -296,19 +172,19 @@ intel_dp_link_clock(uint8_t link_bw)
* get the result in decakilobits instead of kilobits.
*/
-int
+static int
intel_dp_link_required(int pixel_clock, int bpp)
{
return (pixel_clock * bpp + 9) / 10;
}
-int
+static int
intel_dp_max_data_rate(int max_link_clock, int max_lanes)
{
return (max_link_clock * max_lanes * 8) / 10;
}
-bool
+static bool
intel_dp_adjust_dithering(struct intel_dp *intel_dp,
struct drm_display_mode *mode,
bool adjust_mode)
@@ -335,7 +211,7 @@ intel_dp_adjust_dithering(struct intel_dp *intel_dp,
return true;
}
-int
+static int
intel_dp_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
@@ -363,7 +239,7 @@ intel_dp_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
-uint32_t
+static uint32_t
pack_aux(uint8_t *src, int src_bytes)
{
int i;
@@ -376,7 +252,7 @@ pack_aux(uint8_t *src, int src_bytes)
return v;
}
-void
+static void
unpack_aux(uint32_t src, uint8_t *dst, int dst_bytes)
{
int i;
@@ -387,7 +263,7 @@ unpack_aux(uint32_t src, uint8_t *dst, int dst_bytes)
}
/* hrawclock is 1/4 the FSB frequency */
-int
+static int
intel_hrawclk(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -420,8 +296,7 @@ intel_hrawclk(struct drm_device *dev)
}
}
-bool
-ironlake_edp_have_panel_power(struct intel_dp *intel_dp)
+static bool ironlake_edp_have_panel_power(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -429,8 +304,7 @@ ironlake_edp_have_panel_power(struct intel_dp *intel_dp)
return (I915_READ(PCH_PP_STATUS) & PP_ON) != 0;
}
-bool
-ironlake_edp_have_panel_vdd(struct intel_dp *intel_dp)
+static bool ironlake_edp_have_panel_vdd(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -438,7 +312,7 @@ ironlake_edp_have_panel_vdd(struct intel_dp *intel_dp)
return (I915_READ(PCH_PP_CONTROL) & EDP_FORCE_VDD) != 0;
}
-void
+static void
intel_dp_check_edp(struct intel_dp *intel_dp)
{
#ifdef DRMDEBUG
@@ -456,7 +330,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp)
}
}
-int
+static int
intel_dp_aux_ch(struct intel_dp *intel_dp,
uint8_t *send, int send_bytes,
uint8_t *recv, int recv_size)
@@ -609,7 +483,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
}
/* Write data to the aux channel in native mode */
-int
+static int
intel_dp_aux_native_write(struct intel_dp *intel_dp,
uint16_t address, uint8_t *send, int send_bytes)
{
@@ -642,7 +516,7 @@ intel_dp_aux_native_write(struct intel_dp *intel_dp,
}
/* Write a single byte to the aux channel in native mode */
-int
+static int
intel_dp_aux_native_write_1(struct intel_dp *intel_dp,
uint16_t address, uint8_t byte)
{
@@ -650,7 +524,7 @@ intel_dp_aux_native_write_1(struct intel_dp *intel_dp,
}
/* read bytes from a native aux channel */
-int
+static int
intel_dp_aux_native_read(struct intel_dp *intel_dp,
uint16_t address, uint8_t *recv, int recv_bytes)
{
@@ -689,7 +563,7 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
}
}
-int
+static int
intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
uint8_t write_byte, uint8_t *read_byte)
{
@@ -786,7 +660,7 @@ intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
return -EIO;
}
-int
+static int
intel_dp_i2c_init(struct intel_dp *intel_dp,
struct intel_connector *intel_connector, const char *name)
{
@@ -873,7 +747,15 @@ intel_dp_mode_fixup(struct drm_encoder *encoder,
return false;
}
-void
+struct intel_dp_m_n {
+ uint32_t tu;
+ uint32_t gmch_m;
+ uint32_t gmch_n;
+ uint32_t link_m;
+ uint32_t link_n;
+};
+
+static void
intel_reduce_ratio(uint32_t *num, uint32_t *den)
{
while (*num > 0xffffff || *den > 0xffffff) {
@@ -882,7 +764,7 @@ intel_reduce_ratio(uint32_t *num, uint32_t *den)
}
}
-void
+static void
intel_dp_compute_m_n(int bpp,
int nlanes,
int pixel_clock,
@@ -969,8 +851,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
}
}
-void
-intel_dp_init_link_config(struct intel_dp *intel_dp)
+void intel_dp_init_link_config(struct intel_dp *intel_dp)
{
memset(intel_dp->link_configuration, 0, DP_LINK_CONFIGURATION_SIZE);
intel_dp->link_configuration[0] = intel_dp->link_bw;
@@ -985,7 +866,7 @@ intel_dp_init_link_config(struct intel_dp *intel_dp)
}
}
-void
+static void
intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -1095,8 +976,7 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
#define IDLE_CYCLE_MASK (PP_ON | 0 | PP_SEQUENCE_MASK | PP_CYCLE_DELAY_ACTIVE | PP_SEQUENCE_STATE_MASK)
#define IDLE_CYCLE_VALUE (0 | 0 | PP_SEQUENCE_NONE | 0 | PP_SEQUENCE_STATE_OFF_IDLE)
-void
-ironlake_wait_panel_status(struct intel_dp *intel_dp,
+static void ironlake_wait_panel_status(struct intel_dp *intel_dp,
u32 mask,
u32 value)
{
@@ -1120,22 +1000,19 @@ ironlake_wait_panel_status(struct intel_dp *intel_dp,
I915_READ(PCH_PP_CONTROL));
}
-void
-ironlake_wait_panel_on(struct intel_dp *intel_dp)
+static void ironlake_wait_panel_on(struct intel_dp *intel_dp)
{
DRM_DEBUG_KMS("Wait for panel power on\n");
ironlake_wait_panel_status(intel_dp, IDLE_ON_MASK, IDLE_ON_VALUE);
}
-void
-ironlake_wait_panel_off(struct intel_dp *intel_dp)
+static void ironlake_wait_panel_off(struct intel_dp *intel_dp)
{
DRM_DEBUG_KMS("Wait for panel power off time\n");
ironlake_wait_panel_status(intel_dp, IDLE_OFF_MASK, IDLE_OFF_VALUE);
}
-void
-ironlake_wait_panel_power_cycle(struct intel_dp *intel_dp)
+static void ironlake_wait_panel_power_cycle(struct intel_dp *intel_dp)
{
DRM_DEBUG_KMS("Wait for panel power cycle\n");
ironlake_wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
@@ -1146,8 +1023,7 @@ ironlake_wait_panel_power_cycle(struct intel_dp *intel_dp)
* is locked
*/
-u32
-ironlake_get_pp_control(struct drm_i915_private *dev_priv)
+static u32 ironlake_get_pp_control(struct drm_i915_private *dev_priv)
{
u32 control = I915_READ(PCH_PP_CONTROL);
@@ -1156,8 +1032,7 @@ ironlake_get_pp_control(struct drm_i915_private *dev_priv)
return control;
}
-void
-ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
+void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1196,8 +1071,7 @@ ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
}
}
-void
-ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp)
+static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1217,17 +1091,7 @@ ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp)
}
}
-void
-ironlake_panel_vdd_tick(void *arg)
-{
- struct intel_dp *intel_dp = arg;
-
- workq_queue_task(NULL, &intel_dp->panel_vdd_task, 0,
- ironlake_panel_vdd_work, intel_dp, NULL);
-}
-
-void
-ironlake_panel_vdd_work(void *arg1, void *arg2)
+static void ironlake_panel_vdd_work(void *arg1, void *arg2)
{
struct intel_dp *intel_dp = arg1;
struct drm_device *dev = intel_dp_to_dev(intel_dp);
@@ -1237,8 +1101,16 @@ ironlake_panel_vdd_work(void *arg1, void *arg2)
rw_exit_write(&dev->mode_config.rwl);
}
-void
-ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
+static void
+ironlake_panel_vdd_tick(void *arg)
+{
+ struct intel_dp *intel_dp = arg;
+
+ workq_queue_task(NULL, &intel_dp->panel_vdd_task, 0,
+ ironlake_panel_vdd_work, intel_dp, NULL);
+}
+
+void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
{
if (!is_edp(intel_dp))
return;
@@ -1260,8 +1132,7 @@ ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
}
}
-void
-ironlake_edp_panel_on(struct intel_dp *intel_dp)
+void ironlake_edp_panel_on(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1303,8 +1174,7 @@ ironlake_edp_panel_on(struct intel_dp *intel_dp)
}
}
-void
-ironlake_edp_panel_off(struct intel_dp *intel_dp)
+void ironlake_edp_panel_off(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1329,8 +1199,7 @@ ironlake_edp_panel_off(struct intel_dp *intel_dp)
ironlake_wait_panel_off(intel_dp);
}
-void
-ironlake_edp_backlight_on(struct intel_dp *intel_dp)
+void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct drm_device *dev = intel_dig_port->base.base.dev;
@@ -1357,8 +1226,7 @@ ironlake_edp_backlight_on(struct intel_dp *intel_dp)
intel_panel_enable_backlight(dev, pipe);
}
-void
-ironlake_edp_backlight_off(struct intel_dp *intel_dp)
+void ironlake_edp_backlight_off(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1377,8 +1245,7 @@ ironlake_edp_backlight_off(struct intel_dp *intel_dp)
drm_msleep(intel_dp->backlight_off_delay, "915bo1");
}
-void
-ironlake_edp_pll_on(struct intel_dp *intel_dp)
+static void ironlake_edp_pll_on(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct drm_crtc *crtc = intel_dig_port->base.base.crtc;
@@ -1404,8 +1271,7 @@ ironlake_edp_pll_on(struct intel_dp *intel_dp)
udelay(200);
}
-void
-ironlake_edp_pll_off(struct intel_dp *intel_dp)
+static void ironlake_edp_pll_off(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct drm_crtc *crtc = intel_dig_port->base.base.crtc;
@@ -1431,8 +1297,7 @@ ironlake_edp_pll_off(struct intel_dp *intel_dp)
}
/* If the sink supports it, try to set the power state appropriately */
-void
-intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
+void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
{
int ret, i;
@@ -1461,8 +1326,7 @@ intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
}
}
-bool
-intel_dp_get_hw_state(struct intel_encoder *encoder,
+static bool intel_dp_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
@@ -1511,8 +1375,7 @@ intel_dp_get_hw_state(struct intel_encoder *encoder,
return true;
}
-void
-intel_disable_dp(struct intel_encoder *encoder)
+static void intel_disable_dp(struct intel_encoder *encoder)
{
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
@@ -1528,8 +1391,7 @@ intel_disable_dp(struct intel_encoder *encoder)
intel_dp_link_down(intel_dp);
}
-void
-intel_post_disable_dp(struct intel_encoder *encoder)
+static void intel_post_disable_dp(struct intel_encoder *encoder)
{
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
@@ -1539,8 +1401,7 @@ intel_post_disable_dp(struct intel_encoder *encoder)
}
}
-void
-intel_enable_dp(struct intel_encoder *encoder)
+static void intel_enable_dp(struct intel_encoder *encoder)
{
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
struct drm_device *dev = encoder->base.dev;
@@ -1559,8 +1420,7 @@ intel_enable_dp(struct intel_encoder *encoder)
ironlake_edp_backlight_on(intel_dp);
}
-void
-intel_pre_enable_dp(struct intel_encoder *encoder)
+static void intel_pre_enable_dp(struct intel_encoder *encoder)
{
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
@@ -1572,7 +1432,7 @@ intel_pre_enable_dp(struct intel_encoder *encoder)
* Native read with retry for link status and receiver capability reads for
* cases where the sink may still be asleep.
*/
-bool
+static bool
intel_dp_aux_native_read_retry(struct intel_dp *intel_dp, uint16_t address,
uint8_t *recv, int recv_bytes)
{
@@ -1597,7 +1457,7 @@ intel_dp_aux_native_read_retry(struct intel_dp *intel_dp, uint16_t address,
* Fetch AUX CH registers 0x202 - 0x207 which contain
* link status information
*/
-bool
+static bool
intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE])
{
return intel_dp_aux_native_read_retry(intel_dp,
@@ -1623,7 +1483,7 @@ static char *link_train_names[] = {
* a maximum voltage of 800mV and a maximum pre-emphasis of 6dB
*/
-uint8_t
+static uint8_t
intel_dp_voltage_max(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
@@ -1636,7 +1496,7 @@ intel_dp_voltage_max(struct intel_dp *intel_dp)
return DP_TRAIN_VOLTAGE_SWING_800;
}
-uint8_t
+static uint8_t
intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, uint8_t voltage_swing)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
@@ -1678,7 +1538,7 @@ intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, uint8_t voltage_swing)
}
}
-void
+static void
intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE])
{
uint8_t v = 0;
@@ -1709,7 +1569,7 @@ intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_ST
intel_dp->train_set[lane] = v | p;
}
-uint32_t
+static uint32_t
intel_dp_signal_levels(uint8_t train_set)
{
uint32_t signal_levels = 0;
@@ -1748,7 +1608,7 @@ intel_dp_signal_levels(uint8_t train_set)
}
/* Gen6's DP voltage swing and pre-emphasis control */
-uint32_t
+static uint32_t
intel_gen6_edp_signal_levels(uint8_t train_set)
{
int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK |
@@ -1776,7 +1636,7 @@ intel_gen6_edp_signal_levels(uint8_t train_set)
}
/* Gen7's DP voltage swing and pre-emphasis control */
-uint32_t
+static uint32_t
intel_gen7_edp_signal_levels(uint8_t train_set)
{
int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK |
@@ -1807,7 +1667,7 @@ intel_gen7_edp_signal_levels(uint8_t train_set)
}
/* Gen7.5's (HSW) DP voltage swing and pre-emphasis control */
-uint32_t
+static uint32_t
intel_dp_signal_levels_hsw(uint8_t train_set)
{
int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK |
@@ -1840,7 +1700,7 @@ intel_dp_signal_levels_hsw(uint8_t train_set)
}
}
-bool
+static bool
intel_dp_set_link_train(struct intel_dp *intel_dp,
uint32_t dp_reg_value,
uint8_t dp_train_pat)
@@ -2131,7 +1991,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
intel_dp_set_link_train(intel_dp, DP, DP_TRAINING_PATTERN_DISABLE);
}
-void
+static void
intel_dp_link_down(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
@@ -2212,7 +2072,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
drm_msleep(intel_dp->panel_power_down_delay, "915ldo");
}
-bool
+static bool
intel_dp_get_dpcd(struct intel_dp *intel_dp)
{
if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
@@ -2237,7 +2097,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
return true;
}
-void
+static void
intel_dp_probe_oui(struct intel_dp *intel_dp)
{
u8 buf[3];
@@ -2258,7 +2118,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp)
ironlake_edp_panel_vdd_off(intel_dp, false);
}
-bool
+static bool
intel_dp_get_sink_irq(struct intel_dp *intel_dp, u8 *sink_irq_vector)
{
int ret;
@@ -2272,7 +2132,7 @@ intel_dp_get_sink_irq(struct intel_dp *intel_dp, u8 *sink_irq_vector)
return true;
}
-void
+static void
intel_dp_handle_test_request(struct intel_dp *intel_dp)
{
/* NAK by default */
@@ -2336,7 +2196,7 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
}
/* XXX this is probably wrong for multiple downstream ports */
-enum drm_connector_status
+static enum drm_connector_status
intel_dp_detect_dpcd(struct intel_dp *intel_dp)
{
uint8_t *dpcd = intel_dp->dpcd;
@@ -2375,7 +2235,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
return connector_status_disconnected;
}
-enum drm_connector_status
+static enum drm_connector_status
ironlake_dp_detect(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
@@ -2392,7 +2252,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
return intel_dp_detect_dpcd(intel_dp);
}
-enum drm_connector_status
+static enum drm_connector_status
g4x_dp_detect(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
@@ -2419,7 +2279,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
return intel_dp_detect_dpcd(intel_dp);
}
-struct edid *
+static struct edid *
intel_dp_get_edid(struct drm_connector *connector, struct i2c_controller *adapter)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
@@ -2445,7 +2305,7 @@ intel_dp_get_edid(struct drm_connector *connector, struct i2c_controller *adapte
return drm_get_edid(connector, adapter);
}
-int
+static int
intel_dp_get_edid_modes(struct drm_connector *connector, struct i2c_controller *adapter)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
@@ -2470,7 +2330,7 @@ intel_dp_get_edid_modes(struct drm_connector *connector, struct i2c_controller *
* \return true if DP port is connected.
* \return false if DP port is disconnected.
*/
-enum drm_connector_status
+static enum drm_connector_status
intel_dp_detect(struct drm_connector *connector, bool force)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
@@ -2516,8 +2376,7 @@ intel_dp_detect(struct drm_connector *connector, bool force)
return connector_status_connected;
}
-int
-intel_dp_get_modes(struct drm_connector *connector)
+static int intel_dp_get_modes(struct drm_connector *connector)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
struct intel_connector *intel_connector = to_intel_connector(connector);
@@ -2544,7 +2403,7 @@ intel_dp_get_modes(struct drm_connector *connector)
return 0;
}
-bool
+static bool
intel_dp_detect_audio(struct drm_connector *connector)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
@@ -2560,7 +2419,7 @@ intel_dp_detect_audio(struct drm_connector *connector)
return has_audio;
}
-int
+static int
intel_dp_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t val)
@@ -2632,7 +2491,7 @@ done:
return 0;
}
-void
+static void
intel_dp_destroy(struct drm_connector *connector)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
@@ -2651,8 +2510,7 @@ intel_dp_destroy(struct drm_connector *connector)
free(connector, M_DRM);
}
-void
-intel_dp_encoder_destroy(struct drm_encoder *encoder)
+void intel_dp_encoder_destroy(struct drm_encoder *encoder)
{
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
struct intel_dp *intel_dp = &intel_dig_port->dp;
@@ -2692,7 +2550,7 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {
.destroy = intel_dp_encoder_destroy,
};
-void
+static void
intel_dp_hot_plug(struct intel_encoder *intel_encoder)
{
struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
@@ -2720,8 +2578,7 @@ intel_trans_dp_port_sel(struct drm_crtc *crtc)
}
/* check the VBT to see whether the eDP is on DP-D port */
-bool
-intel_dpd_is_edp(struct drm_device *dev)
+bool intel_dpd_is_edp(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct child_device_config *p_child;
@@ -2740,7 +2597,7 @@ intel_dpd_is_edp(struct drm_device *dev)
return false;
}
-void
+static void
intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
@@ -2758,7 +2615,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
}
}
-void
+static void
intel_dp_init_panel_power_sequencer(struct drm_device *dev,
struct intel_dp *intel_dp,
struct edp_power_seq *out)
@@ -2843,7 +2700,7 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,
*out = final;
}
-void
+static void
intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev,
struct intel_dp *intel_dp,
struct edp_power_seq *seq)
diff --git a/sys/dev/pci/drm/i915/intel_dvo.c b/sys/dev/pci/drm/i915/intel_dvo.c
index 16c5395e62e..5f3fa0b6076 100644
--- a/sys/dev/pci/drm/i915/intel_dvo.c
+++ b/sys/dev/pci/drm/i915/intel_dvo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_dvo.c,v 1.3 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_dvo.c,v 1.4 2013/08/13 10:23:51 jsg Exp $ */
/*
* Copyright 2006 Dave Airlie <airlied@linux.ie>
* Copyright © 2006-2007 Intel Corporation
@@ -32,24 +32,6 @@
#include "i915_drv.h"
#include "dvo.h"
-struct intel_dvo *enc_to_intel_dvo(struct drm_encoder *);
-struct intel_dvo *intel_attached_dvo(struct drm_connector *);
-bool intel_dvo_connector_get_hw_state(struct intel_connector *);
-bool intel_dvo_get_hw_state(struct intel_encoder *, enum pipe *);
-void intel_disable_dvo(struct intel_encoder *);
-void intel_enable_dvo(struct intel_encoder *);
-void intel_dvo_dpms(struct drm_connector *, int);
-int intel_dvo_mode_valid(struct drm_connector *, struct drm_display_mode *);
-bool intel_dvo_mode_fixup(struct drm_encoder *, const struct drm_display_mode *,
- struct drm_display_mode *);
-void intel_dvo_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-enum drm_connector_status intel_dvo_detect(struct drm_connector *, bool);
-int intel_dvo_get_modes(struct drm_connector *);
-void intel_dvo_destroy(struct drm_connector *);
-void intel_dvo_enc_destroy(struct drm_encoder *);
-struct drm_display_mode *intel_dvo_get_current_mode(struct drm_connector *);
-
#define SIL164_ADDR 0x38
#define CH7xxx_ADDR 0x76
#define TFP410_ADDR 0x38
@@ -110,29 +92,25 @@ struct intel_dvo {
bool panel_wants_dither;
};
-struct intel_dvo *
-enc_to_intel_dvo(struct drm_encoder *encoder)
+static struct intel_dvo *enc_to_intel_dvo(struct drm_encoder *encoder)
{
return container_of(encoder, struct intel_dvo, base.base);
}
-struct intel_dvo *
-intel_attached_dvo(struct drm_connector *connector)
+static struct intel_dvo *intel_attached_dvo(struct drm_connector *connector)
{
return container_of(intel_attached_encoder(connector),
struct intel_dvo, base);
}
-bool
-intel_dvo_connector_get_hw_state(struct intel_connector *connector)
+static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector)
{
struct intel_dvo *intel_dvo = intel_attached_dvo(&connector->base);
return intel_dvo->dev.dev_ops->get_hw_state(&intel_dvo->dev);
}
-bool
-intel_dvo_get_hw_state(struct intel_encoder *encoder,
+static bool intel_dvo_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct drm_device *dev = encoder->base.dev;
@@ -150,8 +128,7 @@ intel_dvo_get_hw_state(struct intel_encoder *encoder,
return true;
}
-void
-intel_disable_dvo(struct intel_encoder *encoder)
+static void intel_disable_dvo(struct intel_encoder *encoder)
{
struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base);
@@ -163,8 +140,7 @@ intel_disable_dvo(struct intel_encoder *encoder)
I915_READ(dvo_reg);
}
-void
-intel_enable_dvo(struct intel_encoder *encoder)
+static void intel_enable_dvo(struct intel_encoder *encoder)
{
struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base);
@@ -176,8 +152,7 @@ intel_enable_dvo(struct intel_encoder *encoder)
intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true);
}
-void
-intel_dvo_dpms(struct drm_connector *connector, int mode)
+static void intel_dvo_dpms(struct drm_connector *connector, int mode)
{
struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
struct drm_crtc *crtc;
@@ -215,8 +190,7 @@ intel_dvo_dpms(struct drm_connector *connector, int mode)
intel_modeset_check_state(connector->dev);
}
-int
-intel_dvo_mode_valid(struct drm_connector *connector,
+static int intel_dvo_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
@@ -236,8 +210,7 @@ intel_dvo_mode_valid(struct drm_connector *connector,
return intel_dvo->dev.dev_ops->mode_valid(&intel_dvo->dev, mode);
}
-bool
-intel_dvo_mode_fixup(struct drm_encoder *encoder,
+static bool intel_dvo_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -268,8 +241,7 @@ intel_dvo_mode_fixup(struct drm_encoder *encoder,
return true;
}
-void
-intel_dvo_mode_set(struct drm_encoder *encoder,
+static void intel_dvo_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -328,15 +300,14 @@ intel_dvo_mode_set(struct drm_encoder *encoder,
*
* Unimplemented.
*/
-enum drm_connector_status
+static enum drm_connector_status
intel_dvo_detect(struct drm_connector *connector, bool force)
{
struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
return intel_dvo->dev.dev_ops->detect(&intel_dvo->dev);
}
-int
-intel_dvo_get_modes(struct drm_connector *connector)
+static int intel_dvo_get_modes(struct drm_connector *connector)
{
struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
struct drm_i915_private *dev_priv = connector->dev->dev_private;
@@ -363,8 +334,7 @@ intel_dvo_get_modes(struct drm_connector *connector)
return 0;
}
-void
-intel_dvo_destroy(struct drm_connector *connector)
+static void intel_dvo_destroy(struct drm_connector *connector)
{
#if 0
drm_sysfs_connector_remove(connector);
@@ -392,8 +362,7 @@ static const struct drm_connector_helper_funcs intel_dvo_connector_helper_funcs
.best_encoder = intel_best_encoder,
};
-void
-intel_dvo_enc_destroy(struct drm_encoder *encoder)
+static void intel_dvo_enc_destroy(struct drm_encoder *encoder)
{
struct intel_dvo *intel_dvo = enc_to_intel_dvo(encoder);
@@ -415,7 +384,7 @@ static const struct drm_encoder_funcs intel_dvo_enc_funcs = {
* Other chips with DVO LVDS will need to extend this to deal with the LVDS
* chip being on DVOB/C and having multiple pipes.
*/
-struct drm_display_mode *
+static struct drm_display_mode *
intel_dvo_get_current_mode(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
@@ -447,8 +416,7 @@ intel_dvo_get_current_mode(struct drm_connector *connector)
return mode;
}
-void
-intel_dvo_init(struct drm_device *dev)
+void intel_dvo_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_encoder *intel_encoder;
diff --git a/sys/dev/pci/drm/i915/intel_fb.c b/sys/dev/pci/drm/i915/intel_fb.c
index da855015c42..e84ec3d4b78 100644
--- a/sys/dev/pci/drm/i915/intel_fb.c
+++ b/sys/dev/pci/drm/i915/intel_fb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_fb.c,v 1.5 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_fb.c,v 1.6 2013/08/13 10:23:51 jsg Exp $ */
/*
* Copyright © 2007 David Airlie
*
@@ -33,14 +33,7 @@
#include "i915_drv.h"
#include "intel_drv.h"
-int intelfb_create(struct intel_fbdev *,
- struct drm_fb_helper_surface_size *);
-int intel_fb_find_or_create_single(struct drm_fb_helper *,
- struct drm_fb_helper_surface_size *);
-void intel_fbdev_destroy(struct drm_device *, struct intel_fbdev *);
-
-int
-intelfb_create(struct intel_fbdev *ifbdev,
+static int intelfb_create(struct intel_fbdev *ifbdev,
struct drm_fb_helper_surface_size *sizes)
{
struct drm_device *dev = ifbdev->helper.dev;
@@ -200,9 +193,8 @@ out:
return ret;
}
-int
-intel_fb_find_or_create_single(struct drm_fb_helper *helper,
- struct drm_fb_helper_surface_size *sizes)
+static int intel_fb_find_or_create_single(struct drm_fb_helper *helper,
+ struct drm_fb_helper_surface_size *sizes)
{
struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper;
int new_fb = 0;
@@ -223,8 +215,8 @@ static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
.fb_probe = intel_fb_find_or_create_single,
};
-void
-intel_fbdev_destroy(struct drm_device *dev, struct intel_fbdev *ifbdev)
+static void intel_fbdev_destroy(struct drm_device *dev,
+ struct intel_fbdev *ifbdev)
{
#if 0
struct fb_info *info;
@@ -251,8 +243,7 @@ intel_fbdev_destroy(struct drm_device *dev, struct intel_fbdev *ifbdev)
}
}
-int
-intel_fbdev_init(struct drm_device *dev)
+int intel_fbdev_init(struct drm_device *dev)
{
struct intel_fbdev *ifbdev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -277,8 +268,7 @@ intel_fbdev_init(struct drm_device *dev)
return 0;
}
-void
-intel_fbdev_fini(struct drm_device *dev)
+void intel_fbdev_fini(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
if (!dev_priv->fbdev)
@@ -289,15 +279,13 @@ intel_fbdev_fini(struct drm_device *dev)
dev_priv->fbdev = NULL;
}
-void
-intel_fb_output_poll_changed(struct drm_device *dev)
+void intel_fb_output_poll_changed(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
drm_fb_helper_hotplug_event(&dev_priv->fbdev->helper);
}
-void
-intel_fb_restore_mode(struct drm_device *dev)
+void intel_fb_restore_mode(struct drm_device *dev)
{
int ret;
drm_i915_private_t *dev_priv = dev->dev_private;
diff --git a/sys/dev/pci/drm/i915/intel_hdmi.c b/sys/dev/pci/drm/i915/intel_hdmi.c
index 71e5bbfdbf5..76c99fe453b 100644
--- a/sys/dev/pci/drm/i915/intel_hdmi.c
+++ b/sys/dev/pci/drm/i915/intel_hdmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_hdmi.c,v 1.2 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_hdmi.c,v 1.3 2013/08/13 10:23:51 jsg Exp $ */
/*
* Copyright 2006 Dave Airlie <airlied@linux.ie>
* Copyright © 2006-2009 Intel Corporation
@@ -34,60 +34,12 @@
#include <dev/pci/drm/i915_drm.h>
#include "i915_drv.h"
-struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *);
-struct intel_hdmi *intel_attached_hdmi(struct drm_connector *);
-u32 intel_infoframe_index(struct dip_infoframe *);
-u32 intel_infoframe_flags(struct dip_infoframe *);
-void i9xx_write_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void ironlake_write_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void intel_set_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void intel_hdmi_set_avi_infoframe(struct drm_encoder *,
- struct drm_display_mode *);
-void intel_hdmi_set_spd_infoframe(struct drm_encoder *);
-void intel_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-void intel_hdmi_dpms(struct drm_encoder *, int);
-int intel_hdmi_mode_valid(struct drm_connector *,
- struct drm_display_mode *);
-bool intel_hdmi_mode_fixup(struct drm_encoder *, const struct drm_display_mode *,
- struct drm_display_mode *);
-enum drm_connector_status intel_hdmi_detect(struct drm_connector *,
- bool);
-int intel_hdmi_get_modes(struct drm_connector *);
-bool intel_hdmi_detect_audio(struct drm_connector *);
-int intel_hdmi_set_property(struct drm_connector *, struct drm_property *,
- uint64_t);
-void intel_hdmi_destroy(struct drm_connector *);
-void intel_hdmi_add_properties(struct intel_hdmi *, struct drm_connector *);
-struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *);
-void assert_hdmi_port_disabled(struct intel_hdmi *);
-u32 g4x_infoframe_index(struct dip_infoframe *);
-u32 g4x_infoframe_enable(struct dip_infoframe *);
-u32 hsw_infoframe_enable(struct dip_infoframe *);
-u32 hsw_infoframe_data_reg(struct dip_infoframe *, enum pipe);
-void g4x_write_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void ibx_write_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void cpt_write_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void vlv_write_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void hsw_write_infoframe(struct drm_encoder *, struct dip_infoframe *);
-void g4x_set_infoframes(struct drm_encoder *, struct drm_display_mode *);
-void ibx_set_infoframes(struct drm_encoder *, struct drm_display_mode *);
-void cpt_set_infoframes(struct drm_encoder *, struct drm_display_mode *);
-void vlv_set_infoframes(struct drm_encoder *, struct drm_display_mode *);
-void hsw_set_infoframes(struct drm_encoder *, struct drm_display_mode *);
-bool intel_hdmi_get_hw_state(struct intel_encoder *, enum pipe *);
-void intel_enable_hdmi(struct intel_encoder *);
-void intel_disable_hdmi(struct intel_encoder *);
-bool g4x_hdmi_connected(struct intel_hdmi *);
-
-
-struct drm_device *
-intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
+static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
{
return hdmi_to_dig_port(intel_hdmi)->base.base.dev;
}
-void
+static void
assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi)
{
struct drm_device *dev = intel_hdmi_to_dev(intel_hdmi);
@@ -100,22 +52,19 @@ assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi)
"HDMI port enabled, expecting disabled\n");
}
-struct intel_hdmi *
-enc_to_intel_hdmi(struct drm_encoder *encoder)
+struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder)
{
struct intel_digital_port *intel_dig_port =
container_of(encoder, struct intel_digital_port, base.base);
return &intel_dig_port->hdmi;
}
-struct intel_hdmi *
-intel_attached_hdmi(struct drm_connector *connector)
+static struct intel_hdmi *intel_attached_hdmi(struct drm_connector *connector)
{
return enc_to_intel_hdmi(&intel_attached_encoder(connector)->base);
}
-void
-intel_dip_infoframe_csum(struct dip_infoframe *frame)
+void intel_dip_infoframe_csum(struct dip_infoframe *frame)
{
uint8_t *data = (uint8_t *)frame;
uint8_t sum = 0;
@@ -130,8 +79,7 @@ intel_dip_infoframe_csum(struct dip_infoframe *frame)
frame->checksum = 0x100 - sum;
}
-u32
-g4x_infoframe_index(struct dip_infoframe *frame)
+static u32 g4x_infoframe_index(struct dip_infoframe *frame)
{
switch (frame->type) {
case DIP_TYPE_AVI:
@@ -144,8 +92,7 @@ g4x_infoframe_index(struct dip_infoframe *frame)
}
}
-u32
-g4x_infoframe_enable(struct dip_infoframe *frame)
+static u32 g4x_infoframe_enable(struct dip_infoframe *frame)
{
switch (frame->type) {
case DIP_TYPE_AVI:
@@ -158,8 +105,7 @@ g4x_infoframe_enable(struct dip_infoframe *frame)
}
}
-u32
-hsw_infoframe_enable(struct dip_infoframe *frame)
+static u32 hsw_infoframe_enable(struct dip_infoframe *frame)
{
switch (frame->type) {
case DIP_TYPE_AVI:
@@ -172,8 +118,7 @@ hsw_infoframe_enable(struct dip_infoframe *frame)
}
}
-u32
-hsw_infoframe_data_reg(struct dip_infoframe *frame, enum pipe pipe)
+static u32 hsw_infoframe_data_reg(struct dip_infoframe *frame, enum pipe pipe)
{
switch (frame->type) {
case DIP_TYPE_AVI:
@@ -186,8 +131,7 @@ hsw_infoframe_data_reg(struct dip_infoframe *frame, enum pipe pipe)
}
}
-void
-g4x_write_infoframe(struct drm_encoder *encoder,
+static void g4x_write_infoframe(struct drm_encoder *encoder,
struct dip_infoframe *frame)
{
uint32_t *data = (uint32_t *)frame;
@@ -223,8 +167,7 @@ g4x_write_infoframe(struct drm_encoder *encoder,
POSTING_READ(VIDEO_DIP_CTL);
}
-void
-ibx_write_infoframe(struct drm_encoder *encoder,
+static void ibx_write_infoframe(struct drm_encoder *encoder,
struct dip_infoframe *frame)
{
uint32_t *data = (uint32_t *)frame;
@@ -262,8 +205,7 @@ ibx_write_infoframe(struct drm_encoder *encoder,
POSTING_READ(reg);
}
-void
-cpt_write_infoframe(struct drm_encoder *encoder,
+static void cpt_write_infoframe(struct drm_encoder *encoder,
struct dip_infoframe *frame)
{
uint32_t *data = (uint32_t *)frame;
@@ -304,8 +246,7 @@ cpt_write_infoframe(struct drm_encoder *encoder,
POSTING_READ(reg);
}
-void
-vlv_write_infoframe(struct drm_encoder *encoder,
+static void vlv_write_infoframe(struct drm_encoder *encoder,
struct dip_infoframe *frame)
{
uint32_t *data = (uint32_t *)frame;
@@ -343,8 +284,7 @@ vlv_write_infoframe(struct drm_encoder *encoder,
POSTING_READ(reg);
}
-void
-hsw_write_infoframe(struct drm_encoder *encoder,
+static void hsw_write_infoframe(struct drm_encoder *encoder,
struct dip_infoframe *frame)
{
uint32_t *data = (uint32_t *)frame;
@@ -377,8 +317,7 @@ hsw_write_infoframe(struct drm_encoder *encoder,
POSTING_READ(ctl_reg);
}
-void
-intel_set_infoframe(struct drm_encoder *encoder,
+static void intel_set_infoframe(struct drm_encoder *encoder,
struct dip_infoframe *frame)
{
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
@@ -387,8 +326,7 @@ intel_set_infoframe(struct drm_encoder *encoder,
intel_hdmi->write_infoframe(encoder, frame);
}
-void
-intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
+static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct dip_infoframe avi_if = {
@@ -405,8 +343,7 @@ intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
intel_set_infoframe(encoder, &avi_if);
}
-void
-intel_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
+static void intel_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
{
struct dip_infoframe spd_if;
@@ -421,8 +358,7 @@ intel_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
intel_set_infoframe(encoder, &spd_if);
}
-void
-g4x_set_infoframes(struct drm_encoder *encoder,
+static void g4x_set_infoframes(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
@@ -485,8 +421,7 @@ g4x_set_infoframes(struct drm_encoder *encoder,
intel_hdmi_set_spd_infoframe(encoder);
}
-void
-ibx_set_infoframes(struct drm_encoder *encoder,
+static void ibx_set_infoframes(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
@@ -546,8 +481,7 @@ ibx_set_infoframes(struct drm_encoder *encoder,
intel_hdmi_set_spd_infoframe(encoder);
}
-void
-cpt_set_infoframes(struct drm_encoder *encoder,
+static void cpt_set_infoframes(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
@@ -582,8 +516,7 @@ cpt_set_infoframes(struct drm_encoder *encoder,
intel_hdmi_set_spd_infoframe(encoder);
}
-void
-vlv_set_infoframes(struct drm_encoder *encoder,
+static void vlv_set_infoframes(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
@@ -617,8 +550,7 @@ vlv_set_infoframes(struct drm_encoder *encoder,
intel_hdmi_set_spd_infoframe(encoder);
}
-void
-hsw_set_infoframes(struct drm_encoder *encoder,
+static void hsw_set_infoframes(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode)
{
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
@@ -645,8 +577,7 @@ hsw_set_infoframes(struct drm_encoder *encoder,
intel_hdmi_set_spd_infoframe(encoder);
}
-void
-intel_hdmi_mode_set(struct drm_encoder *encoder,
+static void intel_hdmi_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -692,8 +623,7 @@ intel_hdmi_mode_set(struct drm_encoder *encoder,
intel_hdmi->set_infoframes(encoder, adjusted_mode);
}
-bool
-intel_hdmi_get_hw_state(struct intel_encoder *encoder,
+static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct drm_device *dev = encoder->base.dev;
@@ -714,8 +644,7 @@ intel_hdmi_get_hw_state(struct intel_encoder *encoder,
return true;
}
-void
-intel_enable_hdmi(struct intel_encoder *encoder)
+static void intel_enable_hdmi(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -761,8 +690,7 @@ intel_enable_hdmi(struct intel_encoder *encoder)
}
}
-void
-intel_disable_hdmi(struct intel_encoder *encoder)
+static void intel_disable_hdmi(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -818,8 +746,7 @@ intel_disable_hdmi(struct intel_encoder *encoder)
}
}
-int
-intel_hdmi_mode_valid(struct drm_connector *connector,
+static int intel_hdmi_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
if (mode->clock > 165000)
@@ -833,16 +760,14 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
-bool
-intel_hdmi_mode_fixup(struct drm_encoder *encoder,
+bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
return true;
}
-bool
-g4x_hdmi_connected(struct intel_hdmi *intel_hdmi)
+static bool g4x_hdmi_connected(struct intel_hdmi *intel_hdmi)
{
struct drm_device *dev = intel_hdmi_to_dev(intel_hdmi);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -863,7 +788,7 @@ g4x_hdmi_connected(struct intel_hdmi *intel_hdmi)
return I915_READ(PORT_HOTPLUG_STAT) & bit;
}
-enum drm_connector_status
+static enum drm_connector_status
intel_hdmi_detect(struct drm_connector *connector, bool force)
{
struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
@@ -904,8 +829,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
return status;
}
-int
-intel_hdmi_get_modes(struct drm_connector *connector)
+static int intel_hdmi_get_modes(struct drm_connector *connector)
{
struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
struct drm_i915_private *dev_priv = connector->dev->dev_private;
@@ -919,7 +843,7 @@ intel_hdmi_get_modes(struct drm_connector *connector)
intel_hdmi->ddc_bus));
}
-bool
+static bool
intel_hdmi_detect_audio(struct drm_connector *connector)
{
struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
@@ -939,7 +863,7 @@ intel_hdmi_detect_audio(struct drm_connector *connector)
return has_audio;
}
-int
+static int
intel_hdmi_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t val)
@@ -995,8 +919,7 @@ done:
return 0;
}
-void
-intel_hdmi_destroy(struct drm_connector *connector)
+static void intel_hdmi_destroy(struct drm_connector *connector)
{
#if 0
drm_sysfs_connector_remove(connector);
@@ -1029,15 +952,14 @@ static const struct drm_encoder_funcs intel_hdmi_enc_funcs = {
.destroy = intel_encoder_destroy,
};
-void
+static void
intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
{
intel_attach_force_audio_property(connector);
intel_attach_broadcast_rgb_property(connector);
}
-void
-intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
+void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
struct intel_connector *intel_connector)
{
struct drm_connector *connector = &intel_connector->base;
@@ -1113,8 +1035,7 @@ intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
}
}
-void
-intel_hdmi_init(struct drm_device *dev, int sdvox_reg, enum port port)
+void intel_hdmi_init(struct drm_device *dev, int sdvox_reg, enum port port)
{
struct intel_digital_port *intel_dig_port;
struct intel_encoder *intel_encoder;
diff --git a/sys/dev/pci/drm/i915/intel_lvds.c b/sys/dev/pci/drm/i915/intel_lvds.c
index 435b2d30d88..347aac80e49 100644
--- a/sys/dev/pci/drm/i915/intel_lvds.c
+++ b/sys/dev/pci/drm/i915/intel_lvds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_lvds.c,v 1.4 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_lvds.c,v 1.5 2013/08/13 10:23:51 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
* Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
@@ -54,52 +54,17 @@ struct intel_lvds_encoder {
struct intel_lvds_connector *attached_connector;
};
-struct intel_lvds *to_intel_lvds(struct drm_encoder *);
-struct intel_lvds *intel_attached_lvds(struct drm_connector *);
-void intel_enable_lvds(struct intel_encoder *);
-void intel_disable_lvds(struct intel_encoder *);
-void intel_lvds_dpms(struct drm_encoder *, int);
-int intel_lvds_mode_valid(struct drm_connector *,
- struct drm_display_mode *);
-void centre_horizontally(struct drm_display_mode *, int);
-void centre_vertically(struct drm_display_mode *, int);
-bool intel_lvds_mode_fixup(struct drm_encoder *,
- const struct drm_display_mode *, struct drm_display_mode *);
-void intel_lvds_prepare(struct drm_encoder *);
-void intel_lvds_commit(struct drm_encoder *);
-void intel_lvds_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-enum drm_connector_status intel_lvds_detect(struct drm_connector *,
- bool);
-int intel_lvds_get_modes(struct drm_connector *);
-int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *);
-void intel_lvds_destroy(struct drm_connector *);
-int intel_lvds_set_property(struct drm_connector *,
- struct drm_property *, uint64_t);
-int intel_no_lvds_dmi_callback(const struct dmi_system_id *);
-void intel_find_lvds_downclock(struct drm_device *,
- struct drm_display_mode *, struct drm_connector *);
-bool lvds_is_present_in_vbt(struct drm_device *, u8 *);
-bool intel_lvds_supported(struct drm_device *);
-struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *);
-struct intel_lvds_connector *to_lvds_connector(struct drm_connector *);
-bool intel_lvds_get_hw_state(struct intel_encoder *, enum pipe *);
-
-
-struct intel_lvds_encoder *
-to_lvds_encoder(struct drm_encoder *encoder)
+static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder)
{
return container_of(encoder, struct intel_lvds_encoder, base.base);
}
-struct intel_lvds_connector *
-to_lvds_connector(struct drm_connector *connector)
+static struct intel_lvds_connector *to_lvds_connector(struct drm_connector *connector)
{
return container_of(connector, struct intel_lvds_connector, base.base);
}
-bool
-intel_lvds_get_hw_state(struct intel_encoder *encoder,
+static bool intel_lvds_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct drm_device *dev = encoder->base.dev;
@@ -128,8 +93,7 @@ intel_lvds_get_hw_state(struct intel_encoder *encoder,
/**
* Sets the power state for the panel.
*/
-void
-intel_enable_lvds(struct intel_encoder *encoder)
+static void intel_enable_lvds(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);
@@ -179,8 +143,7 @@ intel_enable_lvds(struct intel_encoder *encoder)
intel_panel_enable_backlight(dev, intel_crtc->pipe);
}
-void
-intel_disable_lvds(struct intel_encoder *encoder)
+static void intel_disable_lvds(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);
@@ -218,8 +181,7 @@ intel_disable_lvds(struct intel_encoder *encoder)
POSTING_READ(lvds_reg);
}
-int
-intel_lvds_mode_valid(struct drm_connector *connector,
+static int intel_lvds_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
@@ -233,7 +195,7 @@ intel_lvds_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
-void
+static void
centre_horizontally(struct drm_display_mode *mode,
int width)
{
@@ -257,7 +219,7 @@ centre_horizontally(struct drm_display_mode *mode,
mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
}
-void
+static void
centre_vertically(struct drm_display_mode *mode,
int height)
{
@@ -280,8 +242,7 @@ centre_vertically(struct drm_display_mode *mode,
mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
}
-static inline u32
-panel_fitter_scaling(u32 source, u32 target)
+static inline u32 panel_fitter_scaling(u32 source, u32 target)
{
/*
* Floating point operation is not supported. So the FACTOR
@@ -294,8 +255,7 @@ panel_fitter_scaling(u32 source, u32 target)
return (FACTOR * ratio + FACTOR/2) / FACTOR;
}
-bool
-intel_lvds_mode_fixup(struct drm_encoder *encoder,
+static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -469,8 +429,7 @@ out:
return true;
}
-void
-intel_lvds_mode_set(struct drm_encoder *encoder,
+static void intel_lvds_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -488,7 +447,7 @@ intel_lvds_mode_set(struct drm_encoder *encoder,
* connected and closed means disconnected. We also send hotplug events as
* needed, using lid status notification from the input layer.
*/
-enum drm_connector_status
+static enum drm_connector_status
intel_lvds_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
@@ -504,8 +463,7 @@ intel_lvds_detect(struct drm_connector *connector, bool force)
/**
* Return the list of DDC modes if available, or the BIOS fixed mode otherwise.
*/
-int
-intel_lvds_get_modes(struct drm_connector *connector)
+static int intel_lvds_get_modes(struct drm_connector *connector)
{
struct intel_lvds_connector *lvds_connector = to_lvds_connector(connector);
struct drm_device *dev = connector->dev;
@@ -523,8 +481,7 @@ intel_lvds_get_modes(struct drm_connector *connector)
return 1;
}
-int
-intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
+static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
{
printf("Skipping forced modeset for %s\n", id->ident);
return 1;
@@ -554,8 +511,7 @@ static const struct dmi_system_id intel_no_modeset_on_lid[] = {
* - the suspend/resume paths will also set it to
* zero, since they restore the mode ("lid open").
*/
-int
-intel_lid_notify(struct notifier_block *nb, unsigned long val,
+static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
void *unused)
{
struct intel_lvds_connector *lvds_connector =
@@ -601,8 +557,7 @@ intel_lid_notify(struct notifier_block *nb, unsigned long val,
* Unregister the DDC bus for this connector then free the driver private
* structure.
*/
-void
-intel_lvds_destroy(struct drm_connector *connector)
+static void intel_lvds_destroy(struct drm_connector *connector)
{
struct intel_lvds_connector *lvds_connector =
to_lvds_connector(connector);
@@ -624,8 +579,7 @@ intel_lvds_destroy(struct drm_connector *connector)
free(connector, M_DRM);
}
-int
-intel_lvds_set_property(struct drm_connector *connector,
+static int intel_lvds_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t value)
{
@@ -684,8 +638,7 @@ static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
.destroy = intel_encoder_destroy,
};
-int
-intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
+static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
{
printf("Skipping LVDS initialization for %s\n", id->ident);
return 1;
@@ -871,8 +824,7 @@ static const struct dmi_system_id intel_no_lvds[] = {
*
* Find the reduced downclock for LVDS in EDID.
*/
-void
-intel_find_lvds_downclock(struct drm_device *dev,
+static void intel_find_lvds_downclock(struct drm_device *dev,
struct drm_display_mode *fixed_mode,
struct drm_connector *connector)
{
@@ -923,8 +875,7 @@ intel_find_lvds_downclock(struct drm_device *dev,
* If it is not present, return false.
* If no child dev is parsed from VBT, it assumes that the LVDS is present.
*/
-bool
-lvds_is_present_in_vbt(struct drm_device *dev,
+static bool lvds_is_present_in_vbt(struct drm_device *dev,
u8 *i2c_pin)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -967,8 +918,7 @@ lvds_is_present_in_vbt(struct drm_device *dev,
return false;
}
-bool
-intel_lvds_supported(struct drm_device *dev)
+static bool intel_lvds_supported(struct drm_device *dev)
{
/* With the introduction of the PCH we gained a dedicated
* LVDS presence pin, use it. */
@@ -987,8 +937,7 @@ intel_lvds_supported(struct drm_device *dev)
* Create the connector, register the LVDS DDC bus, and try to figure out what
* modes we can display on the LVDS panel (if present).
*/
-bool
-intel_lvds_init(struct drm_device *dev)
+bool intel_lvds_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_lvds_encoder *lvds_encoder;
diff --git a/sys/dev/pci/drm/i915/intel_modes.c b/sys/dev/pci/drm/i915/intel_modes.c
index 179c95a63ee..48bbd1ad79e 100644
--- a/sys/dev/pci/drm/i915/intel_modes.c
+++ b/sys/dev/pci/drm/i915/intel_modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_modes.c,v 1.2 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_modes.c,v 1.3 2013/08/13 10:23:51 jsg Exp $ */
/*
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
* Copyright (c) 2007, 2010 Intel Corporation
@@ -37,8 +37,8 @@
* @connector: DRM connector device to use
* @edid: previously read EDID information
*/
-int
-intel_connector_update_modes(struct drm_connector *connector, struct edid *edid)
+int intel_connector_update_modes(struct drm_connector *connector,
+ struct edid *edid)
{
int ret;
@@ -56,8 +56,8 @@ intel_connector_update_modes(struct drm_connector *connector, struct edid *edid)
*
* Fetch the EDID information from @connector using the DDC bus.
*/
-int
-intel_ddc_get_modes(struct drm_connector *connector, struct i2c_controller *adapter)
+int intel_ddc_get_modes(struct drm_connector *connector,
+ struct i2c_controller *adapter)
{
struct edid *edid;
int ret;
diff --git a/sys/dev/pci/drm/i915/intel_opregion.c b/sys/dev/pci/drm/i915/intel_opregion.c
index 81c8ec8e480..d33cb0cb43e 100644
--- a/sys/dev/pci/drm/i915/intel_opregion.c
+++ b/sys/dev/pci/drm/i915/intel_opregion.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_opregion.c,v 1.3 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_opregion.c,v 1.4 2013/08/13 10:23:51 jsg Exp $ */
/*
* Copyright 2008 Intel Corporation <hong.liu@intel.com>
* Copyright 2008 Red Hat <mjg@redhat.com>
@@ -148,17 +148,8 @@ struct opregion_asle {
#define ACPI_DIGITAL_OUTPUT (3<<8)
#define ACPI_LVDS_OUTPUT (4<<8)
-u32 asle_set_backlight(struct drm_device *, u32);
-u32 asle_set_als_illum(struct drm_device *, u32);
-u32 asle_set_pwm_freq(struct drm_device *, u32);
-u32 asle_set_pfit(struct drm_device *, u32);
-void intel_opregion_asle_intr(struct drm_device *);
-void intel_opregion_gse_intr(struct drm_device *);
-void intel_didl_outputs(struct drm_device *);
-
#if NACPI > 0
-u32
-asle_set_backlight(struct drm_device *dev, u32 bclp)
+static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct opregion_asle *asle = dev_priv->opregion.asle;
@@ -178,16 +169,14 @@ asle_set_backlight(struct drm_device *dev, u32 bclp)
return 0;
}
-u32
-asle_set_als_illum(struct drm_device *dev, u32 alsi)
+static u32 asle_set_als_illum(struct drm_device *dev, u32 alsi)
{
/* alsi is the current ALS reading in lux. 0 indicates below sensor
range, 0xffff indicates above sensor range. 1-0xfffe are valid */
return 0;
}
-u32
-asle_set_pwm_freq(struct drm_device *dev, u32 pfmb)
+static u32 asle_set_pwm_freq(struct drm_device *dev, u32 pfmb)
{
struct drm_i915_private *dev_priv = dev->dev_private;
if (pfmb & ASLE_PFMB_PWM_VALID) {
@@ -200,8 +189,7 @@ asle_set_pwm_freq(struct drm_device *dev, u32 pfmb)
return 0;
}
-u32
-asle_set_pfit(struct drm_device *dev, u32 pfit)
+static u32 asle_set_pfit(struct drm_device *dev, u32 pfit)
{
/* Panel fitting is currently controlled by the X code, so this is a
noop until modesetting support works fully */
@@ -210,8 +198,7 @@ asle_set_pfit(struct drm_device *dev, u32 pfit)
return 0;
}
-void
-intel_opregion_asle_intr(struct drm_device *dev)
+void intel_opregion_asle_intr(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct opregion_asle *asle = dev_priv->opregion.asle;
@@ -243,8 +230,7 @@ intel_opregion_asle_intr(struct drm_device *dev)
asle->aslc = asle_stat;
}
-void
-intel_opregion_gse_intr(struct drm_device *dev)
+void intel_opregion_gse_intr(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct opregion_asle *asle = dev_priv->opregion.asle;
@@ -287,8 +273,7 @@ intel_opregion_gse_intr(struct drm_device *dev)
#define ASLE_PFIT_EN (1<<2)
#define ASLE_PFMB_EN (1<<3)
-void
-intel_opregion_enable_asle(struct drm_device *dev)
+void intel_opregion_enable_asle(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct opregion_asle *asle = dev_priv->opregion.asle;
@@ -310,9 +295,8 @@ intel_opregion_enable_asle(struct drm_device *dev)
static struct intel_opregion *system_opregion;
#ifdef notyet
-int
-intel_opregion_video_event(struct notifier_block *nb, unsigned long val,
- void *data)
+static int intel_opregion_video_event(struct notifier_block *nb,
+ unsigned long val, void *data)
{
/* The only video events relevant to opregion are 0x80. These indicate
either a docking event, lid switch or display switch request. In
@@ -349,8 +333,7 @@ static struct notifier_block intel_opregion_notifier = {
* (version 3)
*/
-void
-intel_didl_outputs(struct drm_device *dev)
+static void intel_didl_outputs(struct drm_device *dev)
{
#ifdef notyet
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -443,8 +426,7 @@ blind_set:
#endif
}
-void
-intel_opregion_init(struct drm_device *dev)
+void intel_opregion_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_opregion *opregion = &dev_priv->opregion;
@@ -472,8 +454,7 @@ intel_opregion_init(struct drm_device *dev)
intel_opregion_enable_asle(dev);
}
-void
-intel_opregion_fini(struct drm_device *dev)
+void intel_opregion_fini(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_opregion *opregion = &dev_priv->opregion;
@@ -500,8 +481,7 @@ intel_opregion_fini(struct drm_device *dev)
}
#endif
-int
-intel_opregion_setup(struct drm_device *dev)
+int intel_opregion_setup(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_opregion *opregion = &dev_priv->opregion;
diff --git a/sys/dev/pci/drm/i915/intel_overlay.c b/sys/dev/pci/drm/i915/intel_overlay.c
index 21e4647217a..aab07b49ffa 100644
--- a/sys/dev/pci/drm/i915/intel_overlay.c
+++ b/sys/dev/pci/drm/i915/intel_overlay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_overlay.c,v 1.5 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_overlay.c,v 1.6 2013/08/13 10:23:52 jsg Exp $ */
/*
* Copyright © 2009
*
@@ -187,66 +187,7 @@ struct intel_overlay {
void (*flip_tail)(struct intel_overlay *);
};
-struct put_image_params {
- int format;
- short dst_x;
- short dst_y;
- short dst_w;
- short dst_h;
- short src_w;
- short src_scan_h;
- short src_scan_w;
- short src_h;
- short stride_Y;
- short stride_UV;
- int offset_Y;
- int offset_U;
- int offset_V;
-};
-
-struct overlay_registers *intel_overlay_map_regs(struct intel_overlay *);
-void intel_overlay_unmap_regs(struct intel_overlay *,
- struct overlay_registers *);
-void intel_overlay_off_tail(struct intel_overlay *);
-int intel_overlay_off(struct intel_overlay *);
-int intel_overlay_recover_from_interrupt(struct intel_overlay *);
-int intel_overlay_release_old_vid(struct intel_overlay *);
-int packed_depth_bytes(u32);
-int packed_width_bytes(u32, short);
-int uv_hsubsampling(u32);
-int uv_vsubsampling(u32);
-int intel_overlay_do_put_image(struct intel_overlay *,
- struct drm_i915_gem_object *, struct put_image_params *);
-int check_overlay_possible_on_crtc(struct intel_overlay *,
- struct intel_crtc *);
-void update_pfit_vscale_ratio(struct intel_overlay *);
-int check_overlay_dst(struct intel_overlay *,
- struct drm_intel_overlay_put_image *);
-int check_overlay_scaling(struct put_image_params *);
-int check_overlay_src(struct drm_device *,
- struct drm_intel_overlay_put_image *,
- struct drm_i915_gem_object *);
-int intel_panel_fitter_pipe(struct drm_device *);
-void update_reg_attrs(struct intel_overlay *, struct overlay_registers *);
-bool check_gamma_bounds(u32, u32);
-bool check_gamma5_errata(u32);
-int check_gamma(struct drm_intel_overlay_attrs *);
-void update_polyphase_filter(struct overlay_registers *);
-bool update_scaling_factors(struct intel_overlay *,
- struct overlay_registers *, struct put_image_params *);
-void update_colorkey(struct intel_overlay *, struct overlay_registers *);
-u32 overlay_cmd_reg(struct put_image_params *);
-u32 max_u32(u32, u32);
-int intel_overlay_on(struct intel_overlay *);
-u32 calc_swidthsw(struct drm_device *, u32, u32);
-int intel_overlay_continue(struct intel_overlay *, bool);
-int intel_overlay_do_wait_request(struct intel_overlay *,
- void (*)(struct intel_overlay *));
-int i830_activate_pipe_a(struct drm_device *);
-void i830_deactivate_pipe_a(struct drm_device *);
-void intel_overlay_release_old_vid_tail(struct intel_overlay *);
-
-struct overlay_registers *
+static struct overlay_registers __iomem *
intel_overlay_map_regs(struct intel_overlay *overlay)
{
// drm_i915_private_t *dev_priv = overlay->dev->dev_private;
@@ -267,9 +208,8 @@ intel_overlay_map_regs(struct intel_overlay *overlay)
return regs;
}
-void
-intel_overlay_unmap_regs(struct intel_overlay *overlay,
- struct overlay_registers *regs)
+static void intel_overlay_unmap_regs(struct intel_overlay *overlay,
+ struct overlay_registers __iomem *regs)
{
if (!OVERLAY_NEEDS_PHYSICAL(overlay->dev))
#ifdef notyet
@@ -279,8 +219,7 @@ intel_overlay_unmap_regs(struct intel_overlay *overlay,
#endif
}
-int
-intel_overlay_do_wait_request(struct intel_overlay *overlay,
+static int intel_overlay_do_wait_request(struct intel_overlay *overlay,
void (*tail)(struct intel_overlay *))
{
struct drm_device *dev = overlay->dev;
@@ -304,8 +243,7 @@ intel_overlay_do_wait_request(struct intel_overlay *overlay,
}
/* overlay needs to be disable in OCMD reg */
-int
-intel_overlay_on(struct intel_overlay *overlay)
+static int intel_overlay_on(struct intel_overlay *overlay)
{
struct drm_device *dev = overlay->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -331,8 +269,7 @@ intel_overlay_on(struct intel_overlay *overlay)
}
/* overlay needs to be enabled in OCMD reg */
-int
-intel_overlay_continue(struct intel_overlay *overlay,
+static int intel_overlay_continue(struct intel_overlay *overlay,
bool load_polyphase_filter)
{
struct drm_device *dev = overlay->dev;
@@ -363,8 +300,7 @@ intel_overlay_continue(struct intel_overlay *overlay,
return i915_add_request(ring, NULL, &overlay->last_flip_req);
}
-void
-intel_overlay_release_old_vid_tail(struct intel_overlay *overlay)
+static void intel_overlay_release_old_vid_tail(struct intel_overlay *overlay)
{
struct drm_i915_gem_object *obj = overlay->old_vid_bo;
@@ -374,8 +310,7 @@ intel_overlay_release_old_vid_tail(struct intel_overlay *overlay)
overlay->old_vid_bo = NULL;
}
-void
-intel_overlay_off_tail(struct intel_overlay *overlay)
+static void intel_overlay_off_tail(struct intel_overlay *overlay)
{
struct drm_i915_gem_object *obj = overlay->vid_bo;
@@ -392,8 +327,7 @@ intel_overlay_off_tail(struct intel_overlay *overlay)
}
/* overlay needs to be disabled in OCMD reg */
-int
-intel_overlay_off(struct intel_overlay *overlay)
+static int intel_overlay_off(struct intel_overlay *overlay)
{
struct drm_device *dev = overlay->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -436,8 +370,7 @@ intel_overlay_off(struct intel_overlay *overlay)
/* recover from an interruption due to a signal
* We have to be careful not to repeat work forever an make forward progess. */
-int
-intel_overlay_recover_from_interrupt(struct intel_overlay *overlay)
+static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay)
{
struct drm_device *dev = overlay->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -463,8 +396,7 @@ intel_overlay_recover_from_interrupt(struct intel_overlay *overlay)
* Needs to be called before the overlay register are changed
* via intel_overlay_(un)map_regs
*/
-int
-intel_overlay_release_old_vid(struct intel_overlay *overlay)
+static int intel_overlay_release_old_vid(struct intel_overlay *overlay)
{
struct drm_device *dev = overlay->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -497,8 +429,24 @@ intel_overlay_release_old_vid(struct intel_overlay *overlay)
return 0;
}
-int
-packed_depth_bytes(u32 format)
+struct put_image_params {
+ int format;
+ short dst_x;
+ short dst_y;
+ short dst_w;
+ short dst_h;
+ short src_w;
+ short src_scan_h;
+ short src_scan_w;
+ short src_h;
+ short stride_Y;
+ short stride_UV;
+ int offset_Y;
+ int offset_U;
+ int offset_V;
+};
+
+static int packed_depth_bytes(u32 format)
{
switch (format & I915_OVERLAY_DEPTH_MASK) {
case I915_OVERLAY_YUV422:
@@ -510,8 +458,7 @@ packed_depth_bytes(u32 format)
}
}
-int
-packed_width_bytes(u32 format, short width)
+static int packed_width_bytes(u32 format, short width)
{
switch (format & I915_OVERLAY_DEPTH_MASK) {
case I915_OVERLAY_YUV422:
@@ -521,8 +468,7 @@ packed_width_bytes(u32 format, short width)
}
}
-int
-uv_hsubsampling(u32 format)
+static int uv_hsubsampling(u32 format)
{
switch (format & I915_OVERLAY_DEPTH_MASK) {
case I915_OVERLAY_YUV422:
@@ -536,8 +482,7 @@ uv_hsubsampling(u32 format)
}
}
-int
-uv_vsubsampling(u32 format)
+static int uv_vsubsampling(u32 format)
{
switch (format & I915_OVERLAY_DEPTH_MASK) {
case I915_OVERLAY_YUV420:
@@ -551,8 +496,7 @@ uv_vsubsampling(u32 format)
}
}
-u32
-calc_swidthsw(struct drm_device *dev, u32 offset, u32 width)
+static u32 calc_swidthsw(struct drm_device *dev, u32 offset, u32 width)
{
u32 mask, shift, ret;
if (IS_GEN2(dev)) {
@@ -601,16 +545,14 @@ static const u16 uv_static_hcoeffs[N_HORIZ_UV_TAPS * N_PHASES] = {
0x3000, 0x0800, 0x3000
};
-void
-update_polyphase_filter(struct overlay_registers *regs)
+static void update_polyphase_filter(struct overlay_registers __iomem *regs)
{
memcpy(regs->Y_HCOEFS, y_static_hcoeffs, sizeof(y_static_hcoeffs));
memcpy(regs->UV_HCOEFS, uv_static_hcoeffs, sizeof(uv_static_hcoeffs));
}
-bool
-update_scaling_factors(struct intel_overlay *overlay,
- struct overlay_registers *regs,
+static bool update_scaling_factors(struct intel_overlay *overlay,
+ struct overlay_registers __iomem *regs,
struct put_image_params *params)
{
/* fixed point with a 12 bit shift */
@@ -666,9 +608,8 @@ update_scaling_factors(struct intel_overlay *overlay,
return scale_changed;
}
-void
-update_colorkey(struct intel_overlay *overlay,
- struct overlay_registers *regs)
+static void update_colorkey(struct intel_overlay *overlay,
+ struct overlay_registers __iomem *regs)
{
u32 key = overlay->color_key;
@@ -696,8 +637,7 @@ update_colorkey(struct intel_overlay *overlay,
}
}
-u32
-overlay_cmd_reg(struct put_image_params *params)
+static u32 overlay_cmd_reg(struct put_image_params *params)
{
u32 cmd = OCMD_ENABLE | OCMD_BUF_TYPE_FRAME | OCMD_BUFFER0;
@@ -742,14 +682,13 @@ overlay_cmd_reg(struct put_image_params *params)
return cmd;
}
-u32
+static inline u32
max_u32(u32 a, u32 b)
{
return (a > b ? a : b);
}
-int
-intel_overlay_do_put_image(struct intel_overlay *overlay,
+static int intel_overlay_do_put_image(struct intel_overlay *overlay,
struct drm_i915_gem_object *new_bo,
struct put_image_params *params)
{
@@ -860,8 +799,7 @@ out_unpin:
return ret;
}
-int
-intel_overlay_switch_off(struct intel_overlay *overlay)
+int intel_overlay_switch_off(struct intel_overlay *overlay)
{
struct overlay_registers *regs;
struct drm_device *dev = overlay->dev;
@@ -895,8 +833,7 @@ intel_overlay_switch_off(struct intel_overlay *overlay)
return 0;
}
-int
-check_overlay_possible_on_crtc(struct intel_overlay *overlay,
+static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
struct intel_crtc *crtc)
{
drm_i915_private_t *dev_priv = overlay->dev->dev_private;
@@ -912,8 +849,7 @@ check_overlay_possible_on_crtc(struct intel_overlay *overlay,
return 0;
}
-void
-update_pfit_vscale_ratio(struct intel_overlay *overlay)
+static void update_pfit_vscale_ratio(struct intel_overlay *overlay)
{
struct drm_device *dev = overlay->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -937,8 +873,7 @@ update_pfit_vscale_ratio(struct intel_overlay *overlay)
overlay->pfit_vscale_ratio = ratio;
}
-int
-check_overlay_dst(struct intel_overlay *overlay,
+static int check_overlay_dst(struct intel_overlay *overlay,
struct drm_intel_overlay_put_image *rec)
{
struct drm_display_mode *mode = &overlay->crtc->base.mode;
@@ -952,8 +887,7 @@ check_overlay_dst(struct intel_overlay *overlay,
return -EINVAL;
}
-int
-check_overlay_scaling(struct put_image_params *rec)
+static int check_overlay_scaling(struct put_image_params *rec)
{
u32 tmp;
@@ -968,8 +902,7 @@ check_overlay_scaling(struct put_image_params *rec)
return 0;
}
-int
-check_overlay_src(struct drm_device *dev,
+static int check_overlay_src(struct drm_device *dev,
struct drm_intel_overlay_put_image *rec,
struct drm_i915_gem_object *new_bo)
{
@@ -1084,8 +1017,7 @@ check_overlay_src(struct drm_device *dev,
* Return the pipe currently connected to the panel fitter,
* or -1 if the panel fitter is not present or not in use
*/
-int
-intel_panel_fitter_pipe(struct drm_device *dev)
+static int intel_panel_fitter_pipe(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 pfit_control;
@@ -1108,8 +1040,7 @@ intel_panel_fitter_pipe(struct drm_device *dev)
return 1;
}
-int
-intel_overlay_put_image(struct drm_device *dev, void *data,
+int intel_overlay_put_image(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_intel_overlay_put_image *put_image_rec = data;
@@ -1258,16 +1189,14 @@ out_free:
return ret;
}
-void
-update_reg_attrs(struct intel_overlay *overlay,
- struct overlay_registers *regs)
+static void update_reg_attrs(struct intel_overlay *overlay,
+ struct overlay_registers __iomem *regs)
{
regs->OCLRC0 = (overlay->contrast << 18) | (overlay->brightness & 0xff);
regs->OCLRC1 = overlay->saturation;
}
-bool
-check_gamma_bounds(u32 gamma1, u32 gamma2)
+static bool check_gamma_bounds(u32 gamma1, u32 gamma2)
{
int i;
@@ -1282,8 +1211,7 @@ check_gamma_bounds(u32 gamma1, u32 gamma2)
return true;
}
-bool
-check_gamma5_errata(u32 gamma5)
+static bool check_gamma5_errata(u32 gamma5)
{
int i;
@@ -1295,8 +1223,7 @@ check_gamma5_errata(u32 gamma5)
return true;
}
-int
-check_gamma(struct drm_intel_overlay_attrs *attrs)
+static int check_gamma(struct drm_intel_overlay_attrs *attrs)
{
if (!check_gamma_bounds(0, attrs->gamma0) ||
!check_gamma_bounds(attrs->gamma0, attrs->gamma1) ||
@@ -1313,8 +1240,7 @@ check_gamma(struct drm_intel_overlay_attrs *attrs)
return 0;
}
-int
-intel_overlay_attrs(struct drm_device *dev, void *data,
+int intel_overlay_attrs(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_intel_overlay_attrs *attrs = data;
@@ -1401,8 +1327,7 @@ out_unlock:
return ret;
}
-void
-intel_setup_overlay(struct drm_device *dev)
+void intel_setup_overlay(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_overlay *overlay;
@@ -1485,8 +1410,7 @@ out_free:
return;
}
-void
-intel_cleanup_overlay(struct drm_device *dev)
+void intel_cleanup_overlay(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -1512,7 +1436,7 @@ struct intel_overlay_error_state {
u32 isr;
};
-struct overlay_registers *
+static struct overlay_registers __iomem *
intel_overlay_map_regs_atomic(struct intel_overlay *overlay)
{
drm_i915_private_t *dev_priv = overlay->dev->dev_private;
@@ -1530,9 +1454,8 @@ intel_overlay_map_regs_atomic(struct intel_overlay *overlay)
return regs;
}
-void
-intel_overlay_unmap_regs_atomic(struct intel_overlay *overlay,
- struct overlay_registers *regs)
+static void intel_overlay_unmap_regs_atomic(struct intel_overlay *overlay,
+ struct overlay_registers __iomem *regs)
{
if (!OVERLAY_NEEDS_PHYSICAL(overlay->dev))
io_mapping_unmap_atomic(regs);
diff --git a/sys/dev/pci/drm/i915/intel_panel.c b/sys/dev/pci/drm/i915/intel_panel.c
index 7474162436b..191fe4a5802 100644
--- a/sys/dev/pci/drm/i915/intel_panel.c
+++ b/sys/dev/pci/drm/i915/intel_panel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_panel.c,v 1.3 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_panel.c,v 1.4 2013/08/13 10:23:52 jsg Exp $ */
/*
* Copyright © 2006-2010 Intel Corporation
* Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
@@ -36,14 +36,7 @@
#define PCI_LBPC 0xf4 /* legacy/combination backlight modes */
-int is_backlight_combination_mode(struct drm_device *);
-u32 i915_read_blc_pwm_ctl(struct drm_device *);
-void intel_pch_panel_set_backlight(struct drm_device *, u32);
-void intel_panel_actually_set_backlight(struct drm_device *, u32);
-void intel_panel_init_backlight(struct drm_device *);
-u32 _intel_panel_get_max_backlight(struct drm_device *);
-u32 intel_panel_compute_brightness(struct drm_device *, u32);
-u32 intel_panel_get_backlight(struct drm_device *);
+u32 _intel_panel_get_max_backlight(struct drm_device *dev);
void
intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
@@ -127,8 +120,7 @@ done:
dev_priv->pch_pf_size = (width << 16) | height;
}
-int
-is_backlight_combination_mode(struct drm_device *dev)
+static int is_backlight_combination_mode(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -141,8 +133,7 @@ is_backlight_combination_mode(struct drm_device *dev)
return 0;
}
-u32
-i915_read_blc_pwm_ctl(struct drm_device *dev)
+static u32 i915_read_blc_pwm_ctl(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 val;
@@ -176,8 +167,7 @@ i915_read_blc_pwm_ctl(struct drm_device *dev)
return val;
}
-u32
-_intel_panel_get_max_backlight(struct drm_device *dev)
+u32 _intel_panel_get_max_backlight(struct drm_device *dev)
{
u32 max;
@@ -198,8 +188,7 @@ _intel_panel_get_max_backlight(struct drm_device *dev)
return max;
}
-u32
-intel_panel_get_max_backlight(struct drm_device *dev)
+u32 intel_panel_get_max_backlight(struct drm_device *dev)
{
u32 max;
@@ -225,8 +214,7 @@ static int i915_panel_invert_brightness;
"to dri-devel@lists.freedesktop.org, if your machine needs it. "
"It will then be included in an upcoming module version.");
*/
-u32
-intel_panel_compute_brightness(struct drm_device *dev, u32 val)
+static u32 intel_panel_compute_brightness(struct drm_device *dev, u32 val)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -240,8 +228,7 @@ intel_panel_compute_brightness(struct drm_device *dev, u32 val)
return val;
}
-u32
-intel_panel_get_backlight(struct drm_device *dev)
+static u32 intel_panel_get_backlight(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 val;
@@ -267,16 +254,14 @@ intel_panel_get_backlight(struct drm_device *dev)
return val;
}
-void
-intel_pch_panel_set_backlight(struct drm_device *dev, u32 level)
+static void intel_pch_panel_set_backlight(struct drm_device *dev, u32 level)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 val = I915_READ(BLC_PWM_CPU_CTL) & ~BACKLIGHT_DUTY_CYCLE_MASK;
I915_WRITE(BLC_PWM_CPU_CTL, val | level);
}
-void
-intel_panel_actually_set_backlight(struct drm_device *dev, u32 level)
+static void intel_panel_actually_set_backlight(struct drm_device *dev, u32 level)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 tmp;
@@ -303,8 +288,7 @@ intel_panel_actually_set_backlight(struct drm_device *dev, u32 level)
I915_WRITE(BLC_PWM_CTL, tmp | level);
}
-void
-intel_panel_set_backlight(struct drm_device *dev, u32 level)
+void intel_panel_set_backlight(struct drm_device *dev, u32 level)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -313,8 +297,7 @@ intel_panel_set_backlight(struct drm_device *dev, u32 level)
intel_panel_actually_set_backlight(dev, level);
}
-void
-intel_panel_disable_backlight(struct drm_device *dev)
+void intel_panel_disable_backlight(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -336,8 +319,7 @@ intel_panel_disable_backlight(struct drm_device *dev)
}
}
-void
-intel_panel_enable_backlight(struct drm_device *dev,
+void intel_panel_enable_backlight(struct drm_device *dev,
enum pipe pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -388,8 +370,7 @@ set_level:
intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
}
-void
-intel_panel_init_backlight(struct drm_device *dev)
+static void intel_panel_init_backlight(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -422,16 +403,14 @@ intel_panel_detect(struct drm_device *dev)
}
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
-int
-intel_panel_update_status(struct backlight_device *bd)
+static int intel_panel_update_status(struct backlight_device *bd)
{
struct drm_device *dev = bl_get_data(bd);
intel_panel_set_backlight(dev, bd->props.brightness);
return 0;
}
-int
-intel_panel_get_brightness(struct backlight_device *bd)
+static int intel_panel_get_brightness(struct backlight_device *bd)
{
struct drm_device *dev = bl_get_data(bd);
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -443,8 +422,7 @@ static const struct backlight_ops intel_panel_bl_ops = {
.get_brightness = intel_panel_get_brightness,
};
-int
-intel_panel_setup_backlight(struct drm_connector *connector)
+int intel_panel_setup_backlight(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -477,8 +455,7 @@ intel_panel_setup_backlight(struct drm_connector *connector)
return 0;
}
-void
-intel_panel_destroy_backlight(struct drm_device *dev)
+void intel_panel_destroy_backlight(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
if (dev_priv->backlight) {
@@ -487,22 +464,19 @@ intel_panel_destroy_backlight(struct drm_device *dev)
}
}
#else
-int
-intel_panel_setup_backlight(struct drm_connector *connector)
+int intel_panel_setup_backlight(struct drm_connector *connector)
{
intel_panel_init_backlight(connector->dev);
return 0;
}
-void
-intel_panel_destroy_backlight(struct drm_device *dev)
+void intel_panel_destroy_backlight(struct drm_device *dev)
{
return;
}
#endif
-int
-intel_panel_init(struct intel_panel *panel,
+int intel_panel_init(struct intel_panel *panel,
struct drm_display_mode *fixed_mode)
{
panel->fixed_mode = fixed_mode;
@@ -510,8 +484,7 @@ intel_panel_init(struct intel_panel *panel,
return 0;
}
-void
-intel_panel_fini(struct intel_panel *panel)
+void intel_panel_fini(struct intel_panel *panel)
{
struct intel_connector *intel_connector =
container_of(panel, struct intel_connector, panel);
diff --git a/sys/dev/pci/drm/i915/intel_pm.c b/sys/dev/pci/drm/i915/intel_pm.c
index 22ab2ca4d6b..1dc25795dee 100644
--- a/sys/dev/pci/drm/i915/intel_pm.c
+++ b/sys/dev/pci/drm/i915/intel_pm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_pm.c,v 1.9 2013/07/08 09:47:45 jsg Exp $ */
+/* $OpenBSD: intel_pm.c,v 1.10 2013/08/13 10:23:52 jsg Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
@@ -42,121 +42,15 @@
* i915.i915_enable_fbc parameter
*/
-bool intel_crtc_active(struct drm_crtc *);
-void i8xx_disable_fbc(struct drm_device *);
-void i8xx_enable_fbc(struct drm_crtc *, unsigned long);
-bool i8xx_fbc_enabled(struct drm_device *);
-void g4x_enable_fbc(struct drm_crtc *, unsigned long);
-void g4x_disable_fbc(struct drm_device *);
-bool g4x_fbc_enabled(struct drm_device *);
-void sandybridge_blit_fbc_update(struct drm_device *);
-void ironlake_enable_fbc(struct drm_crtc *, unsigned long);
-void ironlake_disable_fbc(struct drm_device *);
-bool ironlake_fbc_enabled(struct drm_device *);
-bool intel_fbc_enabled(struct drm_device *);
-void intel_cancel_fbc_work(struct drm_i915_private *);
-void i915_pineview_get_mem_freq(struct drm_device *);
-void i915_ironlake_get_mem_freq(struct drm_device *);
-const struct cxsr_latency *
- intel_get_cxsr_latency(int, int, int, int);
-void pineview_disable_cxsr(struct drm_device *);
-int i9xx_get_fifo_size(struct drm_device *, int);
-int i85x_get_fifo_size(struct drm_device *, int);
-int i845_get_fifo_size(struct drm_device *, int);
-int i830_get_fifo_size(struct drm_device *, int);
-unsigned long
- intel_calculate_wm(unsigned long,
- const struct intel_watermark_params *wm, int, int, unsigned long);
-struct drm_crtc *
- single_enabled_crtc(struct drm_device *);
-void pineview_update_wm(struct drm_device *);
-bool g4x_compute_wm0(struct drm_device *, int,
- const struct intel_watermark_params *, int,
- const struct intel_watermark_params *, int, int *, int *);
-bool g4x_check_srwm(struct drm_device *, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *);
-bool g4x_compute_srwm(struct drm_device *, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *, int *, int *);
-bool vlv_compute_drain_latency(struct drm_device *, int, int *, int *,
- int *, int *);
-void vlv_update_drain_latency(struct drm_device *);
-void valleyview_update_wm(struct drm_device *);
-void g4x_update_wm(struct drm_device *);
-void i965_update_wm(struct drm_device *);
-void i9xx_update_wm(struct drm_device *);
-void i830_update_wm(struct drm_device *);
-bool ironlake_check_srwm(struct drm_device *, int, int, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *);
-bool ironlake_compute_srwm(struct drm_device *, int, int, int,
- const struct intel_watermark_params *,
- const struct intel_watermark_params *, int *, int *, int *);
-void ironlake_update_wm(struct drm_device *);
-void sandybridge_update_wm(struct drm_device *);
-void ivybridge_update_wm(struct drm_device *);
-void haswell_update_linetime_wm(struct drm_device *, int,
- struct drm_display_mode *);
-bool sandybridge_compute_sprite_wm(struct drm_device *, int, uint32_t, int,
- const struct intel_watermark_params *, int, int *);
-bool sandybridge_compute_sprite_srwm(struct drm_device *, int, uint32_t,
- int, const struct intel_watermark_params *, int, int *);
-void sandybridge_update_sprite_wm(struct drm_device *, int, uint32_t, int);
-struct drm_i915_gem_object *
- intel_alloc_context_page(struct drm_device *);
-void ironlake_enable_drps(struct drm_device *);
-void ironlake_disable_drps(struct drm_device *);
-u32 gen6_rps_limits(struct drm_i915_private *, u8 *);
-void gen6_disable_rps(struct drm_device *);
-void gen6_enable_rps(struct drm_device *);
-void gen6_update_ring_freq(struct drm_device *);
-void ironlake_disable_rc6(struct drm_device *);
-int ironlake_setup_rc6(struct drm_device *);
-void ironlake_enable_rc6(struct drm_device *);
-unsigned long intel_pxfreq(u32);
-unsigned long __i915_chipset_val(struct drm_i915_private *);
-u16 pvid_to_extvid(struct drm_i915_private *, u8);
-void __i915_update_gfx_val(struct drm_i915_private *);
-unsigned long __i915_gfx_val(struct drm_i915_private *);
unsigned long i915_read_mch_val(void);
-bool i915_gpu_raise(void);
-bool i915_gpu_lower(void);
-bool i915_gpu_busy(void);
-bool i915_gpu_turbo_disable(void);
-void intel_init_emon(struct drm_device *);
-void ibx_init_clock_gating(struct drm_device *);
-void ironlake_init_clock_gating(struct drm_device *);
-void cpt_init_clock_gating(struct drm_device *);
-void gen6_init_clock_gating(struct drm_device *);
-void gen7_setup_fixed_func_scheduler(struct drm_i915_private *);
-void lpt_init_clock_gating(struct drm_device *);
-void haswell_init_clock_gating(struct drm_device *);
-void ivybridge_init_clock_gating(struct drm_device *);
-void valleyview_init_clock_gating(struct drm_device *);
-void g4x_init_clock_gating(struct drm_device *);
-void crestline_init_clock_gating(struct drm_device *);
-void broadwater_init_clock_gating(struct drm_device *);
-void gen3_init_clock_gating(struct drm_device *);
-void i85x_init_clock_gating(struct drm_device *);
-void i830_init_clock_gating(struct drm_device *);
-void __gen6_gt_wait_for_thread_c0(struct drm_i915_private *);
-void __gen6_gt_force_wake_reset(struct drm_i915_private *);
-void __gen6_gt_force_wake_mt_reset(struct drm_i915_private *);
-void vlv_force_wake_reset(struct drm_i915_private *);
-void vlv_force_wake_get(struct drm_i915_private *);
-void vlv_force_wake_put(struct drm_i915_private *);
-void intel_gt_reset(struct drm_device *);
-void intel_gt_init(struct drm_device *);
-void intel_fbc_work_tick(void *);
-void intel_fbc_work_fn(void *, void *);
-void intel_gen6_powersave_tick(void *);
-void intel_gen6_powersave_work(void *, void *);
+bool i915_gpu_raise(void);
+bool i915_gpu_lower(void);
+bool i915_gpu_turbo_disable(void);
+bool i915_gpu_busy(void);
extern int ticks;
-bool
-intel_crtc_active(struct drm_crtc *crtc)
+static bool intel_crtc_active(struct drm_crtc *crtc)
{
/* Be paranoid as we can arrive here with only partial
* state retrieved from the hardware during setup.
@@ -164,8 +58,7 @@ intel_crtc_active(struct drm_crtc *crtc)
return to_intel_crtc(crtc)->active && crtc->fb && crtc->mode.clock;
}
-void
-i8xx_disable_fbc(struct drm_device *dev)
+static void i8xx_disable_fbc(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 fbc_ctl;
@@ -193,8 +86,7 @@ i8xx_disable_fbc(struct drm_device *dev)
DRM_DEBUG_KMS("disabled FBC\n");
}
-void
-i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
+static void i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -237,16 +129,14 @@ i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
cfb_pitch, crtc->y, intel_crtc->plane);
}
-bool
-i8xx_fbc_enabled(struct drm_device *dev)
+static bool i8xx_fbc_enabled(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
return I915_READ(FBC_CONTROL) & FBC_CTL_EN;
}
-void
-g4x_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
+static void g4x_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -273,8 +163,7 @@ g4x_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
DRM_DEBUG_KMS("enabled fbc on plane %d\n", intel_crtc->plane);
}
-void
-g4x_disable_fbc(struct drm_device *dev)
+static void g4x_disable_fbc(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 dpfc_ctl;
@@ -289,16 +178,14 @@ g4x_disable_fbc(struct drm_device *dev)
}
}
-bool
-g4x_fbc_enabled(struct drm_device *dev)
+static bool g4x_fbc_enabled(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
return I915_READ(DPFC_CONTROL) & DPFC_CTL_EN;
}
-void
-sandybridge_blit_fbc_update(struct drm_device *dev)
+static void sandybridge_blit_fbc_update(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 blt_ecoskpd;
@@ -318,8 +205,7 @@ sandybridge_blit_fbc_update(struct drm_device *dev)
gen6_gt_force_wake_put(dev_priv);
}
-void
-ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
+static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
{
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -357,8 +243,7 @@ ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
DRM_DEBUG_KMS("enabled fbc on plane %d\n", intel_crtc->plane);
}
-void
-ironlake_disable_fbc(struct drm_device *dev)
+static void ironlake_disable_fbc(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 dpfc_ctl;
@@ -373,16 +258,14 @@ ironlake_disable_fbc(struct drm_device *dev)
}
}
-bool
-ironlake_fbc_enabled(struct drm_device *dev)
+static bool ironlake_fbc_enabled(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
return I915_READ(ILK_DPFC_CONTROL) & DPFC_CTL_EN;
}
-bool
-intel_fbc_enabled(struct drm_device *dev)
+bool intel_fbc_enabled(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -392,17 +275,7 @@ intel_fbc_enabled(struct drm_device *dev)
return dev_priv->display.fbc_enabled(dev);
}
-void
-intel_fbc_work_tick(void *arg)
-{
- struct intel_fbc_work *work = arg;
-
- workq_queue_task(NULL, &work->task, 0,
- intel_fbc_work_fn, work, NULL);
-}
-
-void
-intel_fbc_work_fn(void *arg1, void *arg2)
+static void intel_fbc_work_fn(void *arg1, void *arg2)
{
struct intel_fbc_work *work = arg1;
struct drm_device *dev = work->crtc->dev;
@@ -429,8 +302,16 @@ intel_fbc_work_fn(void *arg1, void *arg2)
free(work, M_DRM);
}
-void
-intel_cancel_fbc_work(struct drm_i915_private *dev_priv)
+static void
+intel_fbc_work_tick(void *arg)
+{
+ struct intel_fbc_work *work = arg;
+
+ workq_queue_task(NULL, &work->task, 0,
+ intel_fbc_work_fn, work, NULL);
+}
+
+static void intel_cancel_fbc_work(struct drm_i915_private *dev_priv)
{
if (dev_priv->fbc_work == NULL)
return;
@@ -453,8 +334,7 @@ intel_cancel_fbc_work(struct drm_i915_private *dev_priv)
dev_priv->fbc_work = NULL;
}
-void
-intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
+void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
{
struct intel_fbc_work *work;
struct drm_device *dev = crtc->dev;
@@ -494,8 +374,7 @@ intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
timeout_add_msec(&work->to, 50);
}
-void
-intel_disable_fbc(struct drm_device *dev)
+void intel_disable_fbc(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -527,8 +406,7 @@ intel_disable_fbc(struct drm_device *dev)
*
* We need to enable/disable FBC on a global basis.
*/
-void
-intel_update_fbc(struct drm_device *dev)
+void intel_update_fbc(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc = NULL, *tmp_crtc;
@@ -678,8 +556,7 @@ out_disable:
}
}
-void
-i915_pineview_get_mem_freq(struct drm_device *dev)
+static void i915_pineview_get_mem_freq(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
u32 tmp;
@@ -718,8 +595,7 @@ i915_pineview_get_mem_freq(struct drm_device *dev)
dev_priv->is_ddr3 = (tmp & CSHRDDR3CTL_DDR3) ? 1 : 0;
}
-void
-i915_ironlake_get_mem_freq(struct drm_device *dev)
+static void i915_ironlake_get_mem_freq(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
u16 ddrpll, csipll;
@@ -825,8 +701,7 @@ static const struct cxsr_latency cxsr_latency_table[] = {
{0, 1, 400, 800, 6042, 36042, 6584, 36584}, /* DDR3-800 SC */
};
-const struct cxsr_latency *
-intel_get_cxsr_latency(int is_desktop,
+static const struct cxsr_latency *intel_get_cxsr_latency(int is_desktop,
int is_ddr3,
int fsb,
int mem)
@@ -850,8 +725,7 @@ intel_get_cxsr_latency(int is_desktop,
return NULL;
}
-void
-pineview_disable_cxsr(struct drm_device *dev)
+static void pineview_disable_cxsr(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -875,8 +749,7 @@ pineview_disable_cxsr(struct drm_device *dev)
*/
static const int latency_ns = 5000;
-int
-i9xx_get_fifo_size(struct drm_device *dev, int plane)
+static int i9xx_get_fifo_size(struct drm_device *dev, int plane)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t dsparb = I915_READ(DSPARB);
@@ -892,8 +765,7 @@ i9xx_get_fifo_size(struct drm_device *dev, int plane)
return size;
}
-int
-i85x_get_fifo_size(struct drm_device *dev, int plane)
+static int i85x_get_fifo_size(struct drm_device *dev, int plane)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t dsparb = I915_READ(DSPARB);
@@ -910,8 +782,7 @@ i85x_get_fifo_size(struct drm_device *dev, int plane)
return size;
}
-int
-i845_get_fifo_size(struct drm_device *dev, int plane)
+static int i845_get_fifo_size(struct drm_device *dev, int plane)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t dsparb = I915_READ(DSPARB);
@@ -927,8 +798,7 @@ i845_get_fifo_size(struct drm_device *dev, int plane)
return size;
}
-int
-i830_get_fifo_size(struct drm_device *dev, int plane)
+static int i830_get_fifo_size(struct drm_device *dev, int plane)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t dsparb = I915_READ(DSPARB);
@@ -1113,8 +983,7 @@ static const struct intel_watermark_params sandybridge_cursor_srwm_info = {
* past the watermark point. If the FIFO drains completely, a FIFO underrun
* will occur, and a display engine hang could result.
*/
-unsigned long
-intel_calculate_wm(unsigned long clock_in_khz,
+static unsigned long intel_calculate_wm(unsigned long clock_in_khz,
const struct intel_watermark_params *wm,
int fifo_size,
int pixel_size,
@@ -1146,8 +1015,7 @@ intel_calculate_wm(unsigned long clock_in_khz,
return wm_size;
}
-struct drm_crtc *
-single_enabled_crtc(struct drm_device *dev)
+static struct drm_crtc *single_enabled_crtc(struct drm_device *dev)
{
struct drm_crtc *crtc, *enabled = NULL;
@@ -1162,8 +1030,7 @@ single_enabled_crtc(struct drm_device *dev)
return enabled;
}
-void
-pineview_update_wm(struct drm_device *dev)
+static void pineview_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc;
@@ -1232,8 +1099,7 @@ pineview_update_wm(struct drm_device *dev)
}
}
-bool
-g4x_compute_wm0(struct drm_device *dev,
+static bool g4x_compute_wm0(struct drm_device *dev,
int plane,
const struct intel_watermark_params *display,
int display_latency_ns,
@@ -1291,8 +1157,7 @@ g4x_compute_wm0(struct drm_device *dev,
* can be programmed into the associated watermark register, that watermark
* must be disabled.
*/
-bool
-g4x_check_srwm(struct drm_device *dev,
+static bool g4x_check_srwm(struct drm_device *dev,
int display_wm, int cursor_wm,
const struct intel_watermark_params *display,
const struct intel_watermark_params *cursor)
@@ -1320,8 +1185,7 @@ g4x_check_srwm(struct drm_device *dev,
return true;
}
-bool
-g4x_compute_srwm(struct drm_device *dev,
+static bool g4x_compute_srwm(struct drm_device *dev,
int plane,
int latency_ns,
const struct intel_watermark_params *display,
@@ -1367,8 +1231,7 @@ g4x_compute_srwm(struct drm_device *dev,
display, cursor);
}
-bool
-vlv_compute_drain_latency(struct drm_device *dev,
+static bool vlv_compute_drain_latency(struct drm_device *dev,
int plane,
int *plane_prec_mult,
int *plane_dl,
@@ -1408,8 +1271,7 @@ vlv_compute_drain_latency(struct drm_device *dev,
* latency value.
*/
-void
-vlv_update_drain_latency(struct drm_device *dev)
+static void vlv_update_drain_latency(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int planea_prec, planea_dl, planeb_prec, planeb_dl;
@@ -1446,8 +1308,7 @@ vlv_update_drain_latency(struct drm_device *dev)
#define single_plane_enabled(mask) ((mask) != 0 && powerof2(mask))
-void
-valleyview_update_wm(struct drm_device *dev)
+static void valleyview_update_wm(struct drm_device *dev)
{
static const int sr_latency_ns = 12000;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1506,8 +1367,7 @@ valleyview_update_wm(struct drm_device *dev)
(cursor_sr << DSPFW_CURSOR_SR_SHIFT));
}
-void
-g4x_update_wm(struct drm_device *dev)
+static void g4x_update_wm(struct drm_device *dev)
{
static const int sr_latency_ns = 12000;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1559,8 +1419,7 @@ g4x_update_wm(struct drm_device *dev)
(cursor_sr << DSPFW_CURSOR_SR_SHIFT));
}
-void
-i965_update_wm(struct drm_device *dev)
+static void i965_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc;
@@ -1625,8 +1484,7 @@ i965_update_wm(struct drm_device *dev)
I915_WRITE(DSPFW3, (cursor_sr << DSPFW_CURSOR_SR_SHIFT));
}
-void
-i9xx_update_wm(struct drm_device *dev)
+static void i9xx_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
const struct intel_watermark_params *wm_info;
@@ -1743,8 +1601,7 @@ i9xx_update_wm(struct drm_device *dev)
}
}
-void
-i830_update_wm(struct drm_device *dev)
+static void i830_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc;
@@ -1776,8 +1633,7 @@ i830_update_wm(struct drm_device *dev)
* can be programmed into the associated watermark register, that watermark
* must be disabled.
*/
-bool
-ironlake_check_srwm(struct drm_device *dev, int level,
+static bool ironlake_check_srwm(struct drm_device *dev, int level,
int fbc_wm, int display_wm, int cursor_wm,
const struct intel_watermark_params *display,
const struct intel_watermark_params *cursor)
@@ -1820,8 +1676,7 @@ ironlake_check_srwm(struct drm_device *dev, int level,
/*
* Compute watermark values of WM[1-3],
*/
-bool
-ironlake_compute_srwm(struct drm_device *dev, int level, int plane,
+static bool ironlake_compute_srwm(struct drm_device *dev, int level, int plane,
int latency_ns,
const struct intel_watermark_params *display,
const struct intel_watermark_params *cursor,
@@ -1872,8 +1727,7 @@ ironlake_compute_srwm(struct drm_device *dev, int level, int plane,
display, cursor);
}
-void
-ironlake_update_wm(struct drm_device *dev)
+static void ironlake_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int fbc_wm, plane_wm, cursor_wm;
@@ -1956,8 +1810,7 @@ ironlake_update_wm(struct drm_device *dev)
*/
}
-void
-sandybridge_update_wm(struct drm_device *dev)
+static void sandybridge_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int latency = SNB_READ_WM0_LATENCY() * 100; /* In unit 0.1us */
@@ -2059,8 +1912,7 @@ sandybridge_update_wm(struct drm_device *dev)
cursor_wm);
}
-void
-ivybridge_update_wm(struct drm_device *dev)
+static void ivybridge_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int latency = SNB_READ_WM0_LATENCY() * 100; /* In unit 0.1us */
@@ -2182,7 +2034,7 @@ ivybridge_update_wm(struct drm_device *dev)
cursor_wm);
}
-void
+static void
haswell_update_linetime_wm(struct drm_device *dev, int pipe,
struct drm_display_mode *mode)
{
@@ -2209,7 +2061,7 @@ haswell_update_linetime_wm(struct drm_device *dev, int pipe,
I915_WRITE(PIPE_WM_LINETIME(pipe), temp);
}
-bool
+static bool
sandybridge_compute_sprite_wm(struct drm_device *dev, int plane,
uint32_t sprite_width, int pixel_size,
const struct intel_watermark_params *display,
@@ -2241,7 +2093,7 @@ sandybridge_compute_sprite_wm(struct drm_device *dev, int plane,
return true;
}
-bool
+static bool
sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane,
uint32_t sprite_width, int pixel_size,
const struct intel_watermark_params *display,
@@ -2285,8 +2137,7 @@ sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane,
return *sprite_wm > 0x3ff ? false : true;
}
-void
-sandybridge_update_sprite_wm(struct drm_device *dev, int pipe,
+static void sandybridge_update_sprite_wm(struct drm_device *dev, int pipe,
uint32_t sprite_width, int pixel_size)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2397,8 +2248,7 @@ sandybridge_update_sprite_wm(struct drm_device *dev, int pipe,
* We don't use the sprite, so we can ignore that. And on Crestline we have
* to set the non-SR watermarks to 8.
*/
-void
-intel_update_watermarks(struct drm_device *dev)
+void intel_update_watermarks(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2406,8 +2256,7 @@ intel_update_watermarks(struct drm_device *dev)
dev_priv->display.update_wm(dev);
}
-void
-intel_update_linetime_watermarks(struct drm_device *dev,
+void intel_update_linetime_watermarks(struct drm_device *dev,
int pipe, struct drm_display_mode *mode)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2416,8 +2265,7 @@ intel_update_linetime_watermarks(struct drm_device *dev,
dev_priv->display.update_linetime_wm(dev, pipe, mode);
}
-void
-intel_update_sprite_watermarks(struct drm_device *dev, int pipe,
+void intel_update_sprite_watermarks(struct drm_device *dev, int pipe,
uint32_t sprite_width, int pixel_size)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2427,7 +2275,7 @@ intel_update_sprite_watermarks(struct drm_device *dev, int pipe,
pixel_size);
}
-struct drm_i915_gem_object *
+static struct drm_i915_gem_object *
intel_alloc_context_page(struct drm_device *dev)
{
struct drm_i915_gem_object *ctx;
@@ -2468,8 +2316,7 @@ err_unref:
struct mutex mchdev_lock;
static struct drm_i915_private *i915_mch_dev;
-bool
-ironlake_set_drps(struct drm_device *dev, u8 val)
+bool ironlake_set_drps(struct drm_device *dev, u8 val)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u16 rgvswctl;
@@ -2493,8 +2340,7 @@ ironlake_set_drps(struct drm_device *dev, u8 val)
return true;
}
-void
-ironlake_enable_drps(struct drm_device *dev)
+static void ironlake_enable_drps(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 rgvmodectl = I915_READ(MEMMODECTL);
@@ -2568,8 +2414,7 @@ ironlake_enable_drps(struct drm_device *dev)
mtx_leave(&mchdev_lock);
}
-void
-ironlake_disable_drps(struct drm_device *dev)
+static void ironlake_disable_drps(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u16 rgvswctl;
@@ -2600,8 +2445,7 @@ ironlake_disable_drps(struct drm_device *dev)
* ourselves, instead of doing a rmw cycle (which might result in us clearing
* all limits and the gpu stuck at whatever frequency it is at atm).
*/
-u32
-gen6_rps_limits(struct drm_i915_private *dev_priv, u8 *val)
+static u32 gen6_rps_limits(struct drm_i915_private *dev_priv, u8 *val)
{
u32 limits;
@@ -2625,8 +2469,7 @@ gen6_rps_limits(struct drm_i915_private *dev_priv, u8 *val)
return limits;
}
-void
-gen6_set_rps(struct drm_device *dev, u8 val)
+void gen6_set_rps(struct drm_device *dev, u8 val)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 limits = gen6_rps_limits(dev_priv, &val);
@@ -2655,8 +2498,7 @@ gen6_set_rps(struct drm_device *dev, u8 val)
// trace_intel_gpu_freq_change(val * 50);
}
-void
-gen6_disable_rps(struct drm_device *dev)
+static void gen6_disable_rps(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2676,8 +2518,7 @@ gen6_disable_rps(struct drm_device *dev)
I915_WRITE(GEN6_PMIIR, I915_READ(GEN6_PMIIR));
}
-int
-intel_enable_rc6(const struct drm_device *dev)
+int intel_enable_rc6(const struct drm_device *dev)
{
/* Respect the kernel parameter if it is set */
if (i915_enable_rc6 >= 0)
@@ -2702,8 +2543,7 @@ intel_enable_rc6(const struct drm_device *dev)
return (INTEL_RC6_ENABLE | INTEL_RC6p_ENABLE);
}
-void
-gen6_enable_rps(struct drm_device *dev)
+static void gen6_enable_rps(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring;
@@ -2848,8 +2688,7 @@ gen6_enable_rps(struct drm_device *dev)
gen6_gt_force_wake_put(dev_priv);
}
-void
-gen6_update_ring_freq(struct drm_device *dev)
+static void gen6_update_ring_freq(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int min_freq = 15;
@@ -2903,8 +2742,7 @@ gen6_update_ring_freq(struct drm_device *dev)
}
}
-void
-ironlake_teardown_rc6(struct drm_device *dev)
+void ironlake_teardown_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2921,8 +2759,7 @@ ironlake_teardown_rc6(struct drm_device *dev)
}
}
-void
-ironlake_disable_rc6(struct drm_device *dev)
+static void ironlake_disable_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int retries;
@@ -2944,8 +2781,7 @@ ironlake_disable_rc6(struct drm_device *dev)
}
}
-int
-ironlake_setup_rc6(struct drm_device *dev)
+static int ironlake_setup_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2964,8 +2800,7 @@ ironlake_setup_rc6(struct drm_device *dev)
return 0;
}
-void
-ironlake_enable_rc6(struct drm_device *dev)
+static void ironlake_enable_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
@@ -3029,8 +2864,7 @@ ironlake_enable_rc6(struct drm_device *dev)
I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT);
}
-unsigned long
-intel_pxfreq(u32 vidfreq)
+static unsigned long intel_pxfreq(u32 vidfreq)
{
unsigned long freq;
int div = (vidfreq & 0x3f0000) >> 16;
@@ -3059,8 +2893,7 @@ static const struct cparams {
{ 0, 800, 231, 23784 },
};
-unsigned long
-__i915_chipset_val(struct drm_i915_private *dev_priv)
+static unsigned long __i915_chipset_val(struct drm_i915_private *dev_priv)
{
u64 total_count, diff, ret;
u32 count1, count2, count3, m = 0, c = 0;
@@ -3114,8 +2947,7 @@ __i915_chipset_val(struct drm_i915_private *dev_priv)
return ret;
}
-unsigned long
-i915_chipset_val(struct drm_i915_private *dev_priv)
+unsigned long i915_chipset_val(struct drm_i915_private *dev_priv)
{
unsigned long val;
@@ -3131,8 +2963,7 @@ i915_chipset_val(struct drm_i915_private *dev_priv)
return val;
}
-unsigned long
-i915_mch_val(struct drm_i915_private *dev_priv)
+unsigned long i915_mch_val(struct drm_i915_private *dev_priv)
{
unsigned long m, x, b;
u32 tsfs;
@@ -3147,8 +2978,7 @@ i915_mch_val(struct drm_i915_private *dev_priv)
return ((m * x) / 127) - b;
}
-u16
-pvid_to_extvid(struct drm_i915_private *dev_priv, u8 pxvid)
+static u16 pvid_to_extvid(struct drm_i915_private *dev_priv, u8 pxvid)
{
static const struct v_table {
u16 vd; /* in .1 mil */
@@ -3289,8 +3119,7 @@ pvid_to_extvid(struct drm_i915_private *dev_priv, u8 pxvid)
return v_table[pxvid].vd;
}
-void
-__i915_update_gfx_val(struct drm_i915_private *dev_priv)
+static void __i915_update_gfx_val(struct drm_i915_private *dev_priv)
{
struct timespec now, diff1;
u64 diff;
@@ -3325,8 +3154,7 @@ __i915_update_gfx_val(struct drm_i915_private *dev_priv)
dev_priv->ips.gfx_power = diff;
}
-void
-i915_update_gfx_val(struct drm_i915_private *dev_priv)
+void i915_update_gfx_val(struct drm_i915_private *dev_priv)
{
if (dev_priv->info->gen != 5)
return;
@@ -3338,8 +3166,7 @@ i915_update_gfx_val(struct drm_i915_private *dev_priv)
mtx_leave(&mchdev_lock);
}
-unsigned long
-__i915_gfx_val(struct drm_i915_private *dev_priv)
+static unsigned long __i915_gfx_val(struct drm_i915_private *dev_priv)
{
unsigned long t, corr, state1, corr2, state2;
u32 pxvid, ext_v;
@@ -3376,8 +3203,7 @@ __i915_gfx_val(struct drm_i915_private *dev_priv)
return dev_priv->ips.gfx_power + state2;
}
-unsigned long
-i915_gfx_val(struct drm_i915_private *dev_priv)
+unsigned long i915_gfx_val(struct drm_i915_private *dev_priv)
{
unsigned long val;
@@ -3399,8 +3225,7 @@ i915_gfx_val(struct drm_i915_private *dev_priv)
* Calculate and return a value for the IPS driver to use when deciding whether
* we have thermal and power headroom to increase CPU or GPU power budget.
*/
-unsigned long
-i915_read_mch_val(void)
+unsigned long i915_read_mch_val(void)
{
struct drm_i915_private *dev_priv;
unsigned long chipset_val, graphics_val, ret = 0;
@@ -3426,8 +3251,7 @@ out_unlock:
*
* Raise the limit; IPS indicates we have thermal headroom.
*/
-bool
-i915_gpu_raise(void)
+bool i915_gpu_raise(void)
{
struct drm_i915_private *dev_priv;
bool ret = true;
@@ -3454,8 +3278,7 @@ out_unlock:
* IPS indicates we're close to a thermal limit, so throttle back the GPU
* frequency maximum.
*/
-bool
-i915_gpu_lower(void)
+bool i915_gpu_lower(void)
{
struct drm_i915_private *dev_priv;
bool ret = true;
@@ -3481,8 +3304,7 @@ out_unlock:
*
* Tell the IPS driver whether or not the GPU is busy.
*/
-bool
-i915_gpu_busy(void)
+bool i915_gpu_busy(void)
{
struct drm_i915_private *dev_priv;
struct intel_ring_buffer *ring;
@@ -3509,8 +3331,7 @@ out_unlock:
* Disable graphics turbo by resetting the max frequency and setting the
* current frequency to the default.
*/
-bool
-i915_gpu_turbo_disable(void)
+bool i915_gpu_turbo_disable(void)
{
struct drm_i915_private *dev_priv;
struct drm_device *dev;
@@ -3543,7 +3364,7 @@ out_unlock:
* GPU turbo limits to i915.
*/
#if 0
-void
+static void
ips_ping_for_i915_load(void)
{
void (*link)(void);
@@ -3556,8 +3377,7 @@ ips_ping_for_i915_load(void)
}
#endif
-void
-intel_gpu_ips_init(struct drm_i915_private *dev_priv)
+void intel_gpu_ips_init(struct drm_i915_private *dev_priv)
{
/* We only register the i915 ips part with intel-ips once everything is
* set up, to avoid intel-ips sneaking in and reading bogus values. */
@@ -3568,16 +3388,14 @@ intel_gpu_ips_init(struct drm_i915_private *dev_priv)
// ips_ping_for_i915_load();
}
-void
-intel_gpu_ips_teardown(void)
+void intel_gpu_ips_teardown(void)
{
mtx_enter(&mchdev_lock);
i915_mch_dev = NULL;
mtx_leave(&mchdev_lock);
}
-void
-intel_init_emon(struct drm_device *dev)
+static void intel_init_emon(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 lcfuse;
@@ -3648,8 +3466,7 @@ intel_init_emon(struct drm_device *dev)
dev_priv->ips.corr = (lcfuse & LCFUSE_HIV_MASK);
}
-void
-intel_disable_gt_powersave(struct drm_device *dev)
+void intel_disable_gt_powersave(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3664,17 +3481,7 @@ intel_disable_gt_powersave(struct drm_device *dev)
}
}
-void
-intel_gen6_powersave_tick(void *arg)
-{
- drm_i915_private_t *dev_priv = arg;
-
- workq_queue_task(NULL, &dev_priv->rps.delayed_resume_task, 0,
- intel_gen6_powersave_work, dev_priv, NULL);
-}
-
-void
-intel_gen6_powersave_work(void *arg1, void *arg2)
+static void intel_gen6_powersave_work(void *arg1, void *arg2)
{
drm_i915_private_t *dev_priv = arg1;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
@@ -3685,8 +3492,16 @@ intel_gen6_powersave_work(void *arg1, void *arg2)
rw_exit_write(&dev_priv->rps.hw_lock);
}
-void
-intel_enable_gt_powersave(struct drm_device *dev)
+static void
+intel_gen6_powersave_tick(void *arg)
+{
+ drm_i915_private_t *dev_priv = arg;
+
+ workq_queue_task(NULL, &dev_priv->rps.delayed_resume_task, 0,
+ intel_gen6_powersave_work, dev_priv, NULL);
+}
+
+void intel_enable_gt_powersave(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3704,8 +3519,7 @@ intel_enable_gt_powersave(struct drm_device *dev)
}
}
-void
-ibx_init_clock_gating(struct drm_device *dev)
+static void ibx_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3717,8 +3531,7 @@ ibx_init_clock_gating(struct drm_device *dev)
I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
}
-void
-ironlake_init_clock_gating(struct drm_device *dev)
+static void ironlake_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE;
@@ -3784,8 +3597,7 @@ ironlake_init_clock_gating(struct drm_device *dev)
ibx_init_clock_gating(dev);
}
-void
-cpt_init_clock_gating(struct drm_device *dev)
+static void cpt_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int pipe;
@@ -3815,8 +3627,7 @@ cpt_init_clock_gating(struct drm_device *dev)
}
}
-void
-gen6_init_clock_gating(struct drm_device *dev)
+static void gen6_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int pipe;
@@ -3910,8 +3721,7 @@ gen6_init_clock_gating(struct drm_device *dev)
cpt_init_clock_gating(dev);
}
-void
-gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
+static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
{
uint32_t reg = I915_READ(GEN7_FF_THREAD_MODE);
@@ -3923,8 +3733,7 @@ gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
I915_WRITE(GEN7_FF_THREAD_MODE, reg);
}
-void
-lpt_init_clock_gating(struct drm_device *dev)
+static void lpt_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3938,8 +3747,7 @@ lpt_init_clock_gating(struct drm_device *dev)
PCH_LP_PARTITION_LEVEL_DISABLE);
}
-void
-haswell_init_clock_gating(struct drm_device *dev)
+static void haswell_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int pipe;
@@ -3997,8 +3805,7 @@ haswell_init_clock_gating(struct drm_device *dev)
lpt_init_clock_gating(dev);
}
-void
-ivybridge_init_clock_gating(struct drm_device *dev)
+static void ivybridge_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int pipe;
@@ -4095,8 +3902,7 @@ ivybridge_init_clock_gating(struct drm_device *dev)
cpt_init_clock_gating(dev);
}
-void
-valleyview_init_clock_gating(struct drm_device *dev)
+static void valleyview_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int pipe;
@@ -4205,8 +4011,7 @@ valleyview_init_clock_gating(struct drm_device *dev)
I915_WRITE(VLV_GUNIT_CLOCK_GATE, GCFG_DIS);
}
-void
-g4x_init_clock_gating(struct drm_device *dev)
+static void g4x_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t dspclk_gate;
@@ -4228,8 +4033,7 @@ g4x_init_clock_gating(struct drm_device *dev)
_MASKED_BIT_ENABLE(CM0_PIPELINED_RENDER_FLUSH_DISABLE));
}
-void
-crestline_init_clock_gating(struct drm_device *dev)
+static void crestline_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4240,8 +4044,7 @@ crestline_init_clock_gating(struct drm_device *dev)
I915_WRITE16(DEUC, 0);
}
-void
-broadwater_init_clock_gating(struct drm_device *dev)
+static void broadwater_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4253,8 +4056,7 @@ broadwater_init_clock_gating(struct drm_device *dev)
I915_WRITE(RENCLK_GATE_D2, 0);
}
-void
-gen3_init_clock_gating(struct drm_device *dev)
+static void gen3_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 dstate = I915_READ(D_STATE);
@@ -4270,24 +4072,21 @@ gen3_init_clock_gating(struct drm_device *dev)
I915_WRITE(ECOSKPD, _MASKED_BIT_DISABLE(ECO_FLIP_DONE));
}
-void
-i85x_init_clock_gating(struct drm_device *dev)
+static void i85x_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
I915_WRITE(RENCLK_GATE_D1, SV_CLOCK_GATE_DISABLE);
}
-void
-i830_init_clock_gating(struct drm_device *dev)
+static void i830_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
I915_WRITE(DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE);
}
-void
-intel_init_clock_gating(struct drm_device *dev)
+void intel_init_clock_gating(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4297,8 +4096,7 @@ intel_init_clock_gating(struct drm_device *dev)
/* Starting with Haswell, we have different power wells for
* different parts of the GPU. This attempts to enable them all.
*/
-void
-intel_init_power_wells(struct drm_device *dev)
+void intel_init_power_wells(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
unsigned long power_wells[] = {
@@ -4332,8 +4130,7 @@ intel_init_power_wells(struct drm_device *dev)
}
/* Set up chip specific power management-related functions */
-void
-intel_init_pm(struct drm_device *dev)
+void intel_init_pm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4456,8 +4253,7 @@ intel_init_pm(struct drm_device *dev)
}
}
-void
-__gen6_gt_wait_for_thread_c0(struct drm_i915_private *dev_priv)
+static void __gen6_gt_wait_for_thread_c0(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
u32 gt_thread_status_mask;
@@ -4481,15 +4277,13 @@ __gen6_gt_wait_for_thread_c0(struct drm_i915_private *dev_priv)
DRM_ERROR("GT thread status wait timed out\n");
}
-void
-__gen6_gt_force_wake_reset(struct drm_i915_private *dev_priv)
+static void __gen6_gt_force_wake_reset(struct drm_i915_private *dev_priv)
{
I915_WRITE_NOTRACE(FORCEWAKE, 0);
POSTING_READ(ECOBUS); /* something from same cacheline, but !FORCEWAKE */
}
-void
-__gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
+static void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
u32 forcewake_ack;
@@ -4514,16 +4308,14 @@ __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
__gen6_gt_wait_for_thread_c0(dev_priv);
}
-void
-__gen6_gt_force_wake_mt_reset(struct drm_i915_private *dev_priv)
+static void __gen6_gt_force_wake_mt_reset(struct drm_i915_private *dev_priv)
{
I915_WRITE_NOTRACE(FORCEWAKE_MT, _MASKED_BIT_DISABLE(0xffff));
/* something from same cacheline, but !FORCEWAKE_MT */
POSTING_READ(ECOBUS);
}
-void
-__gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv)
+static void __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
u32 forcewake_ack;
@@ -4555,8 +4347,7 @@ __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv)
* be called at the beginning of the sequence followed by a call to
* gen6_gt_force_wake_put() at the end of the sequence.
*/
-void
-gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
+void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
{
mtx_enter(&dev_priv->gt_lock);
if (dev_priv->forcewake_count++ == 0)
@@ -4564,8 +4355,7 @@ gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
mtx_leave(&dev_priv->gt_lock);
}
-void
-gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv)
+void gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv)
{
u32 gtfifodbg;
gtfifodbg = I915_READ_NOTRACE(GTFIFODBG);
@@ -4574,8 +4364,7 @@ gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv)
I915_WRITE_NOTRACE(GTFIFODBG, GT_FIFO_CPU_ERROR_MASK);
}
-void
-__gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
+static void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
{
I915_WRITE_NOTRACE(FORCEWAKE, 0);
/* something from same cacheline, but !FORCEWAKE */
@@ -4583,8 +4372,7 @@ __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
gen6_gt_check_fifodbg(dev_priv);
}
-void
-__gen6_gt_force_wake_mt_put(struct drm_i915_private *dev_priv)
+static void __gen6_gt_force_wake_mt_put(struct drm_i915_private *dev_priv)
{
I915_WRITE_NOTRACE(FORCEWAKE_MT, _MASKED_BIT_DISABLE(FORCEWAKE_KERNEL));
/* something from same cacheline, but !FORCEWAKE_MT */
@@ -4595,8 +4383,7 @@ __gen6_gt_force_wake_mt_put(struct drm_i915_private *dev_priv)
/*
* see gen6_gt_force_wake_get()
*/
-void
-gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
+void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
{
mtx_enter(&dev_priv->gt_lock);
if (--dev_priv->forcewake_count == 0)
@@ -4604,8 +4391,7 @@ gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
mtx_leave(&dev_priv->gt_lock);
}
-int
-__gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
+int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
{
int ret = 0;
@@ -4625,16 +4411,14 @@ __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
return ret;
}
-void
-vlv_force_wake_reset(struct drm_i915_private *dev_priv)
+static void vlv_force_wake_reset(struct drm_i915_private *dev_priv)
{
I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_DISABLE(0xffff));
/* something from same cacheline, but !FORCEWAKE_VLV */
POSTING_READ(FORCEWAKE_ACK_VLV);
}
-void
-vlv_force_wake_get(struct drm_i915_private *dev_priv)
+static void vlv_force_wake_get(struct drm_i915_private *dev_priv)
{
int count;
@@ -4651,8 +4435,7 @@ vlv_force_wake_get(struct drm_i915_private *dev_priv)
__gen6_gt_wait_for_thread_c0(dev_priv);
}
-void
-vlv_force_wake_put(struct drm_i915_private *dev_priv)
+static void vlv_force_wake_put(struct drm_i915_private *dev_priv)
{
I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_DISABLE(FORCEWAKE_KERNEL));
/* something from same cacheline, but !FORCEWAKE_VLV */
@@ -4660,8 +4443,7 @@ vlv_force_wake_put(struct drm_i915_private *dev_priv)
gen6_gt_check_fifodbg(dev_priv);
}
-void
-intel_gt_reset(struct drm_device *dev)
+void intel_gt_reset(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4674,8 +4456,7 @@ intel_gt_reset(struct drm_device *dev)
}
}
-void
-intel_gt_init(struct drm_device *dev)
+void intel_gt_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4697,8 +4478,7 @@ intel_gt_init(struct drm_device *dev)
dev_priv);
}
-int
-sandybridge_pcode_read(struct drm_i915_private *dev_priv, u8 mbox, u32 *val)
+int sandybridge_pcode_read(struct drm_i915_private *dev_priv, u8 mbox, u32 *val)
{
int retries;
rw_assert_wrlock(&dev_priv->rps.hw_lock);
@@ -4727,8 +4507,7 @@ sandybridge_pcode_read(struct drm_i915_private *dev_priv, u8 mbox, u32 *val)
return 0;
}
-int
-sandybridge_pcode_write(struct drm_i915_private *dev_priv, u8 mbox, u32 val)
+int sandybridge_pcode_write(struct drm_i915_private *dev_priv, u8 mbox, u32 val)
{
int retries;
rw_assert_wrlock(&dev_priv->rps.hw_lock);
diff --git a/sys/dev/pci/drm/i915/intel_ringbuffer.c b/sys/dev/pci/drm/i915/intel_ringbuffer.c
index aedb3c2ee6f..44f25105e8f 100644
--- a/sys/dev/pci/drm/i915/intel_ringbuffer.c
+++ b/sys/dev/pci/drm/i915/intel_ringbuffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_ringbuffer.c,v 1.4 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_ringbuffer.c,v 1.5 2013/08/13 10:23:52 jsg Exp $ */
/*
* Copyright © 2008-2010 Intel Corporation
*
@@ -43,62 +43,9 @@ struct pipe_control {
u32 gtt_offset;
};
-int gen2_render_ring_flush(struct intel_ring_buffer *, u32, u32);
-int gen4_render_ring_flush(struct intel_ring_buffer *, u32, u32);
-int gen6_render_ring_flush(struct intel_ring_buffer *, u32, u32);
-int gen7_render_ring_flush(struct intel_ring_buffer *, u32, u32);
-int intel_emit_post_sync_nonzero_flush(struct intel_ring_buffer *);
-int gen7_render_ring_cs_stall_wa(struct intel_ring_buffer *);
-void ring_write_tail(struct intel_ring_buffer *, u32);
-int init_pipe_control(struct intel_ring_buffer *);
-void cleanup_pipe_control(struct intel_ring_buffer *);
-int init_render_ring(struct intel_ring_buffer *);
-void render_ring_cleanup(struct intel_ring_buffer *);
-void update_mboxes(struct intel_ring_buffer *, u32);
-int gen6_add_request(struct intel_ring_buffer *);
-int gen6_ring_sync(struct intel_ring_buffer *, struct intel_ring_buffer *,
- u32);
-int pc_render_add_request(struct intel_ring_buffer *);
-u32 gen6_ring_get_seqno(struct intel_ring_buffer *, bool);
-u32 ring_get_seqno(struct intel_ring_buffer *, bool);
-u32 pc_render_get_seqno(struct intel_ring_buffer *, bool);
-bool gen5_ring_get_irq(struct intel_ring_buffer *);
-void gen5_ring_put_irq(struct intel_ring_buffer *);
-bool i9xx_ring_get_irq(struct intel_ring_buffer *);
-void i9xx_ring_put_irq(struct intel_ring_buffer *);
-bool i8xx_ring_get_irq(struct intel_ring_buffer *);
-void i8xx_ring_put_irq(struct intel_ring_buffer *);
-int bsd_ring_flush(struct intel_ring_buffer *, u32, u32);
-int i9xx_add_request(struct intel_ring_buffer *);
-bool gen6_ring_get_irq(struct intel_ring_buffer *);
-void gen6_ring_put_irq(struct intel_ring_buffer *);
-int i830_dispatch_execbuffer(struct intel_ring_buffer *, u32, u32,
- unsigned);
-int i915_dispatch_execbuffer(struct intel_ring_buffer *, u32, u32,
- unsigned);
-int i965_dispatch_execbuffer(struct intel_ring_buffer *, u32, u32,
- unsigned);
-int init_status_page(struct intel_ring_buffer *);
-int init_phys_hws_pga(struct intel_ring_buffer *);
-int intel_ring_idle(struct intel_ring_buffer *);
-int intel_ring_wait_seqno(struct intel_ring_buffer *, u32);
-int intel_ring_wait_request(struct intel_ring_buffer *, int);
-int intel_wrap_ring_buffer(struct intel_ring_buffer *);
-int intel_ring_alloc_seqno(struct intel_ring_buffer *);
-void gen6_bsd_ring_write_tail(struct intel_ring_buffer *, u32);
-int gen6_ring_flush(struct intel_ring_buffer *, u32, u32);
-int gen6_ring_dispatch_execbuffer(struct intel_ring_buffer *, u32, u32,
- unsigned);
-int hsw_ring_dispatch_execbuffer(struct intel_ring_buffer *, u32, u32,
- unsigned);
-int blt_ring_flush(struct intel_ring_buffer *, u32, u32);
-int intel_ring_flush_all_caches(struct intel_ring_buffer *);
-int intel_ring_invalidate_all_caches(struct intel_ring_buffer *);
-
extern int ticks;
-static inline int
-ring_space(struct intel_ring_buffer *ring)
+static inline int ring_space(struct intel_ring_buffer *ring)
{
int space = (ring->head & HEAD_ADDR) - (ring->tail + I915_RING_FREE_SPACE);
if (space < 0)
@@ -106,7 +53,7 @@ ring_space(struct intel_ring_buffer *ring)
return space;
}
-int
+static int
gen2_render_ring_flush(struct intel_ring_buffer *ring,
u32 invalidate_domains,
u32 flush_domains)
@@ -132,7 +79,7 @@ gen2_render_ring_flush(struct intel_ring_buffer *ring,
return 0;
}
-int
+static int
gen4_render_ring_flush(struct intel_ring_buffer *ring,
u32 invalidate_domains,
u32 flush_domains)
@@ -227,7 +174,7 @@ gen4_render_ring_flush(struct intel_ring_buffer *ring,
* can't use that one either. Notify enable is IRQs, which aren't
* really our business. That leaves only stall at scoreboard.
*/
-int
+static int
intel_emit_post_sync_nonzero_flush(struct intel_ring_buffer *ring)
{
struct pipe_control *pc = ring->private;
@@ -263,7 +210,7 @@ intel_emit_post_sync_nonzero_flush(struct intel_ring_buffer *ring)
return 0;
}
-int
+static int
gen6_render_ring_flush(struct intel_ring_buffer *ring,
u32 invalidate_domains, u32 flush_domains)
{
@@ -316,7 +263,7 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring,
return 0;
}
-int
+static int
gen7_render_ring_cs_stall_wa(struct intel_ring_buffer *ring)
{
int ret;
@@ -335,7 +282,7 @@ gen7_render_ring_cs_stall_wa(struct intel_ring_buffer *ring)
return 0;
}
-int
+static int
gen7_render_ring_flush(struct intel_ring_buffer *ring,
u32 invalidate_domains, u32 flush_domains)
{
@@ -394,15 +341,14 @@ gen7_render_ring_flush(struct intel_ring_buffer *ring,
return 0;
}
-void
-ring_write_tail(struct intel_ring_buffer *ring, u32 value)
+static void ring_write_tail(struct intel_ring_buffer *ring,
+ u32 value)
{
drm_i915_private_t *dev_priv = ring->dev->dev_private;
I915_WRITE_TAIL(ring, value);
}
-u32
-intel_ring_get_active_head(struct intel_ring_buffer *ring)
+u32 intel_ring_get_active_head(struct intel_ring_buffer *ring)
{
drm_i915_private_t *dev_priv = ring->dev->dev_private;
u32 acthd_reg = INTEL_INFO(ring->dev)->gen >= 4 ?
@@ -411,8 +357,7 @@ intel_ring_get_active_head(struct intel_ring_buffer *ring)
return I915_READ(acthd_reg);
}
-int
-init_ring_common(struct intel_ring_buffer *ring)
+static int init_ring_common(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -499,7 +444,7 @@ out:
return ret;
}
-int
+static int
init_pipe_control(struct intel_ring_buffer *ring)
{
struct pipe_control *pc;
@@ -558,7 +503,7 @@ err:
return ret;
}
-void
+static void
cleanup_pipe_control(struct intel_ring_buffer *ring)
{
struct pipe_control *pc = ring->private;
@@ -578,8 +523,7 @@ cleanup_pipe_control(struct intel_ring_buffer *ring)
ring->private = NULL;
}
-int
-init_render_ring(struct intel_ring_buffer *ring)
+static int init_render_ring(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -639,8 +583,7 @@ init_render_ring(struct intel_ring_buffer *ring)
return ret;
}
-void
-render_ring_cleanup(struct intel_ring_buffer *ring)
+static void render_ring_cleanup(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -653,7 +596,7 @@ render_ring_cleanup(struct intel_ring_buffer *ring)
cleanup_pipe_control(ring);
}
-void
+static void
update_mboxes(struct intel_ring_buffer *ring,
u32 mmio_offset)
{
@@ -671,7 +614,7 @@ update_mboxes(struct intel_ring_buffer *ring,
* Update the mailbox registers in the *other* rings with the current seqno.
* This acts like a signal in the canonical semaphore.
*/
-int
+static int
gen6_add_request(struct intel_ring_buffer *ring)
{
u32 mbox1_reg;
@@ -703,7 +646,7 @@ gen6_add_request(struct intel_ring_buffer *ring)
* @signaller - ring which has, or will signal
* @seqno - seqno which the waiter will block on
*/
-int
+static int
gen6_ring_sync(struct intel_ring_buffer *waiter,
struct intel_ring_buffer *signaller,
u32 seqno)
@@ -745,7 +688,7 @@ do { \
intel_ring_emit(ring__, 0); \
} while (0)
-int
+static int
pc_render_add_request(struct intel_ring_buffer *ring)
{
struct pipe_control *pc = ring->private;
@@ -794,7 +737,7 @@ pc_render_add_request(struct intel_ring_buffer *ring)
return 0;
}
-u32
+static u32
gen6_ring_get_seqno(struct intel_ring_buffer *ring, bool lazy_coherency)
{
/* Workaround to force correct ordering between irq and seqno writes on
@@ -805,20 +748,20 @@ gen6_ring_get_seqno(struct intel_ring_buffer *ring, bool lazy_coherency)
return intel_read_status_page(ring, I915_GEM_HWS_INDEX);
}
-u32
+static u32
ring_get_seqno(struct intel_ring_buffer *ring, bool lazy_coherency)
{
return intel_read_status_page(ring, I915_GEM_HWS_INDEX);
}
-u32
+static u32
pc_render_get_seqno(struct intel_ring_buffer *ring, bool lazy_coherency)
{
struct pipe_control *pc = ring->private;
return pc->cpu_page[0];
}
-bool
+static bool
gen5_ring_get_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -838,7 +781,7 @@ gen5_ring_get_irq(struct intel_ring_buffer *ring)
return true;
}
-void
+static void
gen5_ring_put_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -853,7 +796,7 @@ gen5_ring_put_irq(struct intel_ring_buffer *ring)
// mtx_leave(&dev_priv->irq_lock);
}
-bool
+static bool
i9xx_ring_get_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -873,7 +816,7 @@ i9xx_ring_get_irq(struct intel_ring_buffer *ring)
return true;
}
-void
+static void
i9xx_ring_put_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -888,7 +831,7 @@ i9xx_ring_put_irq(struct intel_ring_buffer *ring)
// mtx_leave(&dev_priv->irq_lock);
}
-bool
+static bool
i8xx_ring_get_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -908,7 +851,7 @@ i8xx_ring_get_irq(struct intel_ring_buffer *ring)
return true;
}
-void
+static void
i8xx_ring_put_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -923,8 +866,7 @@ i8xx_ring_put_irq(struct intel_ring_buffer *ring)
// mtx_leave(&dev_priv->irq_lock);
}
-void
-intel_ring_setup_status_page(struct intel_ring_buffer *ring)
+void intel_ring_setup_status_page(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
drm_i915_private_t *dev_priv = ring->dev->dev_private;
@@ -955,7 +897,7 @@ intel_ring_setup_status_page(struct intel_ring_buffer *ring)
POSTING_READ(mmio);
}
-int
+static int
bsd_ring_flush(struct intel_ring_buffer *ring,
u32 invalidate_domains,
u32 flush_domains)
@@ -972,7 +914,7 @@ bsd_ring_flush(struct intel_ring_buffer *ring,
return 0;
}
-int
+static int
i9xx_add_request(struct intel_ring_buffer *ring)
{
int ret;
@@ -990,7 +932,7 @@ i9xx_add_request(struct intel_ring_buffer *ring)
return 0;
}
-bool
+static bool
gen6_ring_get_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -1020,7 +962,7 @@ gen6_ring_get_irq(struct intel_ring_buffer *ring)
return true;
}
-void
+static void
gen6_ring_put_irq(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
@@ -1041,7 +983,7 @@ gen6_ring_put_irq(struct intel_ring_buffer *ring)
gen6_gt_force_wake_put(dev_priv);
}
-int
+static int
i965_dispatch_execbuffer(struct intel_ring_buffer *ring,
u32 offset, u32 length,
unsigned flags)
@@ -1064,7 +1006,7 @@ i965_dispatch_execbuffer(struct intel_ring_buffer *ring,
/* Just userspace ABI convention to limit the wa batch bo to a resonable size */
#define I830_BATCH_LIMIT (256*1024)
-int
+static int
i830_dispatch_execbuffer(struct intel_ring_buffer *ring,
u32 offset, u32 len,
unsigned flags)
@@ -1116,7 +1058,7 @@ i830_dispatch_execbuffer(struct intel_ring_buffer *ring,
return 0;
}
-int
+static int
i915_dispatch_execbuffer(struct intel_ring_buffer *ring,
u32 offset, u32 len,
unsigned flags)
@@ -1134,8 +1076,7 @@ i915_dispatch_execbuffer(struct intel_ring_buffer *ring,
return 0;
}
-void
-cleanup_status_page(struct intel_ring_buffer *ring)
+static void cleanup_status_page(struct intel_ring_buffer *ring)
{
struct drm_i915_gem_object *obj;
@@ -1150,8 +1091,7 @@ cleanup_status_page(struct intel_ring_buffer *ring)
ring->status_page.obj = NULL;
}
-int
-init_status_page(struct intel_ring_buffer *ring)
+static int init_status_page(struct intel_ring_buffer *ring)
{
struct drm_device *dev = ring->dev;
struct drm_i915_gem_object *obj;
@@ -1206,8 +1146,7 @@ err:
return ret;
}
-int
-init_phys_hws_pga(struct intel_ring_buffer *ring)
+static int init_phys_hws_pga(struct intel_ring_buffer *ring)
{
struct drm_i915_private *dev_priv = ring->dev->dev_private;
u32 addr;
@@ -1258,8 +1197,7 @@ intel_read_status_page(struct intel_ring_buffer *ring, int reg)
return (val);
}
-int
-intel_init_ring_buffer(struct drm_device *dev,
+static int intel_init_ring_buffer(struct drm_device *dev,
struct intel_ring_buffer *ring)
{
struct drm_i915_gem_object *obj;
@@ -1335,8 +1273,7 @@ err_hws:
return ret;
}
-void
-intel_cleanup_ring_buffer(struct intel_ring_buffer *ring)
+void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring)
{
struct drm_i915_private *dev_priv;
int ret;
@@ -1365,8 +1302,7 @@ intel_cleanup_ring_buffer(struct intel_ring_buffer *ring)
cleanup_status_page(ring);
}
-int
-intel_ring_wait_seqno(struct intel_ring_buffer *ring, u32 seqno)
+static int intel_ring_wait_seqno(struct intel_ring_buffer *ring, u32 seqno)
{
drm_i915_private_t *dev_priv = ring->dev->dev_private;
bool was_interruptible;
@@ -1389,8 +1325,7 @@ intel_ring_wait_seqno(struct intel_ring_buffer *ring, u32 seqno)
return ret;
}
-int
-intel_ring_wait_request(struct intel_ring_buffer *ring, int n)
+static int intel_ring_wait_request(struct intel_ring_buffer *ring, int n)
{
struct drm_i915_gem_request *request;
u32 seqno = 0;
@@ -1447,8 +1382,7 @@ intel_ring_wait_request(struct intel_ring_buffer *ring, int n)
return 0;
}
-int
-ring_wait_for_space(struct intel_ring_buffer *ring, int n)
+static int ring_wait_for_space(struct intel_ring_buffer *ring, int n)
{
struct drm_device *dev = ring->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1493,8 +1427,7 @@ ring_wait_for_space(struct intel_ring_buffer *ring, int n)
return -EBUSY;
}
-int
-intel_wrap_ring_buffer(struct intel_ring_buffer *ring)
+static int intel_wrap_ring_buffer(struct intel_ring_buffer *ring)
{
struct inteldrm_softc *dev_priv = ring->dev->dev_private;
int rem = ring->size - ring->tail;
@@ -1514,8 +1447,7 @@ intel_wrap_ring_buffer(struct intel_ring_buffer *ring)
return 0;
}
-int
-intel_ring_idle(struct intel_ring_buffer *ring)
+int intel_ring_idle(struct intel_ring_buffer *ring)
{
u32 seqno;
int ret;
@@ -1537,7 +1469,7 @@ intel_ring_idle(struct intel_ring_buffer *ring)
return i915_wait_seqno(ring, seqno);
}
-int
+static int
intel_ring_alloc_seqno(struct intel_ring_buffer *ring)
{
if (ring->outstanding_lazy_request)
@@ -1546,8 +1478,8 @@ intel_ring_alloc_seqno(struct intel_ring_buffer *ring)
return i915_gem_get_seqno(ring->dev, &ring->outstanding_lazy_request);
}
-int
-intel_ring_begin(struct intel_ring_buffer *ring, int num_dwords)
+int intel_ring_begin(struct intel_ring_buffer *ring,
+ int num_dwords)
{
drm_i915_private_t *dev_priv = ring->dev->dev_private;
int n = 4*num_dwords;
@@ -1578,8 +1510,7 @@ intel_ring_begin(struct intel_ring_buffer *ring, int num_dwords)
return 0;
}
-void
-intel_ring_advance(struct intel_ring_buffer *ring)
+void intel_ring_advance(struct intel_ring_buffer *ring)
{
struct drm_i915_private *dev_priv = ring->dev->dev_private;
@@ -1589,8 +1520,8 @@ intel_ring_advance(struct intel_ring_buffer *ring)
ring->write_tail(ring, ring->tail);
}
-void
-gen6_bsd_ring_write_tail(struct intel_ring_buffer *ring, u32 value)
+static void gen6_bsd_ring_write_tail(struct intel_ring_buffer *ring,
+ u32 value)
{
drm_i915_private_t *dev_priv = ring->dev->dev_private;
int retries;
@@ -1627,8 +1558,8 @@ gen6_bsd_ring_write_tail(struct intel_ring_buffer *ring, u32 value)
_MASKED_BIT_DISABLE(GEN6_BSD_SLEEP_MSG_DISABLE));
}
-int
-gen6_ring_flush(struct intel_ring_buffer *ring, u32 invalidate, u32 flush)
+static int gen6_ring_flush(struct intel_ring_buffer *ring,
+ u32 invalidate, u32 flush)
{
uint32_t cmd;
int ret;
@@ -1655,7 +1586,7 @@ gen6_ring_flush(struct intel_ring_buffer *ring, u32 invalidate, u32 flush)
return 0;
}
-int
+static int
hsw_ring_dispatch_execbuffer(struct intel_ring_buffer *ring,
u32 offset, u32 len,
unsigned flags)
@@ -1676,7 +1607,7 @@ hsw_ring_dispatch_execbuffer(struct intel_ring_buffer *ring,
return 0;
}
-int
+static int
gen6_ring_dispatch_execbuffer(struct intel_ring_buffer *ring,
u32 offset, u32 len,
unsigned flags)
@@ -1699,8 +1630,7 @@ gen6_ring_dispatch_execbuffer(struct intel_ring_buffer *ring,
/* Blitter support (SandyBridge+) */
-int
-blt_ring_flush(struct intel_ring_buffer *ring, u32 invalidate, u32 flush)
+static int blt_ring_flush(struct intel_ring_buffer *ring, u32 invalidate, u32 flush)
{
uint32_t cmd;
int ret;
@@ -1727,8 +1657,7 @@ blt_ring_flush(struct intel_ring_buffer *ring, u32 invalidate, u32 flush)
return 0;
}
-int
-intel_init_render_ring_buffer(struct drm_device *dev)
+int intel_init_render_ring_buffer(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
@@ -1813,8 +1742,7 @@ intel_init_render_ring_buffer(struct drm_device *dev)
return intel_init_ring_buffer(dev, ring);
}
-int
-intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size)
+int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
@@ -1880,8 +1808,7 @@ intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size)
return 0;
}
-int
-intel_init_bsd_ring_buffer(struct drm_device *dev)
+int intel_init_bsd_ring_buffer(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring = &dev_priv->ring[VCS];
@@ -1929,8 +1856,7 @@ intel_init_bsd_ring_buffer(struct drm_device *dev)
return intel_init_ring_buffer(dev, ring);
}
-int
-intel_init_blt_ring_buffer(struct drm_device *dev)
+int intel_init_blt_ring_buffer(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
diff --git a/sys/dev/pci/drm/i915/intel_sdvo.c b/sys/dev/pci/drm/i915/intel_sdvo.c
index 39e4d7fd30d..bd7b8e01d65 100644
--- a/sys/dev/pci/drm/i915/intel_sdvo.c
+++ b/sys/dev/pci/drm/i915/intel_sdvo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_sdvo.c,v 1.10 2013/07/08 09:47:45 jsg Exp $ */
+/* $OpenBSD: intel_sdvo.c,v 1.11 2013/08/13 10:23:52 jsg Exp $ */
/*
* Copyright 2006 Dave Airlie <airlied@linux.ie>
* Copyright © 2006-2007 Intel Corporation
@@ -208,146 +208,29 @@ struct intel_sdvo_connector {
u32 cur_dot_crawl, max_dot_crawl;
};
-struct intel_sdvo *to_intel_sdvo(struct drm_encoder *);
-struct intel_sdvo *intel_attached_sdvo(struct drm_connector *);
-struct intel_sdvo_connector *to_intel_sdvo_connector(struct drm_connector *);
-void intel_sdvo_write_sdvox(struct intel_sdvo *, u32);
-bool intel_sdvo_read_byte(struct intel_sdvo *, u8, u8 *);
-bool intel_sdvo_write_cmd(struct intel_sdvo *, u8, const void *, int);
-bool intel_sdvo_read_response(struct intel_sdvo *, void *, int);
-int intel_sdvo_get_pixel_multiplier(struct drm_display_mode *);
-bool intel_sdvo_set_value(struct intel_sdvo *, u8, const void *, int);
-bool intel_sdvo_get_value(struct intel_sdvo *, u8, void *, int);
-bool intel_sdvo_set_target_input(struct intel_sdvo *);
-bool intel_sdvo_get_trained_inputs(struct intel_sdvo *, bool *, bool *);
-bool intel_sdvo_set_active_outputs(struct intel_sdvo *, u16);
-bool intel_sdvo_set_encoder_power_state(struct intel_sdvo *, int);
-bool intel_sdvo_get_input_pixel_clock_range(struct intel_sdvo *, int *,
- int *);
-bool intel_sdvo_set_target_output(struct intel_sdvo *, u16);
-bool intel_sdvo_set_timing(struct intel_sdvo *, u8,
- struct intel_sdvo_dtd *);
-bool intel_sdvo_set_input_timing(struct intel_sdvo *,
- struct intel_sdvo_dtd *);
-bool intel_sdvo_set_output_timing(struct intel_sdvo *,
- struct intel_sdvo_dtd *);
-bool intel_sdvo_create_preferred_input_timing(struct intel_sdvo *, uint16_t,
- uint16_t, uint16_t);
-bool intel_sdvo_get_preferred_input_timing(struct intel_sdvo *,
- struct intel_sdvo_dtd *);
-bool intel_sdvo_set_clock_rate_mult(struct intel_sdvo *, u8);
-void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *,
- const struct drm_display_mode *);
-void intel_sdvo_get_mode_from_dtd(struct drm_display_mode *,
- const struct intel_sdvo_dtd *);
-bool intel_sdvo_check_supp_encode(struct intel_sdvo *);
-bool intel_sdvo_set_encode(struct intel_sdvo *, uint8_t);
-bool intel_sdvo_set_colorimetry(struct intel_sdvo *, uint8_t);
-bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *);
-bool intel_sdvo_set_tv_format(struct intel_sdvo *);
-bool intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *,
- const struct drm_display_mode *);
-bool intel_sdvo_set_input_timings_for_mode(struct intel_sdvo *,
- const struct drm_display_mode *, struct drm_display_mode *);
-bool intel_sdvo_mode_fixup(struct drm_encoder *,
- const struct drm_display_mode *, struct drm_display_mode *);
-void intel_sdvo_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-int intel_sdvo_mode_valid(struct drm_connector *,
- struct drm_display_mode *);
-bool intel_sdvo_get_capabilities(struct intel_sdvo *,
- struct intel_sdvo_caps *);
-int intel_sdvo_supports_hotplug(struct intel_sdvo *);
-void intel_sdvo_enable_hotplug(struct intel_encoder *);
-bool intel_sdvo_multifunc_encoder(struct intel_sdvo *);
-struct edid *intel_sdvo_get_edid(struct drm_connector *);
-struct edid *intel_sdvo_get_analog_edid(struct drm_connector *);
-enum drm_connector_status intel_sdvo_tmds_sink_detect(struct drm_connector *);
-bool intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *,
- struct edid *);
-enum drm_connector_status intel_sdvo_detect(struct drm_connector *, bool);
-void intel_sdvo_get_ddc_modes(struct drm_connector *);
-void intel_sdvo_get_tv_modes(struct drm_connector *);
-void intel_sdvo_get_lvds_modes(struct drm_connector *);
-int intel_sdvo_get_modes(struct drm_connector *);
-void intel_sdvo_destroy_enhance_property(struct drm_connector *);
-void intel_sdvo_destroy(struct drm_connector *);
-bool intel_sdvo_detect_hdmi_audio(struct drm_connector *);
-int intel_sdvo_set_property(struct drm_connector *,
- struct drm_property *, uint64_t);
-void intel_sdvo_enc_destroy(struct drm_encoder *);
-void intel_sdvo_guess_ddc_bus(struct intel_sdvo *);
-void intel_sdvo_select_ddc_bus(struct drm_i915_private *,
- struct intel_sdvo *, u32);
-void intel_sdvo_select_i2c_bus(struct drm_i915_private *,
- struct intel_sdvo *, u32);
-bool intel_sdvo_is_hdmi_connector(struct intel_sdvo *, int);
-void intel_sdvo_connector_init(struct intel_sdvo_connector *,
- struct intel_sdvo *);
-void intel_sdvo_add_hdmi_properties(struct intel_sdvo_connector *);
-bool intel_sdvo_dvi_init(struct intel_sdvo *, int);
-bool intel_sdvo_tv_init(struct intel_sdvo *, int);
-bool intel_sdvo_analog_init(struct intel_sdvo *, int);
-bool intel_sdvo_lvds_init(struct intel_sdvo *, int);
-bool intel_sdvo_output_setup(struct intel_sdvo *, uint16_t);
-bool intel_sdvo_tv_create_property(struct intel_sdvo *,
- struct intel_sdvo_connector *, int);
-bool intel_sdvo_create_enhance_property_tv(struct intel_sdvo *,
- struct intel_sdvo_connector *,
- struct intel_sdvo_enhancements_reply);
-bool intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *,
- struct intel_sdvo_connector *,
- struct intel_sdvo_enhancements_reply);
-bool intel_sdvo_create_enhance_property(struct intel_sdvo *,
- struct intel_sdvo_connector *);
-bool intel_sdvo_init_ddc_proxy(struct intel_sdvo *, struct drm_device *);
-void intel_sdvo_debug_write(struct intel_sdvo *, u8, const void *, int);
-bool intel_sdvo_set_control_bus_switch(struct intel_sdvo *, u8);
-bool intel_sdvo_get_active_outputs(struct intel_sdvo *, u16 *);
-bool intel_sdvo_write_infoframe(struct intel_sdvo *, unsigned, uint8_t,
- uint8_t *, unsigned);
-bool intel_sdvo_get_preferred_input_mode(struct intel_sdvo *,
- const struct drm_display_mode *, struct drm_display_mode *);
-bool intel_sdvo_connector_get_hw_state(struct intel_connector *);
-bool intel_sdvo_get_hw_state(struct intel_encoder *, enum pipe *);
-void intel_disable_sdvo(struct intel_encoder *);
-void intel_enable_sdvo(struct intel_encoder *);
-void intel_sdvo_dpms(struct drm_connector *, int);
-uint16_t intel_sdvo_get_hotplug_support(struct intel_sdvo *);
-void intel_sdvo_unselect_i2c_bus(struct intel_sdvo *);
-u8 intel_sdvo_get_slave_addr(struct drm_device *, struct intel_sdvo *);
-void intel_sdvo_output_cleanup(struct intel_sdvo *);
-int intel_sdvo_ddc_proxy_acquire_bus(void *, int);
-void intel_sdvo_ddc_proxy_release_bus(void *, int);
-int intel_sdvo_ddc_proxy_exec(void *, i2c_op_t, i2c_addr_t,
- const void *, size_t, void *, size_t, int);
-
-struct intel_sdvo *
-to_intel_sdvo(struct drm_encoder *encoder)
+static struct intel_sdvo *to_intel_sdvo(struct drm_encoder *encoder)
{
return container_of(encoder, struct intel_sdvo, base.base);
}
-struct intel_sdvo *
-intel_attached_sdvo(struct drm_connector *connector)
+static struct intel_sdvo *intel_attached_sdvo(struct drm_connector *connector)
{
return container_of(intel_attached_encoder(connector),
struct intel_sdvo, base);
}
-struct intel_sdvo_connector *
-to_intel_sdvo_connector(struct drm_connector *connector)
+static struct intel_sdvo_connector *to_intel_sdvo_connector(struct drm_connector *connector)
{
return container_of(to_intel_connector(connector), struct intel_sdvo_connector, base);
}
-bool
+static bool
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags);
-bool
+static bool
intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector,
int type);
-bool
+static bool
intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector);
@@ -356,8 +239,7 @@ intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
* SDVOB and SDVOC to work around apparent hardware issues (according to
* comments in the BIOS).
*/
-void
-intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val)
+static void intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val)
{
struct drm_device *dev = intel_sdvo->base.base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -389,8 +271,7 @@ intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val)
}
}
-bool
-intel_sdvo_read_byte(struct intel_sdvo *intel_sdvo, u8 addr, u8 *ch)
+static bool intel_sdvo_read_byte(struct intel_sdvo *intel_sdvo, u8 addr, u8 *ch)
{
int ret;
@@ -527,8 +408,7 @@ static const struct _sdvo_cmd_name {
#define SDVO_NAME(svdo) ((svdo)->is_sdvob ? "SDVOB" : "SDVOC")
-void
-intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd,
+static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd,
const void *args, int args_len)
{
int i;
@@ -569,8 +449,7 @@ struct i2c_msg {
size_t len;
};
-bool
-intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd,
+static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd,
const void *args, int args_len)
{
u8 *buf, status;
@@ -639,8 +518,7 @@ out:
return ret;
}
-bool
-intel_sdvo_read_response(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo,
void *response, int response_len)
{
u8 retry = 15; /* 5 quick checks, followed by 10 long checks */
@@ -707,8 +585,7 @@ log_fail:
return false;
}
-int
-intel_sdvo_get_pixel_multiplier(struct drm_display_mode *mode)
+static int intel_sdvo_get_pixel_multiplier(struct drm_display_mode *mode)
{
if (mode->clock >= 100000)
return 1;
@@ -718,8 +595,7 @@ intel_sdvo_get_pixel_multiplier(struct drm_display_mode *mode)
return 4;
}
-bool
-intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo,
u8 ddc_bus)
{
/* This must be the immediately preceding write before the i2c xfer */
@@ -728,8 +604,7 @@ intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo,
&ddc_bus, 1);
}
-bool
-intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, int len)
+static bool intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, int len)
{
if (!intel_sdvo_write_cmd(intel_sdvo, cmd, data, len))
return false;
@@ -737,7 +612,7 @@ intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, in
return intel_sdvo_read_response(intel_sdvo, NULL, 0);
}
-bool
+static bool
intel_sdvo_get_value(struct intel_sdvo *intel_sdvo, u8 cmd, void *value, int len)
{
if (!intel_sdvo_write_cmd(intel_sdvo, cmd, NULL, 0))
@@ -746,8 +621,7 @@ intel_sdvo_get_value(struct intel_sdvo *intel_sdvo, u8 cmd, void *value, int len
return intel_sdvo_read_response(intel_sdvo, value, len);
}
-bool
-intel_sdvo_set_target_input(struct intel_sdvo *intel_sdvo)
+static bool intel_sdvo_set_target_input(struct intel_sdvo *intel_sdvo)
{
struct intel_sdvo_set_target_input_args targets = {0};
return intel_sdvo_set_value(intel_sdvo,
@@ -761,8 +635,7 @@ intel_sdvo_set_target_input(struct intel_sdvo *intel_sdvo)
* This function is making an assumption about the layout of the response,
* which should be checked against the docs.
*/
-bool
-intel_sdvo_get_trained_inputs(struct intel_sdvo *intel_sdvo, bool *input_1, bool *input_2)
+static bool intel_sdvo_get_trained_inputs(struct intel_sdvo *intel_sdvo, bool *input_1, bool *input_2)
{
struct intel_sdvo_get_trained_inputs_response response;
@@ -778,8 +651,7 @@ intel_sdvo_get_trained_inputs(struct intel_sdvo *intel_sdvo, bool *input_1, bool
return true;
}
-bool
-intel_sdvo_set_active_outputs(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_active_outputs(struct intel_sdvo *intel_sdvo,
u16 outputs)
{
return intel_sdvo_set_value(intel_sdvo,
@@ -787,8 +659,7 @@ intel_sdvo_set_active_outputs(struct intel_sdvo *intel_sdvo,
&outputs, sizeof(outputs));
}
-bool
-intel_sdvo_get_active_outputs(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_get_active_outputs(struct intel_sdvo *intel_sdvo,
u16 *outputs)
{
return intel_sdvo_get_value(intel_sdvo,
@@ -796,8 +667,7 @@ intel_sdvo_get_active_outputs(struct intel_sdvo *intel_sdvo,
outputs, sizeof(*outputs));
}
-bool
-intel_sdvo_set_encoder_power_state(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_encoder_power_state(struct intel_sdvo *intel_sdvo,
int mode)
{
u8 state = SDVO_ENCODER_STATE_ON;
@@ -821,8 +691,7 @@ intel_sdvo_set_encoder_power_state(struct intel_sdvo *intel_sdvo,
SDVO_CMD_SET_ENCODER_POWER_STATE, &state, sizeof(state));
}
-bool
-intel_sdvo_get_input_pixel_clock_range(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_get_input_pixel_clock_range(struct intel_sdvo *intel_sdvo,
int *clock_min,
int *clock_max)
{
@@ -842,8 +711,7 @@ intel_sdvo_get_input_pixel_clock_range(struct intel_sdvo *intel_sdvo,
return true;
}
-bool
-intel_sdvo_set_target_output(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_target_output(struct intel_sdvo *intel_sdvo,
u16 outputs)
{
return intel_sdvo_set_value(intel_sdvo,
@@ -851,31 +719,28 @@ intel_sdvo_set_target_output(struct intel_sdvo *intel_sdvo,
&outputs, sizeof(outputs));
}
-bool
-intel_sdvo_set_timing(struct intel_sdvo *intel_sdvo, u8 cmd,
+static bool intel_sdvo_set_timing(struct intel_sdvo *intel_sdvo, u8 cmd,
struct intel_sdvo_dtd *dtd)
{
return intel_sdvo_set_value(intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) &&
intel_sdvo_set_value(intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2));
}
-bool
-intel_sdvo_set_input_timing(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_input_timing(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_dtd *dtd)
{
return intel_sdvo_set_timing(intel_sdvo,
SDVO_CMD_SET_INPUT_TIMINGS_PART1, dtd);
}
-bool
-intel_sdvo_set_output_timing(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_output_timing(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_dtd *dtd)
{
return intel_sdvo_set_timing(intel_sdvo,
SDVO_CMD_SET_OUTPUT_TIMINGS_PART1, dtd);
}
-bool
+static bool
intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo,
uint16_t clock,
uint16_t width,
@@ -899,8 +764,7 @@ intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo,
&args, sizeof(args));
}
-bool
-intel_sdvo_get_preferred_input_timing(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_get_preferred_input_timing(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_dtd *dtd)
{
#ifdef notyet
@@ -913,14 +777,12 @@ intel_sdvo_get_preferred_input_timing(struct intel_sdvo *intel_sdvo,
&dtd->part2, sizeof(dtd->part2));
}
-bool
-intel_sdvo_set_clock_rate_mult(struct intel_sdvo *intel_sdvo, u8 val)
+static bool intel_sdvo_set_clock_rate_mult(struct intel_sdvo *intel_sdvo, u8 val)
{
return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1);
}
-void
-intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
+static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
const struct drm_display_mode *mode)
{
uint16_t width, height;
@@ -976,8 +838,7 @@ intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
dtd->part2.reserved = 0;
}
-void
-intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
+static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
const struct intel_sdvo_dtd *dtd)
{
mode->hdisplay = dtd->part1.h_active;
@@ -1012,8 +873,7 @@ intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
mode->flags |= DRM_MODE_FLAG_PVSYNC;
}
-bool
-intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
+static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
{
struct intel_sdvo_encode encode;
@@ -1025,23 +885,20 @@ intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
&encode, sizeof(encode));
}
-bool
-intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo,
uint8_t mode)
{
return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_ENCODE, &mode, 1);
}
-bool
-intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo,
uint8_t mode)
{
return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_COLORIMETRY, &mode, 1);
}
#if 0
-void
-intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
+static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
{
int i, j;
uint8_t set_buf_index[2];
@@ -1070,8 +927,7 @@ intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
}
#endif
-bool
-intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
unsigned if_index, uint8_t tx_rate,
uint8_t *data, unsigned length)
{
@@ -1112,8 +968,7 @@ intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
&tx_rate, 1);
}
-bool
-intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo)
+static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo)
{
struct dip_infoframe avi_if = {
.type = DIP_TYPE_AVI,
@@ -1135,8 +990,7 @@ intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo)
sdvo_data, sizeof(sdvo_data));
}
-bool
-intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
+static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
{
struct intel_sdvo_tv_format format;
uint32_t format_map;
@@ -1153,7 +1007,7 @@ intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
&format, sizeof(format));
}
-bool
+static bool
intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,
const struct drm_display_mode *mode)
{
@@ -1172,7 +1026,7 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,
/* Asks the sdvo controller for the preferred input mode given the output mode.
* Unfortunately we have to set up the full output mode to do that. */
-bool
+static bool
intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
@@ -1199,8 +1053,7 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
return true;
}
-bool
-intel_sdvo_mode_fixup(struct drm_encoder *encoder,
+static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -1238,8 +1091,7 @@ intel_sdvo_mode_fixup(struct drm_encoder *encoder,
return true;
}
-void
-intel_sdvo_mode_set(struct drm_encoder *encoder,
+static void intel_sdvo_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -1364,8 +1216,7 @@ intel_sdvo_mode_set(struct drm_encoder *encoder,
intel_sdvo_write_sdvox(intel_sdvo, sdvox);
}
-bool
-intel_sdvo_connector_get_hw_state(struct intel_connector *connector)
+static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)
{
struct intel_sdvo_connector *intel_sdvo_connector =
to_intel_sdvo_connector(&connector->base);
@@ -1380,8 +1231,7 @@ intel_sdvo_connector_get_hw_state(struct intel_connector *connector)
return false;
}
-bool
-intel_sdvo_get_hw_state(struct intel_encoder *encoder,
+static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder,
enum pipe *pipe)
{
struct drm_device *dev = encoder->base.dev;
@@ -1404,8 +1254,7 @@ intel_sdvo_get_hw_state(struct intel_encoder *encoder,
return true;
}
-void
-intel_disable_sdvo(struct intel_encoder *encoder)
+static void intel_disable_sdvo(struct intel_encoder *encoder)
{
struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
@@ -1446,8 +1295,7 @@ intel_disable_sdvo(struct intel_encoder *encoder)
}
}
-void
-intel_enable_sdvo(struct intel_encoder *encoder)
+static void intel_enable_sdvo(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1492,8 +1340,7 @@ intel_enable_sdvo(struct intel_encoder *encoder)
intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output);
}
-void
-intel_sdvo_dpms(struct drm_connector *connector, int mode)
+static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
{
struct drm_crtc *crtc;
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
@@ -1535,8 +1382,7 @@ intel_sdvo_dpms(struct drm_connector *connector, int mode)
intel_modeset_check_state(connector->dev);
}
-int
-intel_sdvo_mode_valid(struct drm_connector *connector,
+static int intel_sdvo_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
@@ -1561,8 +1407,7 @@ intel_sdvo_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
-bool
-intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct intel_sdvo_caps *caps)
+static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct intel_sdvo_caps *caps)
{
#ifdef notyet
BUILD_BUG_ON(sizeof(*caps) != 8);
@@ -1601,8 +1446,7 @@ intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct intel_sdvo_cap
return true;
}
-uint16_t
-intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo)
+static uint16_t intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo)
{
struct drm_device *dev = intel_sdvo->base.base.dev;
uint16_t hotplug;
@@ -1619,8 +1463,7 @@ intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo)
return hotplug;
}
-void
-intel_sdvo_enable_hotplug(struct intel_encoder *encoder)
+static void intel_sdvo_enable_hotplug(struct intel_encoder *encoder)
{
struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
@@ -1628,14 +1471,14 @@ intel_sdvo_enable_hotplug(struct intel_encoder *encoder)
&intel_sdvo->hotplug_active, 2);
}
-bool
+static bool
intel_sdvo_multifunc_encoder(struct intel_sdvo *intel_sdvo)
{
/* Is there more than one type of output? */
return bitcount16(intel_sdvo->caps.output_flags) > 1;
}
-struct edid *
+static struct edid *
intel_sdvo_get_edid(struct drm_connector *connector)
{
struct intel_sdvo *sdvo = intel_attached_sdvo(connector);
@@ -1643,7 +1486,7 @@ intel_sdvo_get_edid(struct drm_connector *connector)
}
/* Mac mini hack -- use the same DDC as the analog connector */
-struct edid *
+static struct edid *
intel_sdvo_get_analog_edid(struct drm_connector *connector)
{
struct drm_i915_private *dev_priv = connector->dev->dev_private;
@@ -1653,7 +1496,7 @@ intel_sdvo_get_analog_edid(struct drm_connector *connector)
dev_priv->crt_ddc_pin));
}
-enum drm_connector_status
+static enum drm_connector_status
intel_sdvo_tmds_sink_detect(struct drm_connector *connector)
{
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
@@ -1713,7 +1556,7 @@ intel_sdvo_tmds_sink_detect(struct drm_connector *connector)
return status;
}
-bool
+static bool
intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *sdvo,
struct edid *edid)
{
@@ -1725,7 +1568,7 @@ intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *sdvo,
return connector_is_digital == monitor_is_digital;
}
-enum drm_connector_status
+static enum drm_connector_status
intel_sdvo_detect(struct drm_connector *connector, bool force)
{
uint16_t response;
@@ -1790,8 +1633,7 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
return ret;
}
-void
-intel_sdvo_get_ddc_modes(struct drm_connector *connector)
+static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)
{
struct edid *edid;
@@ -1883,8 +1725,7 @@ static const struct drm_display_mode sdvo_tv_modes[] = {
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
};
-void
-intel_sdvo_get_tv_modes(struct drm_connector *connector)
+static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
{
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
struct intel_sdvo_sdtv_resolution_request tv_res;
@@ -1921,8 +1762,7 @@ intel_sdvo_get_tv_modes(struct drm_connector *connector)
}
}
-void
-intel_sdvo_get_lvds_modes(struct drm_connector *connector)
+static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
{
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
struct drm_i915_private *dev_priv = connector->dev->dev_private;
@@ -1962,8 +1802,7 @@ end:
}
-int
-intel_sdvo_get_modes(struct drm_connector *connector)
+static int intel_sdvo_get_modes(struct drm_connector *connector)
{
struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
@@ -1977,7 +1816,7 @@ intel_sdvo_get_modes(struct drm_connector *connector)
return !list_empty(&connector->probed_modes);
}
-void
+static void
intel_sdvo_destroy_enhance_property(struct drm_connector *connector)
{
struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
@@ -2019,8 +1858,7 @@ intel_sdvo_destroy_enhance_property(struct drm_connector *connector)
drm_property_destroy(dev, intel_sdvo_connector->brightness);
}
-void
-intel_sdvo_destroy(struct drm_connector *connector)
+static void intel_sdvo_destroy(struct drm_connector *connector)
{
struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
@@ -2036,8 +1874,7 @@ intel_sdvo_destroy(struct drm_connector *connector)
free(intel_sdvo_connector, M_DRM);
}
-bool
-intel_sdvo_detect_hdmi_audio(struct drm_connector *connector)
+static bool intel_sdvo_detect_hdmi_audio(struct drm_connector *connector)
{
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
struct edid *edid;
@@ -2054,7 +1891,7 @@ intel_sdvo_detect_hdmi_audio(struct drm_connector *connector)
return has_audio;
}
-int
+static int
intel_sdvo_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t val)
@@ -2222,8 +2059,7 @@ static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs
.best_encoder = intel_best_encoder,
};
-void
-intel_sdvo_enc_destroy(struct drm_encoder *encoder)
+static void intel_sdvo_enc_destroy(struct drm_encoder *encoder)
{
struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder);
@@ -2241,7 +2077,7 @@ static const struct drm_encoder_funcs intel_sdvo_enc_funcs = {
.destroy = intel_sdvo_enc_destroy,
};
-void
+static void
intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo)
{
uint16_t mask = 0;
@@ -2284,7 +2120,7 @@ intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo)
* DDC bus number assignment is in a priority order of RGB outputs, then TMDS
* outputs, then LVDS outputs.
*/
-void
+static void
intel_sdvo_select_ddc_bus(struct drm_i915_private *dev_priv,
struct intel_sdvo *sdvo, u32 reg)
{
@@ -2301,7 +2137,7 @@ intel_sdvo_select_ddc_bus(struct drm_i915_private *dev_priv,
intel_sdvo_guess_ddc_bus(sdvo);
}
-void
+static void
intel_sdvo_select_i2c_bus(struct drm_i915_private *dev_priv,
struct intel_sdvo *sdvo, u32 reg)
{
@@ -2327,19 +2163,19 @@ intel_sdvo_select_i2c_bus(struct drm_i915_private *dev_priv,
}
/* undo any changes intel_sdvo_select_i2c_bus() did to sdvo->i2c */
-void
+static void
intel_sdvo_unselect_i2c_bus(struct intel_sdvo *sdvo)
{
intel_gmbus_force_bit(sdvo->i2c, false);
}
-bool
+static bool
intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo, int device)
{
return intel_sdvo_check_supp_encode(intel_sdvo);
}
-u8
+static u8
intel_sdvo_get_slave_addr(struct drm_device *dev, struct intel_sdvo *sdvo)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2376,7 +2212,7 @@ intel_sdvo_get_slave_addr(struct drm_device *dev, struct intel_sdvo *sdvo)
return 0x72;
}
-void
+static void
intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
struct intel_sdvo *encoder)
{
@@ -2399,7 +2235,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
#endif
}
-void
+static void
intel_sdvo_add_hdmi_properties(struct intel_sdvo_connector *connector)
{
struct drm_device *dev = connector->base.base.dev;
@@ -2409,7 +2245,7 @@ intel_sdvo_add_hdmi_properties(struct intel_sdvo_connector *connector)
intel_attach_broadcast_rgb_property(&connector->base.base);
}
-bool
+static bool
intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
{
struct drm_encoder *encoder = &intel_sdvo->base.base;
@@ -2460,7 +2296,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
return true;
}
-bool
+static bool
intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
{
struct drm_encoder *encoder = &intel_sdvo->base.base;
@@ -2499,7 +2335,7 @@ err:
return false;
}
-bool
+static bool
intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
{
struct drm_encoder *encoder = &intel_sdvo->base.base;
@@ -2531,7 +2367,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
return true;
}
-bool
+static bool
intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
{
struct drm_encoder *encoder = &intel_sdvo->base.base;
@@ -2568,7 +2404,7 @@ err:
return false;
}
-bool
+static bool
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags)
{
intel_sdvo->is_tv = false;
@@ -2629,8 +2465,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags)
return true;
}
-void
-intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
+static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
{
struct drm_device *dev = intel_sdvo->base.base.dev;
struct drm_connector *connector, *tmp;
@@ -2642,8 +2477,7 @@ intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
}
}
-bool
-intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector,
int type)
{
@@ -2709,7 +2543,7 @@ intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
} \
} while (0)
-bool
+static bool
intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector,
struct intel_sdvo_enhancements_reply enhancements)
@@ -2826,7 +2660,7 @@ intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo,
return true;
}
-bool
+static bool
intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector,
struct intel_sdvo_enhancements_reply enhancements)
@@ -2841,8 +2675,7 @@ intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo,
}
#undef ENHANCEMENT
-bool
-intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
+static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector)
{
union {
@@ -2871,7 +2704,7 @@ intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
return true;
}
-int
+static int
intel_sdvo_ddc_proxy_acquire_bus(void *cookie, int flags)
{
struct intel_sdvo *sdvo = cookie;
@@ -2880,7 +2713,7 @@ intel_sdvo_ddc_proxy_acquire_bus(void *cookie, int flags)
return iic_acquire_bus(i2c, flags);
}
-void
+static void
intel_sdvo_ddc_proxy_release_bus(void *cookie, int flags)
{
struct intel_sdvo *sdvo = cookie;
@@ -2889,7 +2722,7 @@ intel_sdvo_ddc_proxy_release_bus(void *cookie, int flags)
iic_release_bus(i2c, flags);
}
-int
+static int
intel_sdvo_ddc_proxy_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
const void *cmdbuf, size_t cmdlen, void *buffer, size_t len, int flags)
{
@@ -2902,7 +2735,7 @@ intel_sdvo_ddc_proxy_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
return iic_exec(i2c, op, addr, cmdbuf, cmdlen, buffer, len, flags);
}
-bool
+static bool
intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo,
struct drm_device *dev)
{
@@ -2925,8 +2758,7 @@ intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo,
#endif
}
-bool
-intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
+bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_encoder *intel_encoder;
diff --git a/sys/dev/pci/drm/i915/intel_sprite.c b/sys/dev/pci/drm/i915/intel_sprite.c
index e352973f798..4cd8623a961 100644
--- a/sys/dev/pci/drm/i915/intel_sprite.c
+++ b/sys/dev/pci/drm/i915/intel_sprite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_sprite.c,v 1.2 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_sprite.c,v 1.3 2013/08/13 10:23:52 jsg Exp $ */
/*
* Copyright © 2011 Intel Corporation
*
@@ -37,39 +37,7 @@
#include <dev/pci/drm/i915_drm.h>
#include "i915_drv.h"
-void ivb_disable_plane(struct drm_plane *);
-int ivb_update_colorkey(struct drm_plane *,
- struct drm_intel_sprite_colorkey *);
-void ivb_get_colorkey(struct drm_plane *,
- struct drm_intel_sprite_colorkey *);
-void snb_disable_plane(struct drm_plane *);
-void intel_enable_primary(struct drm_crtc *);
-int snb_update_colorkey(struct drm_plane *,
- struct drm_intel_sprite_colorkey *);
-void snb_get_colorkey(struct drm_plane *,
- struct drm_intel_sprite_colorkey *);
-int intel_update_plane(struct drm_plane *, struct drm_crtc *,
- struct drm_framebuffer *, int, int, unsigned int, unsigned int,
- uint32_t, uint32_t, uint32_t, uint32_t);
-int intel_disable_drm_plane(struct drm_plane *);
-void intel_destroy_plane(struct drm_plane *);
-void ivb_update_plane(struct drm_plane *, struct drm_framebuffer *,
- struct drm_i915_gem_object *, int, int, unsigned int,
- unsigned int, uint32_t, uint32_t, uint32_t, uint32_t);
-void snb_update_plane(struct drm_plane *, struct drm_framebuffer *,
- struct drm_i915_gem_object *, int, int, unsigned int,
- unsigned int, uint32_t, uint32_t, uint32_t, uint32_t);
-void intel_disable_primary(struct drm_crtc *);
-void ilk_update_plane(struct drm_plane *, struct drm_framebuffer *,
- struct drm_i915_gem_object *, int, int, unsigned int, unsigned int,
- uint32_t, uint32_t, uint32_t, uint32_t);
-void ilk_disable_plane(struct drm_plane *);
-int ilk_update_colorkey(struct drm_plane *,
- struct drm_intel_sprite_colorkey *);
-void ilk_get_colorkey(struct drm_plane *,
- struct drm_intel_sprite_colorkey *);
-
-void
+static void
ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj, int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h,
@@ -176,7 +144,7 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
POSTING_READ(SPRSURF(pipe));
}
-void
+static void
ivb_disable_plane(struct drm_plane *plane)
{
struct drm_device *dev = plane->dev;
@@ -196,7 +164,7 @@ ivb_disable_plane(struct drm_plane *plane)
intel_update_watermarks(dev);
}
-int
+static int
ivb_update_colorkey(struct drm_plane *plane,
struct drm_intel_sprite_colorkey *key)
{
@@ -225,7 +193,7 @@ ivb_update_colorkey(struct drm_plane *plane,
return ret;
}
-void
+static void
ivb_get_colorkey(struct drm_plane *plane, struct drm_intel_sprite_colorkey *key)
{
struct drm_device *dev = plane->dev;
@@ -250,7 +218,7 @@ ivb_get_colorkey(struct drm_plane *plane, struct drm_intel_sprite_colorkey *key)
key->flags = I915_SET_COLORKEY_NONE;
}
-void
+static void
ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj, int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h,
@@ -336,7 +304,7 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
POSTING_READ(DVSSURF(pipe));
}
-void
+static void
ilk_disable_plane(struct drm_plane *plane)
{
struct drm_device *dev = plane->dev;
@@ -352,7 +320,7 @@ ilk_disable_plane(struct drm_plane *plane)
POSTING_READ(DVSSURF(pipe));
}
-void
+static void
intel_enable_primary(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
@@ -369,7 +337,7 @@ intel_enable_primary(struct drm_crtc *crtc)
I915_WRITE(reg, I915_READ(reg) | DISPLAY_PLANE_ENABLE);
}
-void
+static void
intel_disable_primary(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
@@ -386,7 +354,7 @@ intel_disable_primary(struct drm_crtc *crtc)
intel_update_fbc(dev);
}
-int
+static int
ilk_update_colorkey(struct drm_plane *plane,
struct drm_intel_sprite_colorkey *key)
{
@@ -415,7 +383,7 @@ ilk_update_colorkey(struct drm_plane *plane,
return ret;
}
-void
+static void
ilk_get_colorkey(struct drm_plane *plane, struct drm_intel_sprite_colorkey *key)
{
struct drm_device *dev = plane->dev;
@@ -440,7 +408,7 @@ ilk_get_colorkey(struct drm_plane *plane, struct drm_intel_sprite_colorkey *key)
key->flags = I915_SET_COLORKEY_NONE;
}
-int
+static int
intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
struct drm_framebuffer *fb, int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h,
@@ -579,8 +547,8 @@ out:
return ret;
}
-int
-intel_disable_drm_plane(struct drm_plane *plane)
+static int
+intel_disable_plane(struct drm_plane *plane)
{
struct drm_device *dev = plane->dev;
struct intel_plane *intel_plane = to_intel_plane(plane);
@@ -602,17 +570,15 @@ out:
return ret;
}
-void
-intel_destroy_plane(struct drm_plane *plane)
+static void intel_destroy_plane(struct drm_plane *plane)
{
struct intel_plane *intel_plane = to_intel_plane(plane);
- intel_disable_drm_plane(plane);
+ intel_disable_plane(plane);
drm_plane_cleanup(plane);
free(intel_plane, M_DRM);
}
-int
-intel_sprite_set_colorkey(struct drm_device *dev, void *data,
+int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_intel_sprite_colorkey *set = data;
@@ -645,8 +611,7 @@ out_unlock:
return ret;
}
-int
-intel_sprite_get_colorkey(struct drm_device *dev, void *data,
+int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_intel_sprite_colorkey *get = data;
@@ -677,7 +642,7 @@ out_unlock:
static const struct drm_plane_funcs intel_plane_funcs = {
.update_plane = intel_update_plane,
- .disable_plane = intel_disable_drm_plane,
+ .disable_plane = intel_disable_plane,
.destroy = intel_destroy_plane,
};
diff --git a/sys/dev/pci/drm/i915/intel_tv.c b/sys/dev/pci/drm/i915/intel_tv.c
index 0872e659a4b..375b716ccaf 100644
--- a/sys/dev/pci/drm/i915/intel_tv.c
+++ b/sys/dev/pci/drm/i915/intel_tv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_tv.c,v 1.2 2013/07/05 07:20:27 jsg Exp $ */
+/* $OpenBSD: intel_tv.c,v 1.3 2013/08/13 10:23:52 jsg Exp $ */
/*
* Copyright © 2006-2008 Intel Corporation
* Jesse Barnes <jesse.barnes@intel.com>
@@ -824,46 +824,19 @@ static const struct tv_mode tv_modes[] = {
},
};
-struct intel_tv *enc_to_intel_tv(struct drm_encoder *);
-struct intel_tv *intel_attached_tv(struct drm_connector *);
-void intel_tv_dpms(struct drm_encoder *, int);
-const struct tv_mode *intel_tv_mode_lookup(const char *);
-const struct tv_mode *intel_tv_mode_find(struct intel_tv *);
-enum drm_mode_status intel_tv_mode_valid(struct drm_connector *,
- struct drm_display_mode *);
-bool intel_tv_mode_fixup(struct drm_encoder *, const struct drm_display_mode *,
- struct drm_display_mode *);
-void intel_tv_mode_set(struct drm_encoder *, struct drm_display_mode *,
- struct drm_display_mode *);
-int intel_tv_detect_type(struct intel_tv *, struct drm_connector *);
-void intel_tv_find_better_format(struct drm_connector *);
-enum drm_connector_status intel_tv_detect(struct drm_connector *, bool);
-void intel_tv_chose_preferred_modes(struct drm_connector *,
- struct drm_display_mode *);
-int intel_tv_get_modes(struct drm_connector *);
-void intel_tv_destroy(struct drm_connector *);
-int intel_tv_set_property(struct drm_connector *, struct drm_property *,
- uint64_t);
-int tv_is_present_in_vbt(struct drm_device *);
-bool intel_tv_get_hw_state(struct intel_encoder *, enum pipe *);
-void intel_enable_tv(struct intel_encoder *);
-void intel_disable_tv(struct intel_encoder *);
-
-struct intel_tv *
-enc_to_intel_tv(struct drm_encoder *encoder)
+static struct intel_tv *enc_to_intel_tv(struct drm_encoder *encoder)
{
return container_of(encoder, struct intel_tv, base.base);
}
-struct intel_tv *
-intel_attached_tv(struct drm_connector *connector)
+static struct intel_tv *intel_attached_tv(struct drm_connector *connector)
{
return container_of(intel_attached_encoder(connector),
struct intel_tv,
base);
}
-bool
+static bool
intel_tv_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe)
{
struct drm_device *dev = encoder->base.dev;
@@ -878,7 +851,7 @@ intel_tv_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe)
return true;
}
-void
+static void
intel_enable_tv(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
@@ -887,7 +860,7 @@ intel_enable_tv(struct intel_encoder *encoder)
I915_WRITE(TV_CTL, I915_READ(TV_CTL) | TV_ENC_ENABLE);
}
-void
+static void
intel_disable_tv(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
@@ -896,7 +869,7 @@ intel_disable_tv(struct intel_encoder *encoder)
I915_WRITE(TV_CTL, I915_READ(TV_CTL) & ~TV_ENC_ENABLE);
}
-const struct tv_mode *
+static const struct tv_mode *
intel_tv_mode_lookup(const char *tv_format)
{
int i;
@@ -910,13 +883,13 @@ intel_tv_mode_lookup(const char *tv_format)
return NULL;
}
-const struct tv_mode *
+static const struct tv_mode *
intel_tv_mode_find(struct intel_tv *intel_tv)
{
return intel_tv_mode_lookup(intel_tv->tv_format);
}
-enum drm_mode_status
+static enum drm_mode_status
intel_tv_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
@@ -932,7 +905,7 @@ intel_tv_mode_valid(struct drm_connector *connector,
}
-bool
+static bool
intel_tv_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
@@ -950,7 +923,7 @@ intel_tv_mode_fixup(struct drm_encoder *encoder,
return true;
}
-void
+static void
intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
@@ -1190,7 +1163,7 @@ static const struct drm_display_mode reported_modes[] = {
* \return true if TV is connected.
* \return false if TV is disconnected.
*/
-int
+static int
intel_tv_detect_type(struct intel_tv *intel_tv,
struct drm_connector *connector)
{
@@ -1296,8 +1269,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
* Here we set accurate tv format according to connector type
* i.e Component TV should not be assigned by NTSC or PAL
*/
-void
-intel_tv_find_better_format(struct drm_connector *connector)
+static void intel_tv_find_better_format(struct drm_connector *connector)
{
struct intel_tv *intel_tv = intel_attached_tv(connector);
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv);
@@ -1327,7 +1299,7 @@ intel_tv_find_better_format(struct drm_connector *connector)
* Currently this always returns CONNECTOR_STATUS_UNKNOWN, as we need to be sure
* we have a pipe programmed in order to probe the TV.
*/
-enum drm_connector_status
+static enum drm_connector_status
intel_tv_detect(struct drm_connector *connector, bool force)
{
struct drm_display_mode mode;
@@ -1372,7 +1344,7 @@ static const struct input_res {
/*
* Chose preferred mode according to line number of TV format
*/
-void
+static void
intel_tv_chose_preferred_modes(struct drm_connector *connector,
struct drm_display_mode *mode_ptr)
{
@@ -1397,7 +1369,7 @@ intel_tv_chose_preferred_modes(struct drm_connector *connector,
* how to probe modes off of TV connections.
*/
-int
+static int
intel_tv_get_modes(struct drm_connector *connector)
{
struct drm_display_mode *mode_ptr;
@@ -1452,7 +1424,7 @@ intel_tv_get_modes(struct drm_connector *connector)
return count;
}
-void
+static void
intel_tv_destroy(struct drm_connector *connector)
{
#if 0
@@ -1463,7 +1435,7 @@ intel_tv_destroy(struct drm_connector *connector)
}
-int
+static int
intel_tv_set_property(struct drm_connector *connector, struct drm_property *property,
uint64_t val)
{
@@ -1546,8 +1518,7 @@ static const struct drm_encoder_funcs intel_tv_enc_funcs = {
* If it is not present, return false.
* If no child dev is parsed from VBT, it assumes that the TV is present.
*/
-int
-tv_is_present_in_vbt(struct drm_device *dev)
+static int tv_is_present_in_vbt(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct child_device_config *p_child;