drm/i915: Rename intel_output to intel_encoder.
The intel_output naming is inherited from the UMS code, which had a structure of screen -> CRTC -> output. The DRM code has an additional notion of encoder/connector, so the structure is screen -> CRTC -> encoder -> connector. This is a useful structure for SDVO encoders which can support multiple connectors (each of which requires different programming in the one encoder and could be connected to different CRTCs), or for DVI-I, where multiple encoders feed into the connector for whether it's used for digital or analog. Most of our code is encoder-related, so transition it to talking about encoders before we start trying to distinguish connectors. This patch is produced by sed s/intel_output/intel_encoder/ over the driver. Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -238,8 +238,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
|
||||
struct drm_encoder *tmp_encoder;
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_lvds_priv *lvds_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_lvds_priv *lvds_priv = intel_encoder->dev_priv;
|
||||
u32 pfit_control = 0, pfit_pgm_ratios = 0;
|
||||
int left_border = 0, right_border = 0, top_border = 0;
|
||||
int bottom_border = 0;
|
||||
@@ -586,8 +586,8 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder,
|
||||
{
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_lvds_priv *lvds_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_lvds_priv *lvds_priv = intel_encoder->dev_priv;
|
||||
|
||||
/*
|
||||
* The LVDS pin pair will already have been turned on in the
|
||||
@@ -634,11 +634,11 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect
|
||||
static int intel_lvds_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
int ret = 0;
|
||||
|
||||
ret = intel_ddc_get_modes(intel_output);
|
||||
ret = intel_ddc_get_modes(intel_encoder);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -714,11 +714,11 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
|
||||
static void intel_lvds_destroy(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
if (intel_output->ddc_bus)
|
||||
intel_i2c_destroy(intel_output->ddc_bus);
|
||||
if (intel_encoder->ddc_bus)
|
||||
intel_i2c_destroy(intel_encoder->ddc_bus);
|
||||
if (dev_priv->lid_notifier.notifier_call)
|
||||
acpi_lid_notifier_unregister(&dev_priv->lid_notifier);
|
||||
drm_sysfs_connector_remove(connector);
|
||||
@@ -731,13 +731,13 @@ static int intel_lvds_set_property(struct drm_connector *connector,
|
||||
uint64_t value)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct intel_output *intel_output =
|
||||
to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder =
|
||||
to_intel_encoder(connector);
|
||||
|
||||
if (property == dev->mode_config.scaling_mode_property &&
|
||||
connector->encoder) {
|
||||
struct drm_crtc *crtc = connector->encoder->crtc;
|
||||
struct intel_lvds_priv *lvds_priv = intel_output->dev_priv;
|
||||
struct intel_lvds_priv *lvds_priv = intel_encoder->dev_priv;
|
||||
if (value == DRM_MODE_SCALE_NONE) {
|
||||
DRM_DEBUG_KMS("no scaling not supported\n");
|
||||
return 0;
|
||||
@@ -967,7 +967,7 @@ static int lvds_is_present_in_vbt(struct drm_device *dev)
|
||||
void intel_lvds_init(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct drm_connector *connector;
|
||||
struct drm_encoder *encoder;
|
||||
struct drm_display_mode *scan; /* *modes, *bios_mode; */
|
||||
@@ -995,40 +995,40 @@ void intel_lvds_init(struct drm_device *dev)
|
||||
gpio = PCH_GPIOC;
|
||||
}
|
||||
|
||||
intel_output = kzalloc(sizeof(struct intel_output) +
|
||||
intel_encoder = kzalloc(sizeof(struct intel_encoder) +
|
||||
sizeof(struct intel_lvds_priv), GFP_KERNEL);
|
||||
if (!intel_output) {
|
||||
if (!intel_encoder) {
|
||||
return;
|
||||
}
|
||||
|
||||
connector = &intel_output->base;
|
||||
encoder = &intel_output->enc;
|
||||
drm_connector_init(dev, &intel_output->base, &intel_lvds_connector_funcs,
|
||||
connector = &intel_encoder->base;
|
||||
encoder = &intel_encoder->enc;
|
||||
drm_connector_init(dev, &intel_encoder->base, &intel_lvds_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_LVDS);
|
||||
|
||||
drm_encoder_init(dev, &intel_output->enc, &intel_lvds_enc_funcs,
|
||||
drm_encoder_init(dev, &intel_encoder->enc, &intel_lvds_enc_funcs,
|
||||
DRM_MODE_ENCODER_LVDS);
|
||||
|
||||
drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);
|
||||
intel_output->type = INTEL_OUTPUT_LVDS;
|
||||
drm_mode_connector_attach_encoder(&intel_encoder->base, &intel_encoder->enc);
|
||||
intel_encoder->type = INTEL_OUTPUT_LVDS;
|
||||
|
||||
intel_output->clone_mask = (1 << INTEL_LVDS_CLONE_BIT);
|
||||
intel_output->crtc_mask = (1 << 1);
|
||||
intel_encoder->clone_mask = (1 << INTEL_LVDS_CLONE_BIT);
|
||||
intel_encoder->crtc_mask = (1 << 1);
|
||||
drm_encoder_helper_add(encoder, &intel_lvds_helper_funcs);
|
||||
drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
|
||||
connector->display_info.subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
|
||||
lvds_priv = (struct intel_lvds_priv *)(intel_output + 1);
|
||||
intel_output->dev_priv = lvds_priv;
|
||||
lvds_priv = (struct intel_lvds_priv *)(intel_encoder + 1);
|
||||
intel_encoder->dev_priv = lvds_priv;
|
||||
/* create the scaling mode property */
|
||||
drm_mode_create_scaling_mode_property(dev);
|
||||
/*
|
||||
* the initial panel fitting mode will be FULL_SCREEN.
|
||||
*/
|
||||
|
||||
drm_connector_attach_property(&intel_output->base,
|
||||
drm_connector_attach_property(&intel_encoder->base,
|
||||
dev->mode_config.scaling_mode_property,
|
||||
DRM_MODE_SCALE_FULLSCREEN);
|
||||
lvds_priv->fitting_mode = DRM_MODE_SCALE_FULLSCREEN;
|
||||
@@ -1043,8 +1043,8 @@ void intel_lvds_init(struct drm_device *dev)
|
||||
*/
|
||||
|
||||
/* Set up the DDC bus. */
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, gpio, "LVDSDDC_C");
|
||||
if (!intel_output->ddc_bus) {
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, gpio, "LVDSDDC_C");
|
||||
if (!intel_encoder->ddc_bus) {
|
||||
dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
|
||||
"failed.\n");
|
||||
goto failed;
|
||||
@@ -1054,7 +1054,7 @@ void intel_lvds_init(struct drm_device *dev)
|
||||
* Attempt to get the fixed panel mode from DDC. Assume that the
|
||||
* preferred mode is the right one.
|
||||
*/
|
||||
intel_ddc_get_modes(intel_output);
|
||||
intel_ddc_get_modes(intel_encoder);
|
||||
|
||||
list_for_each_entry(scan, &connector->probed_modes, head) {
|
||||
mutex_lock(&dev->mode_config.mutex);
|
||||
@@ -1132,9 +1132,9 @@ out:
|
||||
|
||||
failed:
|
||||
DRM_DEBUG_KMS("No LVDS modes found, disabling.\n");
|
||||
if (intel_output->ddc_bus)
|
||||
intel_i2c_destroy(intel_output->ddc_bus);
|
||||
if (intel_encoder->ddc_bus)
|
||||
intel_i2c_destroy(intel_encoder->ddc_bus);
|
||||
drm_connector_cleanup(connector);
|
||||
drm_encoder_cleanup(encoder);
|
||||
kfree(intel_output);
|
||||
kfree(intel_encoder);
|
||||
}
|
||||
|
Reference in New Issue
Block a user