Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329247
b: refs/heads/master
c: 540a895
h: refs/heads/master
i:
  329245: 72ee4e5
  329243: a5c923b
  329239: 136f449
  329231: c7b6142
  329215: 9dc43ba
v: v3
  • Loading branch information
Daniel Vetter committed Jul 25, 2012
1 parent b3450ae commit 048718b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7e806de4e53f7496a6701194d736a92a80db5b3
refs/heads/master: 540a8950047579a368a9b8fdcc15ab7fdb9921d3
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/i915/i915_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,7 @@
/* VGA port control */
#define ADPA 0x61100
#define PCH_ADPA 0xe1100
#define VLV_ADPA (VLV_DISPLAY_BASE + ADPA)

#define ADPA_DAC_ENABLE (1<<31)
#define ADPA_DAC_DISABLE 0
Expand Down
23 changes: 16 additions & 7 deletions trunk/drivers/gpu/drm/i915/intel_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
struct intel_crt {
struct intel_encoder base;
bool force_hotplug_required;
u32 adpa_reg;
};

static struct intel_crt *intel_attached_crt(struct drm_connector *connector)
Expand All @@ -55,6 +56,11 @@ static struct intel_crt *intel_attached_crt(struct drm_connector *connector)
struct intel_crt, base);
}

static struct intel_crt *intel_encoder_to_crt(struct intel_encoder *encoder)
{
return container_of(encoder, struct intel_crt, base);
}

static void pch_crt_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
Expand Down Expand Up @@ -145,19 +151,15 @@ static void intel_crt_mode_set(struct drm_encoder *encoder,

struct drm_device *dev = encoder->dev;
struct drm_crtc *crtc = encoder->crtc;
struct intel_crt *crt =
intel_encoder_to_crt(to_intel_encoder(encoder));
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct drm_i915_private *dev_priv = dev->dev_private;
int dpll_md_reg;
u32 adpa, dpll_md;
u32 adpa_reg;

dpll_md_reg = DPLL_MD(intel_crtc->pipe);

if (HAS_PCH_SPLIT(dev))
adpa_reg = PCH_ADPA;
else
adpa_reg = ADPA;

/*
* Disable separate mode multiplier used when cloning SDVO to CRT
* XXX this needs to be adjusted when we really are cloning
Expand Down Expand Up @@ -185,7 +187,7 @@ static void intel_crt_mode_set(struct drm_encoder *encoder,
if (!HAS_PCH_SPLIT(dev))
I915_WRITE(BCLRPAT(intel_crtc->pipe), 0);

I915_WRITE(adpa_reg, adpa);
I915_WRITE(crt->adpa_reg, adpa);
}

static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
Expand Down Expand Up @@ -675,6 +677,13 @@ void intel_crt_init(struct drm_device *dev)
else
encoder_helper_funcs = &gmch_encoder_funcs;

if (HAS_PCH_SPLIT(dev))
crt->adpa_reg = PCH_ADPA;
else if (IS_VALLEYVIEW(dev))
crt->adpa_reg = VLV_ADPA;
else
crt->adpa_reg = ADPA;

drm_encoder_helper_add(&crt->base.base, encoder_helper_funcs);
drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);

Expand Down

0 comments on commit 048718b

Please sign in to comment.