Commit 5736995b authored by Patrik Jakobsson's avatar Patrik Jakobsson Committed by Dave Airlie

gma500: Replace SDVO code with slightly modified version from i915

Our current SDVO implementation is not working properly, so replace it with
a modified version of the i915. Further testing and debugging is needed to make
sure we can handle the different SDVO setups and wiring.
Signed-off-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 5c0c1d50
...@@ -260,6 +260,16 @@ struct psb_intel_opregion { ...@@ -260,6 +260,16 @@ struct psb_intel_opregion {
int enabled; int enabled;
}; };
struct sdvo_device_mapping {
u8 initialized;
u8 dvo_port;
u8 slave_addr;
u8 dvo_wiring;
u8 i2c_pin;
u8 i2c_speed;
u8 ddc_pin;
};
struct intel_gmbus { struct intel_gmbus {
struct i2c_adapter adapter; struct i2c_adapter adapter;
struct i2c_adapter *force_bit; struct i2c_adapter *force_bit;
...@@ -345,6 +355,15 @@ struct drm_psb_private { ...@@ -345,6 +355,15 @@ struct drm_psb_private {
/* gmbus */ /* gmbus */
struct intel_gmbus *gmbus; struct intel_gmbus *gmbus;
/* Used by SDVO */
int crt_ddc_pin;
/* FIXME: The mappings should be parsed from bios but for now we can
pretend there are no mappings available */
struct sdvo_device_mapping sdvo_mappings[2];
u32 hotplug_supported_mask;
struct drm_property *broadcast_rgb_property;
struct drm_property *force_audio_property;
/* /*
* LVDS info * LVDS info
*/ */
......
...@@ -552,6 +552,14 @@ void psb_intel_encoder_commit(struct drm_encoder *encoder) ...@@ -552,6 +552,14 @@ void psb_intel_encoder_commit(struct drm_encoder *encoder)
encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON); encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
} }
void psb_intel_encoder_destroy(struct drm_encoder *encoder)
{
struct psb_intel_encoder *intel_encoder = to_psb_intel_encoder(encoder);
drm_encoder_cleanup(encoder);
kfree(intel_encoder);
}
static bool psb_intel_crtc_mode_fixup(struct drm_crtc *crtc, static bool psb_intel_crtc_mode_fixup(struct drm_crtc *crtc,
struct drm_display_mode *mode, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
......
...@@ -39,6 +39,25 @@ ...@@ -39,6 +39,25 @@
#define INTEL_I2C_BUS_DVO 1 #define INTEL_I2C_BUS_DVO 1
#define INTEL_I2C_BUS_SDVO 2 #define INTEL_I2C_BUS_SDVO 2
/* Intel Pipe Clone Bit */
#define INTEL_HDMIB_CLONE_BIT 1
#define INTEL_HDMIC_CLONE_BIT 2
#define INTEL_HDMID_CLONE_BIT 3
#define INTEL_HDMIE_CLONE_BIT 4
#define INTEL_HDMIF_CLONE_BIT 5
#define INTEL_SDVO_NON_TV_CLONE_BIT 6
#define INTEL_SDVO_TV_CLONE_BIT 7
#define INTEL_SDVO_LVDS_CLONE_BIT 8
#define INTEL_ANALOG_CLONE_BIT 9
#define INTEL_TV_CLONE_BIT 10
#define INTEL_DP_B_CLONE_BIT 11
#define INTEL_DP_C_CLONE_BIT 12
#define INTEL_DP_D_CLONE_BIT 13
#define INTEL_LVDS_CLONE_BIT 14
#define INTEL_DVO_TMDS_CLONE_BIT 15
#define INTEL_DVO_LVDS_CLONE_BIT 16
#define INTEL_EDP_CLONE_BIT 17
/* these are outputs from the chip - integrated only /* these are outputs from the chip - integrated only
* external chips are via DVO or SDVO output */ * external chips are via DVO or SDVO output */
#define INTEL_OUTPUT_UNUSED 0 #define INTEL_OUTPUT_UNUSED 0
...@@ -56,6 +75,25 @@ ...@@ -56,6 +75,25 @@
#define INTEL_DVO_CHIP_TMDS 2 #define INTEL_DVO_CHIP_TMDS 2
#define INTEL_DVO_CHIP_TVOUT 4 #define INTEL_DVO_CHIP_TVOUT 4
#define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0)
#define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT)
static inline void
psb_intel_mode_set_pixel_multiplier(struct drm_display_mode *mode,
int multiplier)
{
mode->clock *= multiplier;
mode->private_flags |= multiplier;
}
static inline int
psb_intel_mode_get_pixel_multiplier(const struct drm_display_mode *mode)
{
return (mode->private_flags & INTEL_MODE_PIXEL_MULTIPLIER_MASK)
>> INTEL_MODE_PIXEL_MULTIPLIER_SHIFT;
}
/* /*
* Hold information useally put on the device driver privates here, * Hold information useally put on the device driver privates here,
* since it needs to be shared across multiple of devices drivers privates. * since it needs to be shared across multiple of devices drivers privates.
...@@ -173,7 +211,7 @@ extern bool psb_intel_ddc_probe(struct i2c_adapter *adapter); ...@@ -173,7 +211,7 @@ extern bool psb_intel_ddc_probe(struct i2c_adapter *adapter);
extern void psb_intel_crtc_init(struct drm_device *dev, int pipe, extern void psb_intel_crtc_init(struct drm_device *dev, int pipe,
struct psb_intel_mode_device *mode_dev); struct psb_intel_mode_device *mode_dev);
extern void psb_intel_crt_init(struct drm_device *dev); extern void psb_intel_crt_init(struct drm_device *dev);
extern void psb_intel_sdvo_init(struct drm_device *dev, int output_device); extern bool psb_intel_sdvo_init(struct drm_device *dev, int output_device);
extern void psb_intel_dvo_init(struct drm_device *dev); extern void psb_intel_dvo_init(struct drm_device *dev);
extern void psb_intel_tv_init(struct drm_device *dev); extern void psb_intel_tv_init(struct drm_device *dev);
extern void psb_intel_lvds_init(struct drm_device *dev, extern void psb_intel_lvds_init(struct drm_device *dev,
...@@ -190,6 +228,7 @@ extern void mid_dsi_init(struct drm_device *dev, ...@@ -190,6 +228,7 @@ extern void mid_dsi_init(struct drm_device *dev,
extern void psb_intel_crtc_load_lut(struct drm_crtc *crtc); extern void psb_intel_crtc_load_lut(struct drm_crtc *crtc);
extern void psb_intel_encoder_prepare(struct drm_encoder *encoder); extern void psb_intel_encoder_prepare(struct drm_encoder *encoder);
extern void psb_intel_encoder_commit(struct drm_encoder *encoder); extern void psb_intel_encoder_commit(struct drm_encoder *encoder);
extern void psb_intel_encoder_destroy(struct drm_encoder *encoder);
static inline struct psb_intel_encoder *psb_intel_attached_encoder( static inline struct psb_intel_encoder *psb_intel_attached_encoder(
struct drm_connector *connector) struct drm_connector *connector)
......
...@@ -376,6 +376,8 @@ ...@@ -376,6 +376,8 @@
#define SDVO_PIPE_B_SELECT (1 << 30) #define SDVO_PIPE_B_SELECT (1 << 30)
#define SDVO_STALL_SELECT (1 << 29) #define SDVO_STALL_SELECT (1 << 29)
#define SDVO_INTERRUPT_ENABLE (1 << 26) #define SDVO_INTERRUPT_ENABLE (1 << 26)
#define SDVO_COLOR_RANGE_16_235 (1 << 8)
#define SDVO_AUDIO_ENABLE (1 << 6)
/** /**
* 915G/GM SDVO pixel multiplier. * 915G/GM SDVO pixel multiplier.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment