All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/10] i915 init-time configuration (v2)
@ 2015-04-13 20:51 Bob Paauwe
  2015-04-13 20:51 ` [RFC 01/10] drm/i915/config: Initial framework Bob Paauwe
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

Background:

This capability is targeted at deeply embedded appliance like devices
that make use of Intel integrated graphics.  There are a few use cases
that are not currently supported by the i915 driver.  For example,
they may not be running user space code that is capable of querying and
setting the various DRM properties and would like them set during the
driver initialization. Also they may be using a custom firmware bootloader
that does not include any graphics initialization or VBT information.

This level of initialization configuration has been available in
the Intel EMGD kernel driver and a similar level of configurability will
be expected as designs transition to the i915 driver.

This patch set provides a framework that makes use of ACPI property
tables containing configuration information.  It also includes some
examples on how this may be applied to various aspects of the i915
driver initialization.

V2 removes the support for replacing the internal workaround list and
the support for overriding the VBT values.  Instead there are
patches to configure the specific items that the EMGD kernel driver
currently allows customers to override. There are also patches to
make the values of those items available via debugfs.  I've also
removed the code that embeds an ACPI property table into the driver
as the ACPICA code doesn't really support loading and unloading a 
table like this and would fail after a couple of driver load/unload
cycles.

Series description:

Patch 1 is the framework.  It loads the ACPI property table and builds
some lists containing the configuration found in that table. There
are functions for looking up and applying the configuration.

Patch 2 checks for a CRTC bits-per-color configuration and uses
that if EDID does not provide the value.

Patch 3 replaces the attach_property function with a call to a
configuration function that can override the default property value
with one from the configuration table.

Patch 4 is an example of using the configuration to specify a
default value for the DP panel fitter property.

Patch 5 allows the configuration table to override the DP max link
rate value.

Patch 6 allows the configuration table to override the eDP panel
power sequence delay values.

Patch 7 allows the configuration table to override the eDP
backlight max (inverter frequency) and level (duty cycle) values.

Patch 8 adds the eDP panel power sequence values to the debugfs
output (i915_display_info)

Patch 9 adds the eDP backlight values to the debugfs output
(i915_display_info)

Patch 10 is an example ACPI property table to give some context
to the above code.  It can be compiled and placed in
/lib/firmware/drm_i915.aml for testing the code.

Bob Paauwe (10):
  drm/i915/config: Initial framework
  drm/i915/config: Add init-time configuration of bits per color.
  drm/i915/config: Add init-time configuration of general connector
    properties.
  drm/i915/config: Add init-time configuration of dp panel fitter
    property.
  drm/i915/config: Add init-time configuration of DP max link rate.
  drm/i915/config: Add init-time configuration of eDP PPS delays.
  drm/i915/config: Add init-time configuration of eDP backlight
    settings.
  drm/i915: Add PPS delay values to debugfs.
  drm/i915: Add backlight max and level to debugfs output.
  drm/i915/config: An example/test ACPI property table.

 drivers/gpu/drm/i915/Makefile            |   3 +-
 drivers/gpu/drm/i915/i915-properties.asl | 167 +++++++++
 drivers/gpu/drm/i915/i915_debugfs.c      |  18 +-
 drivers/gpu/drm/i915/i915_dma.c          |   4 +
 drivers/gpu/drm/i915/i915_drv.h          |  17 +
 drivers/gpu/drm/i915/i915_params.c       |   6 +
 drivers/gpu/drm/i915/intel_config.c      | 558 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c     |  14 +
 drivers/gpu/drm/i915/intel_dp.c          |  36 +-
 drivers/gpu/drm/i915/intel_drv.h         |  27 ++
 drivers/gpu/drm/i915/intel_modes.c       |   4 +-
 drivers/gpu/drm/i915/intel_panel.c       |   8 +
 12 files changed, 852 insertions(+), 10 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/i915-properties.asl
 create mode 100644 drivers/gpu/drm/i915/intel_config.c

-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [RFC 01/10] drm/i915/config: Initial framework
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 02/10] drm/i915/config: Add init-time configuration of bits per color Bob Paauwe
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

This adds an init-time configuration framework that parses configuration
data from an ACPI property table. The table is assumed to have well
defined sub-device property tables that correspond to the various
driver components.  Initially the following sub-device tables are
defined:

CRTC (CRTC)
   The CRTC sub-device table contains additional sub-device tables
   where each one corresponds to a CRTC.  Each CRTC sub-device must
   include a property called "id" whose value matches the driver's
   crtc id. Additional properties for the CRTC are used to configure
   the crtc.

Connector (CNCT)
   The CNCT sub-device table contains additional sub-device tables
   where each one corresponds to a connector. Each of the connector
   sub-device tables must include a property called "name" whose value
   matches a connector name assigned by the driver (see later patch
   for output name function). Additional connector properties can
   be set through these tables.

Plane (PLNS)
   The PLNS sub-device table contains additional sub-device tables
   where each one corresponds to a plane.  [this needs additional work]

In addition, the main device property table for the device may
contain configuration information that applies to general driver
configuration.

The framework includes a couple of helper functions to access the
configuration data.

   intel_config_get_integer() will look up a configuration property
   and return the integer value associated with it.

   intel_config_init_<component>_property() will look up a
   configuration property and assign the value to a drm
   property of the same name.  These functions are used to
   initialize drm property instances to specific values.

v2: Add plane/connector properties to proper lists. (Bob)
    Abstract out the list cleanup (Jani)
    Squash patch that abstracted list allocation (Jani)
    Use module parameter for firmware file if it exist (Jani)
    Use defined name to access table handle (Bob)
    Remove the acpi table bind/unbind (Bob)
    Make firmware struct part of the config (Bob)
    Release firmware on shutdown (Bob)
    Free allocated intel_config_info on shutdown (Bob)

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/Makefile       |   3 +-
 drivers/gpu/drm/i915/i915_dma.c     |   4 +
 drivers/gpu/drm/i915/i915_drv.h     |  17 ++
 drivers/gpu/drm/i915/i915_params.c  |   6 +
 drivers/gpu/drm/i915/intel_config.c | 558 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h    |  27 ++
 6 files changed, 614 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/i915/intel_config.c

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index a69002e..2c30112 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -12,7 +12,8 @@ i915-y := i915_drv.o \
           i915_suspend.o \
 	  i915_sysfs.o \
 	  intel_pm.o \
-	  intel_runtime_pm.o
+	  intel_runtime_pm.o \
+	  intel_config.o
 
 i915-$(CONFIG_COMPAT)   += i915_ioc32.o
 i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index e44116f..e18dac2 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -803,6 +803,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 	dev->dev_private = dev_priv;
 	dev_priv->dev = dev;
 
+	intel_config_init(dev);
+
 	/* Setup the write-once "constant" device info */
 	device_info = (struct intel_device_info *)&dev_priv->info;
 	memcpy(device_info, info, sizeof(dev_priv->info));
@@ -1078,6 +1080,8 @@ int i915_driver_unload(struct drm_device *dev)
 
 	intel_fbdev_fini(dev);
 
+	intel_config_shutdown(dev);
+
 	drm_vblank_cleanup(dev);
 
 	intel_modeset_cleanup(dev);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 79da7f3..1484439 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1557,6 +1557,21 @@ struct i915_virtual_gpu {
 	bool active;
 };
 
+struct intel_config_node {
+	struct acpi_device *adev;
+	struct list_head node;
+	struct list_head list;
+};
+
+struct intel_config_info {
+	const struct firmware *fw;
+	struct intel_config_node base;
+	struct list_head crtc_list;
+	struct list_head connector_list;
+	struct list_head plane_list;
+};
+
+
 struct drm_i915_private {
 	struct drm_device *dev;
 	struct kmem_cache *objects;
@@ -1800,6 +1815,7 @@ struct drm_i915_private {
 	u32 long_hpd_port_mask;
 	u32 short_hpd_port_mask;
 	struct work_struct dig_port_work;
+	struct intel_config_info *config_info;
 
 	/*
 	 * if we get a HPD irq from DP and a HPD irq from non-DP
@@ -2477,6 +2493,7 @@ struct i915_params {
 	int enable_ips;
 	int invert_brightness;
 	int enable_cmd_parser;
+	char cfg_firmware[PATH_MAX];
 	/* leave bools at the end to not create holes */
 	bool enable_hangcheck;
 	bool fastboot;
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index bb64415..e7f7aaa 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -53,6 +53,7 @@ struct i915_params i915 __read_mostly = {
 	.mmio_debug = 0,
 	.verbose_state_checks = 1,
 	.nuclear_pageflip = 0,
+	.cfg_firmware = "",
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -184,3 +185,8 @@ MODULE_PARM_DESC(verbose_state_checks,
 module_param_named_unsafe(nuclear_pageflip, i915.nuclear_pageflip, bool, 0600);
 MODULE_PARM_DESC(nuclear_pageflip,
 		 "Force atomic modeset functionality; only planes work for now (default: false).");
+
+module_param_string(cfg_firmware, i915.cfg_firmware, sizeof(i915.cfg_firmware), 0444);
+MODULE_PARM_DESC(cfg_firmware,
+		 "Load configuration firmware from built-in data or /lib/firmware. ");
+
diff --git a/drivers/gpu/drm/i915/intel_config.c b/drivers/gpu/drm/i915/intel_config.c
new file mode 100644
index 0000000..38f8540
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_config.c
@@ -0,0 +1,558 @@
+/*
+ * i915 configuration via ACPI device properties.
+ *
+ * Copyright (C) 2014, 2015 Intel Corporation
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+#include <linux/acpi.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/firmware.h>
+#include <linux/ctype.h>
+#include <acpi/acpi_bus.h>
+#include "intel_drv.h"
+#include <drm/i915_drm.h>
+#include "i915_drv.h"
+#include "i915_trace.h"
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_crtc_helper.h>
+
+
+#define i915_ACPI_PRP_ROOT "\\_SB.PRP.GFX0"
+
+/*
+ * Load an ACPI property table into the ACPI subsystem.
+ *
+ * First, verify that a table isn't already loaded.  The table may
+ * be part of the ACPI firmware and thus loaded by the ACPI sub-system
+ * during boot.  It is also possible for ACPI sub-system to load tables
+ * to override those supplied by the firmware.
+ *
+ * If a property table for the GFX device has not been loaded, attempt
+ * to load one from /lib/firmware here.  The name will default to
+ * drm_i915.aml but the name be overridden by the cfg_firmware module
+ * parameter.
+ *
+ * The order of precidence for table loading is:
+ *   - dyanamic table loaded by ACPI driver
+ *   - table built into firmware
+ *   - dynamic table loaded based on driver name or module parameter
+ *
+ * If the table is loaded by the driver, it will be unloaded when the
+ * driver module is unloaded.  Tables that are part of the firmware or
+ * overridden by the ACPI driver are not unloaded and cannot be replaced
+ * by tables loaded by the driver.
+ */
+static int intel_acpi_load_table(struct drm_device *dev, char *firmware,
+				 struct intel_config_info *info)
+{
+	struct acpi_table_header *table;
+	acpi_status status;
+	acpi_handle handle;
+	struct acpi_device *acpi_dev = NULL;
+	int ret = 0;
+
+	/* make sure the table isn't already loaded before loading it */
+	status = acpi_get_handle(ACPI_ROOT_OBJECT, i915_ACPI_PRP_ROOT, &handle);
+	if (ACPI_FAILURE(status)) {
+
+		/* Try to dynamically load a table.... */
+		DRM_DEBUG_DRIVER("Requesting configuration table: %s\n",
+				 firmware);
+		ret = request_firmware(&info->fw, firmware, dev->dev);
+		if (ret != 0) {
+			DRM_ERROR("Failed to find ACPI table %s: %d\n",
+				  firmware, ret);
+			info->fw = NULL;
+			goto bad_table;
+		} else {
+			table = (struct acpi_table_header *)info->fw->data;
+		}
+
+		/* Load the table into the acpi device. */
+		status = acpi_load_table(table);
+		if (ACPI_FAILURE(status))
+			goto bad_table;
+
+		add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, true);
+
+		/* Get a handle and scan the bus */
+		status = acpi_get_handle(ACPI_ROOT_OBJECT, i915_ACPI_PRP_ROOT,
+					 &handle);
+		if (ACPI_FAILURE(status))
+			goto bad_table;
+
+		acpi_bus_scan(handle);
+
+		/* Not using this, why make the call? */
+		if (acpi_bus_get_device(handle, &acpi_dev))
+			goto bad_table;
+
+	} else {
+		DRM_DEBUG_DRIVER("ACPI Property table previously loaded for _SB.PRP.GFX0\n");
+	}
+
+	return 0;
+
+bad_table:
+	release_firmware(info->fw);
+	return -ENODEV;
+}
+
+/*
+ * Use ACPI methods to get the property.
+ *
+ * This isn't using the generic device_property_read because that
+ * can only access properties associated with the actual device. It
+ * doesn't understand our sub-component property tree.
+ */
+static bool node_property(struct intel_config_node *n,
+			  const char *prop,
+			  void *value)
+{
+	int ret = 0;
+	const union acpi_object *obj;
+
+	ret = acpi_dev_get_property(n->adev, prop, ACPI_TYPE_ANY, &obj);
+	if (ret == -ENODATA) {
+		/*
+		 * This isn't really a failure, it's ok if the property
+		 * doesn't exist. The message is for debug purposes only.
+		 */
+		DRM_DEBUG_DRIVER("Property \"%s\" not found in %s\n",
+				 prop, acpi_device_bid(n->adev));
+	} else if (ret == -EINVAL) {
+		DRM_ERROR("Invalid acpi device or property name.\n");
+	} else if (ret) {
+		/* This is a failure. */
+		DRM_ERROR("Property request failed for %s: %d\n", prop, ret);
+	} else {
+		switch (obj->type) {
+		case ACPI_TYPE_INTEGER:
+			*(u32 *)value = obj->integer.value;
+			break;
+		case ACPI_TYPE_STRING:
+			*(char **)value = obj->string.pointer;
+			break;
+		default:
+			DRM_ERROR("Unsupported property type, only support integer and string.\n");
+			ret = -1;
+			break;
+		}
+	}
+
+	return ret == 0;
+}
+
+
+static bool alloc_new_node(struct acpi_device *cl, struct list_head *list)
+{
+	struct intel_config_node *new_node;
+
+	new_node = kzalloc(sizeof(*new_node), GFP_KERNEL);
+	if (!new_node)
+		return false;
+
+	new_node->adev = cl;
+	INIT_LIST_HEAD(&new_node->node);
+	list_add_tail(&new_node->node, list);
+
+	return true;
+}
+
+static void list_cleanup(struct intel_config_info *info)
+{
+	struct intel_config_node *n, *tmp;
+
+	list_for_each_entry_safe(n, tmp, &info->crtc_list, node)
+		kfree(n);
+	list_for_each_entry_safe(n, tmp, &info->connector_list, node)
+		kfree(n);
+	list_for_each_entry_safe(n, tmp, &info->plane_list, node)
+		kfree(n);
+}
+
+/**
+ * intel_config_init -
+ *
+ * Initialize the configuration framework by attempting to load a
+ * property table and parse the contents into component lists.
+ *
+ * @dev: The drm driver device.
+ */
+void intel_config_init(struct drm_device *dev)
+{
+	struct intel_config_info *info;
+	acpi_handle handle;
+	struct acpi_device *cl, *component;
+	char *cname;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
+	if (!info) {
+		DRM_ERROR("Failed to allocate memory for configuration.\n");
+		return;
+	}
+
+	/* Load an ACPI table from /lib/firmware.  */
+	if (i915.cfg_firmware[0] == '\0')
+	    snprintf(i915.cfg_firmware, PATH_MAX, "drm_%s.aml",
+		     dev->driver->name);
+
+	if (intel_acpi_load_table(dev, i915.cfg_firmware, info) != 0) {
+		DRM_ERROR("Failed to load ACPI device property table.\n");
+		return;
+	}
+
+	DRM_DEBUG_DRIVER("Loaded ACPI configuration for %s\n",
+			 dev->driver->name);
+
+	INIT_LIST_HEAD(&info->base.list);
+	INIT_LIST_HEAD(&info->crtc_list);
+	INIT_LIST_HEAD(&info->connector_list);
+	INIT_LIST_HEAD(&info->plane_list);
+
+	acpi_get_handle(ACPI_ROOT_OBJECT, i915_ACPI_PRP_ROOT, &handle);
+	if (!handle) {
+		DRM_DEBUG_DRIVER("No associated ACPI handle.\n");
+		kfree(info);
+		return;
+	} else {
+		acpi_bus_get_device(handle, &info->base.adev);
+	}
+
+	/*
+	 * Create a list of one for the top level driver config.
+	 *
+	 * We don't really need a full config_info structure for this but
+	 * it simplifies the handling of driver general config settings
+	 * as we don't have to have a special case and unique structure
+	 * just for this.
+	 */
+	INIT_LIST_HEAD(&info->base.node);
+	list_add_tail(&info->base.node, &info->base.list);
+
+/* Component sub-device ACPI names */
+#define i915_COMPONENT_CRTC "CRTC"
+#define i915_COMPONENT_CONNECTOR "CNCT"
+#define i915_COMPONENT_PLANE "PLNS"
+
+	/* Build lists */
+	list_for_each_entry(component, &info->base.adev->children, node) {
+		if (!component)
+			continue;
+
+		cname = acpi_device_bid(component);
+
+		if (strcmp(cname, i915_COMPONENT_CRTC) == 0) {
+			list_for_each_entry(cl, &component->children, node) {
+				if (!alloc_new_node(cl, &info->crtc_list))
+					goto bail;
+			}
+		} else if (strcmp(cname, i915_COMPONENT_CONNECTOR) == 0) {
+			list_for_each_entry(cl, &component->children, node) {
+				if (!alloc_new_node(cl, &info->connector_list))
+					goto bail;
+			}
+		} else if (strcmp(cname, i915_COMPONENT_PLANE) == 0) {
+			list_for_each_entry(cl, &component->children, node) {
+				if (!alloc_new_node(cl, &info->plane_list))
+					goto bail;
+			}
+		}
+	}
+
+	dev_priv->config_info = info;
+	DRM_DEBUG_DRIVER("i915 Configuration loaded.\n");
+	return;
+
+bail:
+	DRM_DEBUG_DRIVER("i915 Configuration aborted, insufficient memory.\n");
+	list_cleanup(info);
+	kfree(info);
+	dev_priv->config_info = NULL;
+}
+
+
+/**
+ * Clean up the configuration infrastructure as the driver is
+ * shuting down.  Don't leak memory!
+ *
+ * @dev: The drm driver device.
+ */
+void intel_config_shutdown(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	acpi_handle handle;
+	acpi_status status;
+	struct acpi_device *adev;
+	struct intel_config_info *info;
+
+	if (dev_priv->config_info == NULL)
+		return;
+
+	/* Free the component lists.  */
+	info = dev_priv->config_info;
+	adev = info->base.adev;
+	list_cleanup(info);
+
+	/* Unload any dynamically loaded ACPI property table */
+	status = acpi_get_handle(ACPI_ROOT_OBJECT, i915_ACPI_PRP_ROOT,
+				 &handle);
+	if (ACPI_FAILURE(status)) {
+		DRM_ERROR("Failed to locate dynamic ACPI table.");
+		return;
+	}
+
+	if (handle) {
+		DRM_DEBUG_DRIVER("Unloading dynamic i915 Configuration ACPI table.\n");
+		acpi_bus_trim(adev);
+
+		status = acpi_unload_parent_table(handle);
+		if (ACPI_FAILURE(status))
+			DRM_ERROR("Failed to unload the i915 Configuration"
+				  "ACPI table. %d\n", status);
+	}
+
+	if (info->fw)
+		release_firmware(info->fw);
+
+	kfree(info);
+}
+
+
+
+/*
+ * does_name_match
+ *
+ * The various drm components have names assocated with them. To link
+ * a component in the ACPI property tree, use a "special" property
+ * called "name".
+ *
+ * The exception is the general driver properties.  There is no "name"
+ * property associated with those.  We could force one, but that may
+ * be less intuitive than leaving the name empty.
+ *
+ * This function look for a property called "name" and compares the
+ * value of that property with the passed in name parameter.
+ */
+static bool does_name_match(struct intel_config_node *node, const char *name)
+{
+	char *p_name;
+
+	/*
+	 * General driver properties aren't in a section with a "name"
+	 * property. Thus this should just return true in that case.
+	 */
+	if (!name || strlen(name) == 0)
+		return true;
+
+
+	/* Look up a name property and see if it matches */
+	if (node_property(node, "name", &p_name)) {
+		if (strcmp(name, p_name) == 0)
+			return true;
+	}
+
+	return false;
+}
+
+
+/*
+ * Map the configuration sub component enum to the cached
+ * sub component list.
+ */
+static struct list_head *cfg_type_to_list(struct intel_config_info *info,
+					  enum cfg_type cfg_type)
+{
+	switch (cfg_type) {
+	case CFG_DRV:
+		return &info->base.list;
+	case CFG_CRTC:
+		return &info->crtc_list;
+	case CFG_CONNECTOR:
+		return &info->connector_list;
+	case CFG_PLANE:
+		return &info->plane_list;
+	}
+	return NULL;
+}
+
+/*
+ * Integer property.
+ *
+ * Look up a property and set the value pointer to the property value.
+ *
+ * returns true if the property was found, false if not.
+ */
+bool intel_config_get_integer(struct drm_i915_private *dev_priv,
+			      enum cfg_type cfg_type,
+			      const char *name,
+			      const char *property,
+			      uint32_t *value)
+{
+	struct intel_config_info *info = dev_priv->config_info;
+	struct intel_config_node *n;
+	struct list_head *list;
+
+	if (!info)
+		return false;
+
+	list = cfg_type_to_list(info, cfg_type);
+	if (!list)
+		return false;
+
+	list_for_each_entry(n, list, node) {
+		if (does_name_match(n, name)) {
+			if (node_property(n, property, value))
+				return true;
+		}
+	}
+
+	return false;
+}
+
+/*
+ * Look up a drm property name in the configuration store and if
+ * found, return the value.
+ *
+ * A default value is included in the parameter list so that something
+ * reasonable is returned if the lookup fails to find a matching
+ * configuration key.
+ */
+static uint64_t lookup_property(struct drm_i915_private *dev_priv,
+				const char *name,
+				struct drm_property *property,
+				enum cfg_type cfg_type,
+				uint64_t dflt)
+{
+	struct intel_config_info *info = dev_priv->config_info;
+	struct drm_property_enum *prop_enum;
+	const char *value;
+	uint64_t retval = dflt;
+	struct intel_config_node *n;
+	struct list_head *list;
+
+	list = cfg_type_to_list(info, cfg_type);
+	if (!list)
+		goto out;
+
+	list_for_each_entry(n, list, node) {
+		if (!does_name_match(n, name))
+			continue;
+		/*
+		 * FIXME: This is assuming that the type is string
+		 * for enun drm properties.  This should be more
+		 * generic and map drm property types to ACPI property
+		 * types.
+		 */
+		if (!node_property(n, property->name, &value))
+			continue;
+
+		/* Look for a matching enum */
+		list_for_each_entry(prop_enum, &property->enum_list, head) {
+			if (strcmp(value, prop_enum->name) == 0) {
+				retval = prop_enum->value;
+				goto out;
+			}
+		}
+	}
+
+out:
+	return retval;
+}
+
+/*
+ * Connector properties.
+ *
+ * If a connector drm property has a corresponding configuration property,
+ * use the configuration property value to initialize the drm property.
+ */
+uint64_t intel_config_init_connector_property(struct drm_connector *connector,
+					      struct drm_property *property,
+					      uint64_t dflt)
+{
+	struct drm_i915_private *dev_priv = connector->dev->dev_private;
+	struct intel_config_info *info = dev_priv->config_info;
+	uint64_t retval = dflt;
+
+	if (!info)
+		goto out;
+
+	retval = lookup_property(dev_priv, connector->name, property,
+				 CFG_CONNECTOR, dflt);
+
+out:
+	drm_object_attach_property(&connector->base, property, retval);
+	return retval;
+}
+
+
+/*
+ * Plane properties.
+ *
+ * If a plane drm property has a corresponding configuration property,
+ * use the configuration property value to initialize the drm property.
+ */
+uint64_t intel_config_init_plane_property(struct drm_plane *plane,
+					  const char *name,
+					  struct drm_property *property,
+					  uint64_t dflt)
+{
+	struct drm_i915_private *dev_priv = plane->dev->dev_private;
+	struct intel_config_info *info = dev_priv->config_info;
+	uint64_t retval = dflt;
+
+	if (!info)
+		goto out;
+
+	retval = lookup_property(dev_priv, name, property, CFG_PLANE, dflt);
+
+out:
+	drm_object_attach_property(&plane->base, property, retval);
+	return retval;
+}
+
+
+/*
+ * CRTC properties.
+ *
+ * If a crtc drm property has a corresponding configuration property,
+ * use the configuration property value to initialize the drm property.
+ */
+uint64_t intel_config_init_crtc_property(struct drm_crtc *crtc,
+					 const char *name,
+					 struct drm_property *property,
+					 uint64_t dflt)
+{
+	struct drm_i915_private *dev_priv = crtc->dev->dev_private;
+	struct intel_config_info *info = dev_priv->config_info;
+	uint64_t retval = dflt;
+
+	if (!info)
+		goto out;
+
+	retval = lookup_property(dev_priv, name, property, CFG_CRTC, dflt);
+
+out:
+	drm_object_attach_property(&crtc->base, property, retval);
+	return retval;
+}
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 6a2ee0c..8c40a97 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1407,4 +1407,31 @@ void intel_plane_destroy_state(struct drm_plane *plane,
 			       struct drm_plane_state *state);
 extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
 
+/* intel_config.c */
+enum cfg_type {
+	CFG_DRV,
+	CFG_CRTC,
+	CFG_CONNECTOR,
+	CFG_PLANE
+};
+
+void intel_config_init(struct drm_device *dev);
+void intel_config_shutdown(struct drm_device *dev);
+bool intel_config_get_integer(struct drm_i915_private *dev_priv,
+			  enum cfg_type cfg_type,
+			  const char *name,
+			  const char *property,
+			  uint32_t *value);
+uint64_t intel_config_init_connector_property(struct drm_connector *connector,
+			  struct drm_property *property,
+			  uint64_t dflt);
+uint64_t intel_config_init_plane_property(struct drm_plane *plane,
+			  const char *name,
+			  struct drm_property *property,
+			  uint64_t dflt);
+uint64_t intel_config_init_crtc_property(struct drm_crtc *crtc,
+			  const char *name,
+			  struct drm_property *property,
+			  uint64_t dflt);
+
 #endif /* __INTEL_DRV_H__ */
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 02/10] drm/i915/config: Add init-time configuration of bits per color.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
  2015-04-13 20:51 ` [RFC 01/10] drm/i915/config: Initial framework Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 03/10] drm/i915/config: Add init-time configuration of general connector properties Bob Paauwe
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

Allow the init-time configuration to specify the bits per color value
that gets used if bits per color is not present in EDID data (or if EDID
is not present).

v2: Use connector->base.name for connector name (Jani)

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 97922fb..e50dbbd0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10744,6 +10744,20 @@ connected_sink_compute_bpp(struct intel_connector *connector,
 		connector->base.base.id,
 		connector->base.name);
 
+	/* If !bpc then see if one was specified in the static configuation */
+	if (connector->base.display_info.bpc == 0) {
+		/*
+		 * This is making the assumption that the static configuration
+		 * will use the names defined in the drm_connector_enum_list
+		 * array to identify the connector.
+		 */
+		intel_config_get_integer(to_i915(connector->base.dev),
+					CFG_CONNECTOR,
+					connector->base.name,
+					"bits_per_color",
+					&connector->base.display_info.bpc);
+	}
+
 	/* Don't use an invalid EDID bpc value */
 	if (connector->base.display_info.bpc &&
 	    connector->base.display_info.bpc * 3 < bpp) {
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 03/10] drm/i915/config: Add init-time configuration of general connector properties.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
  2015-04-13 20:51 ` [RFC 01/10] drm/i915/config: Initial framework Bob Paauwe
  2015-04-13 20:51 ` [RFC 02/10] drm/i915/config: Add init-time configuration of bits per color Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 04/10] drm/i915/config: Add init-time configuration of dp panel fitter property Bob Paauwe
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

Set the initial value of the force audio and broadcast rgb properties
using property values found in the init-time configuration.

v2: Use drm connector name (Jani)

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/intel_modes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index 0e860f3..2366d86 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -96,7 +96,7 @@ intel_attach_force_audio_property(struct drm_connector *connector)
 
 		dev_priv->force_audio_property = prop;
 	}
-	drm_object_attach_property(&connector->base, prop, 0);
+	intel_config_init_connector_property(connector, prop, 0);
 }
 
 static const struct drm_prop_enum_list broadcast_rgb_names[] = {
@@ -124,5 +124,5 @@ intel_attach_broadcast_rgb_property(struct drm_connector *connector)
 		dev_priv->broadcast_rgb_property = prop;
 	}
 
-	drm_object_attach_property(&connector->base, prop, 0);
+	intel_config_init_connector_property(connector, prop, 0);
 }
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 04/10] drm/i915/config: Add init-time configuration of dp panel fitter property.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
                   ` (2 preceding siblings ...)
  2015-04-13 20:51 ` [RFC 03/10] drm/i915/config: Add init-time configuration of general connector properties Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 05/10] drm/i915/config: Add init-time configuration of DP max link rate Bob Paauwe
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

Use the init-time configuration setting for scaling_mode to set the
initial value of the scaling_mode connector property.

v2: Use drm connector name (Jani)

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 14cdd00..b6944b9 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4785,6 +4785,7 @@ void
 intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector)
 {
 	struct intel_connector *intel_connector = to_intel_connector(connector);
+	uint64_t fitting_mode;
 
 	intel_attach_force_audio_property(connector);
 	intel_attach_broadcast_rgb_property(connector);
@@ -4792,11 +4793,11 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
 
 	if (is_edp(intel_dp)) {
 		drm_mode_create_scaling_mode_property(connector->dev);
-		drm_object_attach_property(
-			&connector->base,
+		fitting_mode = intel_config_init_connector_property(
+			connector,
 			connector->dev->mode_config.scaling_mode_property,
 			DRM_MODE_SCALE_ASPECT);
-		intel_connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
+		intel_connector->panel.fitting_mode = (int)fitting_mode;
 	}
 }
 
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 05/10] drm/i915/config: Add init-time configuration of DP max link rate.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
                   ` (3 preceding siblings ...)
  2015-04-13 20:51 ` [RFC 04/10] drm/i915/config: Add init-time configuration of dp panel fitter property Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 06/10] drm/i915/config: Add init-time configuration of eDP PPS delays Bob Paauwe
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

If the sink does not provide a maximum link rate, then check the
connector configuration before defaulting to the lowest allowed
link rate.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b6944b9..b05ff6d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -129,6 +129,9 @@ static int
 intel_dp_max_link_bw(struct intel_dp  *intel_dp)
 {
 	int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
+	int cfg_max_link_bw = DP_LINK_BW_1_62;
+	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+	struct drm_device *dev = intel_dig_port->base.base.dev;
 
 	switch (max_link_bw) {
 	case DP_LINK_BW_1_62:
@@ -136,9 +139,15 @@ intel_dp_max_link_bw(struct intel_dp  *intel_dp)
 	case DP_LINK_BW_5_4:
 		break;
 	default:
-		WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
-		     max_link_bw);
-		max_link_bw = DP_LINK_BW_1_62;
+		intel_config_get_integer(to_i915(dev),
+					 CFG_CONNECTOR,
+					 intel_dp->attached_connector->base.name,
+					 "Maximum DPCD Rate",
+					 &cfg_max_link_bw);
+
+		WARN(1, "invalid max DP link bw val %x, using %x\n",
+		     max_link_bw, cfg_max_link_bw);
+		max_link_bw = cfg_max_link_bw;
 		break;
 	}
 	return max_link_bw;
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 06/10] drm/i915/config: Add init-time configuration of eDP PPS delays.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
                   ` (4 preceding siblings ...)
  2015-04-13 20:51 ` [RFC 05/10] drm/i915/config: Add init-time configuration of DP max link rate Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 07/10] drm/i915/config: Add init-time configuration of eDP backlight settings Bob Paauwe
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

Allow the configuration file to overide the various panel power
sequence delay values.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b05ff6d..7defb3a 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5565,6 +5565,20 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 		else
 			intel_dp_init_panel_power_sequencer(dev, intel_dp);
 		pps_unlock(intel_dp);
+
+		/* Check for config overides for PPS delays */
+#define CONFIG_PANEL_POWER_DELAY(delay_name)  \
+	intel_config_get_integer(dev_priv, CFG_CONNECTOR, \
+				 intel_dp->attached_connector->base.name, \
+				 #delay_name, \
+				 (uint32_t *)&intel_dp->pps_delays.delay_name)
+
+		CONFIG_PANEL_POWER_DELAY(t1_t3);
+		CONFIG_PANEL_POWER_DELAY(t8);
+		CONFIG_PANEL_POWER_DELAY(t9);
+		CONFIG_PANEL_POWER_DELAY(t10);
+		CONFIG_PANEL_POWER_DELAY(t11_t12);
+#undef CONFIG_PANEL_POWER_DELAY
 	}
 
 	intel_dp_aux_init(intel_dp, intel_connector);
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 07/10] drm/i915/config: Add init-time configuration of eDP backlight settings.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
                   ` (5 preceding siblings ...)
  2015-04-13 20:51 ` [RFC 06/10] drm/i915/config: Add init-time configuration of eDP PPS delays Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 08/10] drm/i915: Add PPS delay values to debugfs Bob Paauwe
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

Allow the configuration file to overide the backlight max and level
settings.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index d8686ce..54c8cef 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -1326,6 +1326,14 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe)
 		return ret;
 	}
 
+	/* Allow config to overide backlight settings */
+	intel_config_get_integer(dev_priv, CFG_CONNECTOR,
+				 connector->name, "backlight maximum",
+				 &panel->backlight.max);
+	intel_config_get_integer(dev_priv, CFG_CONNECTOR,
+				 connector->name, "backlight level",
+				 &panel->backlight.level);
+
 	panel->backlight.present = true;
 
 	DRM_DEBUG_KMS("Connector %s backlight initialized, %s, brightness %u/%u\n",
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 08/10] drm/i915: Add PPS delay values to debugfs.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
                   ` (6 preceding siblings ...)
  2015-04-13 20:51 ` [RFC 07/10] drm/i915/config: Add init-time configuration of eDP backlight settings Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 09/10] drm/i915: Add backlight max and level to debugfs output Bob Paauwe
  2015-04-13 20:51 ` [RFC 10/10] drm/i915/config: An example/test ACPI property table Bob Paauwe
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

So that we verify which values are currently in use.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 2394924..a9b96fd 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2641,8 +2641,19 @@ static void intel_dp_info(struct seq_file *m,
 	seq_printf(m, "\tDPCD rev: %x\n", intel_dp->dpcd[DP_DPCD_REV]);
 	seq_printf(m, "\taudio support: %s\n", intel_dp->has_audio ? "yes" :
 		   "no");
-	if (intel_encoder->type == INTEL_OUTPUT_EDP)
+	if (intel_encoder->type == INTEL_OUTPUT_EDP) {
+		seq_printf(m, "\tpanel power on delay: %d\n",
+			   intel_dp->pps_delays.t1_t3);
+		seq_printf(m, "\tpanel backlight on delay: %d\n",
+			   intel_dp->pps_delays.t8);
+		seq_printf(m, "\tpanel backlight off delay: %d\n",
+			   intel_dp->pps_delays.t9);
+		seq_printf(m, "\tpanel power off delay: %d\n",
+			   intel_dp->pps_delays.t10);
+		seq_printf(m, "\tpanel power cycle delay: %d\n",
+			   intel_dp->pps_delays.t11_t12);
 		intel_panel_info(m, &intel_connector->panel);
+	}
 }
 
 static void intel_hdmi_info(struct seq_file *m,
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 09/10] drm/i915: Add backlight max and level to debugfs output.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
                   ` (7 preceding siblings ...)
  2015-04-13 20:51 ` [RFC 08/10] drm/i915: Add PPS delay values to debugfs Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  2015-04-13 20:51 ` [RFC 10/10] drm/i915/config: An example/test ACPI property table Bob Paauwe
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

To allow us to verify the current backlight max and level values.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index a9b96fd..2bac3bc 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2652,6 +2652,11 @@ static void intel_dp_info(struct seq_file *m,
 			   intel_dp->pps_delays.t10);
 		seq_printf(m, "\tpanel power cycle delay: %d\n",
 			   intel_dp->pps_delays.t11_t12);
+		seq_printf(m, "\tpanel backlight max: %d\n",
+			   intel_connector->panel.backlight.max);
+		seq_printf(m, "\tpanel backlight level: %d\n",
+			   intel_connector->panel.backlight.level);
+
 		intel_panel_info(m, &intel_connector->panel);
 	}
 }
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC 10/10] drm/i915/config: An example/test ACPI property table.
  2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
                   ` (8 preceding siblings ...)
  2015-04-13 20:51 ` [RFC 09/10] drm/i915: Add backlight max and level to debugfs output Bob Paauwe
@ 2015-04-13 20:51 ` Bob Paauwe
  9 siblings, 0 replies; 11+ messages in thread
From: Bob Paauwe @ 2015-04-13 20:51 UTC (permalink / raw)
  To: intel-gfx

This is an example of what an ACPI property table looks like.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/i915-properties.asl | 167 +++++++++++++++++++++++++++++++
 1 file changed, 167 insertions(+)
 create mode 100644 drivers/gpu/drm/i915/i915-properties.asl

diff --git a/drivers/gpu/drm/i915/i915-properties.asl b/drivers/gpu/drm/i915/i915-properties.asl
new file mode 100644
index 0000000..e97ac2e
--- /dev/null
+++ b/drivers/gpu/drm/i915/i915-properties.asl
@@ -0,0 +1,167 @@
+DefinitionBlock ("i915-properties.aml", "SSDT", 5, "", "", 0x00000001)
+{
+	External (DSEN)
+
+	Device (\_SB.PRP) {
+		Device(GFX0) {
+		Name (_ADR, 0x00020000)
+		Name (_HID, "PRP0000")
+
+		Method (_DOS, 1, NotSerialized) {
+			Store (And (Arg0, 0x07), DSEN)
+			If (LEqual (And (Arg0, 0x03), Zero)) {
+			}
+		}
+
+		Name (_DSD, Package() {
+			ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+			Package () {
+				Package() {"display_detect", 1},
+				Package() {"fastboot", 1},
+				Package() {"powersave", 0},
+				Package() {"count", 99},
+			}
+		})
+
+		Device (CRTC) {
+			Name (_HID, "PRP0000")
+			Name (_DSD, Package() {
+				ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+				Package () {
+					Package() { "enabled", "3" },
+					Package() { "count", 3 }
+				}
+			})
+
+			Device (ID0) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package() { "id", 0 },
+						Package() { "canvas_color", Package() { 0, 0, 0 } },
+						Package() { "blend_equ", 0 },
+						Package() { "enabled", 1 }
+					}
+				})
+			}
+
+			Device (ID1) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package() { "id", 1 },
+						Package() { "canvas_color", Package() { 0, 0, 0 } },
+						Package() { "blend_equ", 0 },
+						Package() { "enabled", 1 }
+					}
+				})
+			}
+
+			Device (ID2) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package() { "id", 2 },
+						Package() { "canvas_color", Package() { 0, 0, 0 } },
+						Package() { "blend_equ", 0 },
+						Package() { "enabled", 1 }
+					}
+				})
+			}
+		}
+
+		Device (PLNS) {
+			Name (_HID, "PRP0000")
+			Name (_DSD, Package() {
+				ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+				Package () {
+					Package() { "count", 2 }
+				}
+			})
+
+			Device (PL0) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package () { "gamma", 1 },
+						Package () { "color-key", 0xffffffff },
+					}
+				})
+			}
+
+			Device (PL1) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package () { "gamma", 0 },
+						Package () { "color-key", 0xffffffff },
+					}
+				})
+			}
+		}
+
+
+		Device (CNCT) {
+			Name (_HID, "PRP0000")
+			Name (_DSD, Package() {
+				ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+				Package () {
+					Package() { "count", 2 }
+				}
+			})
+
+			Device(C0) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package() { "name", "VGA-1" },
+						Package() { "enabled", 1 },
+						Package() { "bits_per_color", 6 },
+						Package() { "constant_alpha", 255 }
+					}
+				})
+			}
+
+			Device(C1) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package() { "name", "DP-1" },
+						Package() { "enabled", 1 },
+						Package() { "scaling_mode", "Full aspect" },
+						Package() { "audio", "force-dvi" },
+						Package() { "Broadcast_RGB", "Automatic" },
+						Package() { "bits_per_color", 8 },
+						Package() { "constant_alpha", 255 }
+					}
+				})
+			}
+
+			Device(C2) {
+				Name (_HID, "PRP0000")
+				Name (_DSD, Package() {
+					ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+					Package () {
+						Package() { "name", "eDP-1" },
+						Package() { "enabled", 1 },
+						Package() { "t1_t3", 2001 },
+						Package() { "t8", 0 },
+						Package() { "t9", 2001 },
+						Package() { "t10", 501 },
+						Package() { "t11_t12", 6001 },
+						Package() { "backlight level", 100 },
+					}
+				})
+			}
+		}
+	}
+	}
+}
+
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-04-13 20:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13 20:51 [RFC 00/10] i915 init-time configuration (v2) Bob Paauwe
2015-04-13 20:51 ` [RFC 01/10] drm/i915/config: Initial framework Bob Paauwe
2015-04-13 20:51 ` [RFC 02/10] drm/i915/config: Add init-time configuration of bits per color Bob Paauwe
2015-04-13 20:51 ` [RFC 03/10] drm/i915/config: Add init-time configuration of general connector properties Bob Paauwe
2015-04-13 20:51 ` [RFC 04/10] drm/i915/config: Add init-time configuration of dp panel fitter property Bob Paauwe
2015-04-13 20:51 ` [RFC 05/10] drm/i915/config: Add init-time configuration of DP max link rate Bob Paauwe
2015-04-13 20:51 ` [RFC 06/10] drm/i915/config: Add init-time configuration of eDP PPS delays Bob Paauwe
2015-04-13 20:51 ` [RFC 07/10] drm/i915/config: Add init-time configuration of eDP backlight settings Bob Paauwe
2015-04-13 20:51 ` [RFC 08/10] drm/i915: Add PPS delay values to debugfs Bob Paauwe
2015-04-13 20:51 ` [RFC 09/10] drm/i915: Add backlight max and level to debugfs output Bob Paauwe
2015-04-13 20:51 ` [RFC 10/10] drm/i915/config: An example/test ACPI property table Bob Paauwe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.