~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/gpu/drm/i915/intel_hdmi.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        struct intel_encoder base;
42
42
        u32 sdvox_reg;
43
43
        int ddc_bus;
 
44
        uint32_t color_range;
44
45
        bool has_hdmi_sink;
45
46
        bool has_audio;
46
47
        int force_audio;
47
 
        struct drm_property *force_audio_property;
48
48
};
49
49
 
50
50
static struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder)
124
124
        u32 sdvox;
125
125
 
126
126
        sdvox = SDVO_ENCODING_HDMI | SDVO_BORDER_ENABLE;
 
127
        sdvox |= intel_hdmi->color_range;
127
128
        if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
128
129
                sdvox |= SDVO_VSYNC_ACTIVE_HIGH;
129
130
        if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
192
193
        if (mode->clock > 165000)
193
194
                return MODE_CLOCK_HIGH;
194
195
        if (mode->clock < 20000)
195
 
                return MODE_CLOCK_HIGH;
 
196
                return MODE_CLOCK_LOW;
196
197
 
197
198
        if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
198
199
                return MODE_NO_DBLESCAN;
278
279
                      uint64_t val)
279
280
{
280
281
        struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
 
282
        struct drm_i915_private *dev_priv = connector->dev->dev_private;
281
283
        int ret;
282
284
 
283
285
        ret = drm_connector_property_set_value(connector, property, val);
284
286
        if (ret)
285
287
                return ret;
286
288
 
287
 
        if (property == intel_hdmi->force_audio_property) {
 
289
        if (property == dev_priv->force_audio_property) {
288
290
                int i = val;
289
291
                bool has_audio;
290
292
 
305
307
                goto done;
306
308
        }
307
309
 
 
310
        if (property == dev_priv->broadcast_rgb_property) {
 
311
                if (val == !!intel_hdmi->color_range)
 
312
                        return 0;
 
313
 
 
314
                intel_hdmi->color_range = val ? SDVO_COLOR_RANGE_16_235 : 0;
 
315
                goto done;
 
316
        }
 
317
 
308
318
        return -EINVAL;
309
319
 
310
320
done:
354
364
static void
355
365
intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
356
366
{
357
 
        struct drm_device *dev = connector->dev;
358
 
 
359
 
        intel_hdmi->force_audio_property =
360
 
                drm_property_create(dev, DRM_MODE_PROP_RANGE, "force_audio", 2);
361
 
        if (intel_hdmi->force_audio_property) {
362
 
                intel_hdmi->force_audio_property->values[0] = -1;
363
 
                intel_hdmi->force_audio_property->values[1] = 1;
364
 
                drm_connector_attach_property(connector, intel_hdmi->force_audio_property, 0);
365
 
        }
 
367
        intel_attach_force_audio_property(connector);
 
368
        intel_attach_broadcast_rgb_property(connector);
366
369
}
367
370
 
368
371
void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)