27,35 → 27,27 |
#include <linux/i2c.h> |
#include <linux/fb.h> |
#include <drm/drm_edid.h> |
#include "drmP.h" |
#include <drm/drmP.h> |
#include <drm/drm_edid.h> |
#include "intel_drv.h" |
#include "i915_drv.h" |
|
/** |
* intel_ddc_probe |
* |
* intel_connector_update_modes - update connector from edid |
* @connector: DRM connector device to use |
* @edid: previously read EDID information |
*/ |
bool intel_ddc_probe(struct intel_encoder *intel_encoder, int ddc_bus) |
int intel_connector_update_modes(struct drm_connector *connector, |
struct edid *edid) |
{ |
struct drm_i915_private *dev_priv = intel_encoder->base.dev->dev_private; |
u8 out_buf[] = { 0x0, 0x0}; |
u8 buf[2]; |
struct i2c_msg msgs[] = { |
{ |
.addr = 0x50, |
.flags = 0, |
.len = 1, |
.buf = out_buf, |
}, |
{ |
.addr = 0x50, |
.flags = I2C_M_RD, |
.len = 1, |
.buf = buf, |
} |
}; |
int ret; |
|
return i2c_transfer(&dev_priv->gmbus[ddc_bus].adapter, msgs, 2) == 2; |
drm_mode_connector_update_edid_property(connector, edid); |
ret = drm_add_edid_modes(connector, edid); |
drm_edid_to_eld(connector, edid); |
kfree(edid); |
|
return ret; |
} |
|
/** |
69,24 → 61,19 |
struct i2c_adapter *adapter) |
{ |
struct edid *edid; |
int ret = 0; |
|
edid = drm_get_edid(connector, adapter); |
if (edid) { |
drm_mode_connector_update_edid_property(connector, edid); |
ret = drm_add_edid_modes(connector, edid); |
drm_edid_to_eld(connector, edid); |
connector->display_info.raw_edid = NULL; |
kfree(edid); |
} |
if (!edid) |
return 0; |
|
return ret; |
return intel_connector_update_modes(connector, edid); |
} |
|
static const char *force_audio_names[] = { |
"off", |
"auto", |
"on", |
static const struct drm_prop_enum_list force_audio_names[] = { |
{ HDMI_AUDIO_OFF_DVI, "force-dvi" }, |
{ HDMI_AUDIO_OFF, "off" }, |
{ HDMI_AUDIO_AUTO, "auto" }, |
{ HDMI_AUDIO_ON, "on" }, |
}; |
|
void |
95,19 → 82,16 |
struct drm_device *dev = connector->dev; |
struct drm_i915_private *dev_priv = dev->dev_private; |
struct drm_property *prop; |
int i; |
#if 0 |
prop = dev_priv->force_audio_property; |
if (prop == NULL) { |
prop = drm_property_create(dev, DRM_MODE_PROP_ENUM, |
prop = drm_property_create_enum(dev, 0, |
"audio", |
force_audio_names, |
ARRAY_SIZE(force_audio_names)); |
if (prop == NULL) |
return; |
|
for (i = 0; i < ARRAY_SIZE(force_audio_names); i++) |
drm_property_add_enum(prop, i, i-1, force_audio_names[i]); |
|
dev_priv->force_audio_property = prop; |
} |
drm_connector_attach_property(connector, prop, 0); |
114,9 → 98,9 |
#endif |
} |
|
static const char *broadcast_rgb_names[] = { |
"Full", |
"Limited 16:235", |
static const struct drm_prop_enum_list broadcast_rgb_names[] = { |
{ 0, "Full" }, |
{ 1, "Limited 16:235" }, |
}; |
|
void |
125,19 → 109,16 |
struct drm_device *dev = connector->dev; |
struct drm_i915_private *dev_priv = dev->dev_private; |
struct drm_property *prop; |
int i; |
#if 0 |
prop = dev_priv->broadcast_rgb_property; |
if (prop == NULL) { |
prop = drm_property_create(dev, DRM_MODE_PROP_ENUM, |
prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, |
"Broadcast RGB", |
broadcast_rgb_names, |
ARRAY_SIZE(broadcast_rgb_names)); |
if (prop == NULL) |
return; |
|
for (i = 0; i < ARRAY_SIZE(broadcast_rgb_names); i++) |
drm_property_add_enum(prop, i, i, broadcast_rgb_names[i]); |
|
dev_priv->broadcast_rgb_property = prop; |
} |
|