Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel: drm/i915: Ignore LVDS EDID when it is unavailabe or invalid drm/i915: Add no_lvds entry for the Clientron U800 drm/i915: Rename many remaining uses of "output" to encoder or connector. drm/i915: Rename intel_output to intel_encoder. agp/intel: intel_845_driver is an agp driver! drm/i915: introduce to_intel_bo helper drm/i915: Disable FBC on 915GM and 945GM.
This commit is contained in:
Коммит
13bd8e4673
|
@ -1817,8 +1817,6 @@ static int intel_845_configure(void)
|
|||
pci_write_config_byte(agp_bridge->dev, INTEL_I845_AGPM, temp2 | (1 << 1));
|
||||
/* clear any possible error conditions */
|
||||
pci_write_config_word(agp_bridge->dev, INTEL_I845_ERRSTS, 0x001c);
|
||||
|
||||
intel_i830_setup_flush();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2188,7 +2186,6 @@ static const struct agp_bridge_driver intel_845_driver = {
|
|||
.agp_destroy_page = agp_generic_destroy_page,
|
||||
.agp_destroy_pages = agp_generic_destroy_pages,
|
||||
.agp_type_to_mask_type = agp_generic_type_to_mask_type,
|
||||
.chipset_flush = intel_i830_chipset_flush,
|
||||
};
|
||||
|
||||
static const struct agp_bridge_driver intel_850_driver = {
|
||||
|
|
|
@ -226,7 +226,7 @@ static int i915_gem_fence_regs_info(struct seq_file *m, void *data)
|
|||
} else {
|
||||
struct drm_i915_gem_object *obj_priv;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
seq_printf(m, "Fenced object[%2d] = %p: %s "
|
||||
"%08x %08zx %08x %s %08x %08x %d",
|
||||
i, obj, get_pin_flag(obj_priv),
|
||||
|
|
|
@ -80,14 +80,14 @@ const static struct intel_device_info intel_i915g_info = {
|
|||
.is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1,
|
||||
};
|
||||
const static struct intel_device_info intel_i915gm_info = {
|
||||
.is_i9xx = 1, .is_mobile = 1, .has_fbc = 1,
|
||||
.is_i9xx = 1, .is_mobile = 1,
|
||||
.cursor_needs_physical = 1,
|
||||
};
|
||||
const static struct intel_device_info intel_i945g_info = {
|
||||
.is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1,
|
||||
};
|
||||
const static struct intel_device_info intel_i945gm_info = {
|
||||
.is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, .has_fbc = 1,
|
||||
.is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1,
|
||||
.has_hotplug = 1, .cursor_needs_physical = 1,
|
||||
};
|
||||
|
||||
|
@ -361,7 +361,7 @@ int i965_reset(struct drm_device *dev, u8 flags)
|
|||
!dev_priv->mm.suspended) {
|
||||
drm_i915_ring_buffer_t *ring = &dev_priv->ring;
|
||||
struct drm_gem_object *obj = ring->ring_obj;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
dev_priv->mm.suspended = 0;
|
||||
|
||||
/* Stop the ring if it's running. */
|
||||
|
|
|
@ -611,6 +611,8 @@ typedef struct drm_i915_private {
|
|||
/* Reclocking support */
|
||||
bool render_reclock_avail;
|
||||
bool lvds_downclock_avail;
|
||||
/* indicate whether the LVDS EDID is OK */
|
||||
bool lvds_edid_good;
|
||||
/* indicates the reduced downclock for LVDS*/
|
||||
int lvds_downclock;
|
||||
struct work_struct idle_work;
|
||||
|
@ -731,6 +733,8 @@ struct drm_i915_gem_object {
|
|||
atomic_t pending_flip;
|
||||
};
|
||||
|
||||
#define to_intel_bo(x) ((struct drm_i915_gem_object *) (x)->driver_private)
|
||||
|
||||
/**
|
||||
* Request queue structure.
|
||||
*
|
||||
|
|
|
@ -163,7 +163,7 @@ fast_shmem_read(struct page **pages,
|
|||
static int i915_gem_object_needs_bit17_swizzle(struct drm_gem_object *obj)
|
||||
{
|
||||
drm_i915_private_t *dev_priv = obj->dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
return dev_priv->mm.bit_6_swizzle_x == I915_BIT_6_SWIZZLE_9_10_17 &&
|
||||
obj_priv->tiling_mode != I915_TILING_NONE;
|
||||
|
@ -264,7 +264,7 @@ i915_gem_shmem_pread_fast(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
struct drm_i915_gem_pread *args,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
ssize_t remain;
|
||||
loff_t offset, page_base;
|
||||
char __user *user_data;
|
||||
|
@ -285,7 +285,7 @@ i915_gem_shmem_pread_fast(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
if (ret != 0)
|
||||
goto fail_put_pages;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
offset = args->offset;
|
||||
|
||||
while (remain > 0) {
|
||||
|
@ -354,7 +354,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
struct drm_i915_gem_pread *args,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
struct mm_struct *mm = current->mm;
|
||||
struct page **user_pages;
|
||||
ssize_t remain;
|
||||
|
@ -403,7 +403,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
if (ret != 0)
|
||||
goto fail_put_pages;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
offset = args->offset;
|
||||
|
||||
while (remain > 0) {
|
||||
|
@ -479,7 +479,7 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
|
|||
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
|
||||
if (obj == NULL)
|
||||
return -EBADF;
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
/* Bounds check source.
|
||||
*
|
||||
|
@ -581,7 +581,7 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
struct drm_i915_gem_pwrite *args,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
ssize_t remain;
|
||||
loff_t offset, page_base;
|
||||
|
@ -605,7 +605,7 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
if (ret)
|
||||
goto fail;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
offset = obj_priv->gtt_offset + args->offset;
|
||||
|
||||
while (remain > 0) {
|
||||
|
@ -655,7 +655,7 @@ i915_gem_gtt_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
struct drm_i915_gem_pwrite *args,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
ssize_t remain;
|
||||
loff_t gtt_page_base, offset;
|
||||
|
@ -699,7 +699,7 @@ i915_gem_gtt_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
if (ret)
|
||||
goto out_unpin_object;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
offset = obj_priv->gtt_offset + args->offset;
|
||||
|
||||
while (remain > 0) {
|
||||
|
@ -761,7 +761,7 @@ i915_gem_shmem_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
struct drm_i915_gem_pwrite *args,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
ssize_t remain;
|
||||
loff_t offset, page_base;
|
||||
char __user *user_data;
|
||||
|
@ -781,7 +781,7 @@ i915_gem_shmem_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
if (ret != 0)
|
||||
goto fail_put_pages;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
offset = args->offset;
|
||||
obj_priv->dirty = 1;
|
||||
|
||||
|
@ -829,7 +829,7 @@ i915_gem_shmem_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
struct drm_i915_gem_pwrite *args,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
struct mm_struct *mm = current->mm;
|
||||
struct page **user_pages;
|
||||
ssize_t remain;
|
||||
|
@ -877,7 +877,7 @@ i915_gem_shmem_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
if (ret != 0)
|
||||
goto fail_put_pages;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
offset = args->offset;
|
||||
obj_priv->dirty = 1;
|
||||
|
||||
|
@ -952,7 +952,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
|
|||
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
|
||||
if (obj == NULL)
|
||||
return -EBADF;
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
/* Bounds check destination.
|
||||
*
|
||||
|
@ -1034,7 +1034,7 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
|
|||
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
|
||||
if (obj == NULL)
|
||||
return -EBADF;
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
|
@ -1096,7 +1096,7 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
|
|||
DRM_INFO("%s: sw_finish %d (%p %zd)\n",
|
||||
__func__, args->handle, obj, obj->size);
|
||||
#endif
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
/* Pinned buffers may be scanout, so flush the cache */
|
||||
if (obj_priv->pin_count)
|
||||
|
@ -1167,7 +1167,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|||
struct drm_gem_object *obj = vma->vm_private_data;
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
pgoff_t page_offset;
|
||||
unsigned long pfn;
|
||||
int ret = 0;
|
||||
|
@ -1234,7 +1234,7 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_gem_mm *mm = dev->mm_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
struct drm_map_list *list;
|
||||
struct drm_local_map *map;
|
||||
int ret = 0;
|
||||
|
@ -1305,7 +1305,7 @@ void
|
|||
i915_gem_release_mmap(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (dev->dev_mapping)
|
||||
unmap_mapping_range(dev->dev_mapping,
|
||||
|
@ -1316,7 +1316,7 @@ static void
|
|||
i915_gem_free_mmap_offset(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
struct drm_gem_mm *mm = dev->mm_private;
|
||||
struct drm_map_list *list;
|
||||
|
||||
|
@ -1347,7 +1347,7 @@ static uint32_t
|
|||
i915_gem_get_gtt_alignment(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int start, i;
|
||||
|
||||
/*
|
||||
|
@ -1406,7 +1406,7 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
|
|||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (obj_priv->madv != I915_MADV_WILLNEED) {
|
||||
DRM_ERROR("Attempting to mmap a purgeable buffer\n");
|
||||
|
@ -1450,7 +1450,7 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
|
|||
void
|
||||
i915_gem_object_put_pages(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int page_count = obj->size / PAGE_SIZE;
|
||||
int i;
|
||||
|
||||
|
@ -1486,7 +1486,7 @@ i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
/* Add a reference if we're newly entering the active list. */
|
||||
if (!obj_priv->active) {
|
||||
|
@ -1506,7 +1506,7 @@ i915_gem_object_move_to_flushing(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
BUG_ON(!obj_priv->active);
|
||||
list_move_tail(&obj_priv->list, &dev_priv->mm.flushing_list);
|
||||
|
@ -1517,7 +1517,7 @@ i915_gem_object_move_to_flushing(struct drm_gem_object *obj)
|
|||
static void
|
||||
i915_gem_object_truncate(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
struct inode *inode;
|
||||
|
||||
inode = obj->filp->f_path.dentry->d_inode;
|
||||
|
@ -1538,7 +1538,7 @@ i915_gem_object_move_to_inactive(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
i915_verify_inactive(dev, __FILE__, __LINE__);
|
||||
if (obj_priv->pin_count != 0)
|
||||
|
@ -1965,7 +1965,7 @@ static int
|
|||
i915_gem_object_wait_rendering(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int ret;
|
||||
|
||||
/* This function only exists to support waiting for existing rendering,
|
||||
|
@ -1997,7 +1997,7 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int ret = 0;
|
||||
|
||||
#if WATCH_BUF
|
||||
|
@ -2173,7 +2173,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size)
|
|||
#if WATCH_LRU
|
||||
DRM_INFO("%s: evicting %p\n", __func__, obj);
|
||||
#endif
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
BUG_ON(obj_priv->pin_count != 0);
|
||||
BUG_ON(obj_priv->active);
|
||||
|
||||
|
@ -2244,7 +2244,7 @@ int
|
|||
i915_gem_object_get_pages(struct drm_gem_object *obj,
|
||||
gfp_t gfpmask)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int page_count, i;
|
||||
struct address_space *mapping;
|
||||
struct inode *inode;
|
||||
|
@ -2297,7 +2297,7 @@ static void sandybridge_write_fence_reg(struct drm_i915_fence_reg *reg)
|
|||
struct drm_gem_object *obj = reg->obj;
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int regnum = obj_priv->fence_reg;
|
||||
uint64_t val;
|
||||
|
||||
|
@ -2319,7 +2319,7 @@ static void i965_write_fence_reg(struct drm_i915_fence_reg *reg)
|
|||
struct drm_gem_object *obj = reg->obj;
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int regnum = obj_priv->fence_reg;
|
||||
uint64_t val;
|
||||
|
||||
|
@ -2339,7 +2339,7 @@ static void i915_write_fence_reg(struct drm_i915_fence_reg *reg)
|
|||
struct drm_gem_object *obj = reg->obj;
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int regnum = obj_priv->fence_reg;
|
||||
int tile_width;
|
||||
uint32_t fence_reg, val;
|
||||
|
@ -2381,7 +2381,7 @@ static void i830_write_fence_reg(struct drm_i915_fence_reg *reg)
|
|||
struct drm_gem_object *obj = reg->obj;
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int regnum = obj_priv->fence_reg;
|
||||
uint32_t val;
|
||||
uint32_t pitch_val;
|
||||
|
@ -2425,7 +2425,7 @@ static int i915_find_fence_reg(struct drm_device *dev)
|
|||
if (!reg->obj)
|
||||
return i;
|
||||
|
||||
obj_priv = reg->obj->driver_private;
|
||||
obj_priv = to_intel_bo(reg->obj);
|
||||
if (!obj_priv->pin_count)
|
||||
avail++;
|
||||
}
|
||||
|
@ -2480,7 +2480,7 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
struct drm_i915_fence_reg *reg = NULL;
|
||||
int ret;
|
||||
|
||||
|
@ -2547,7 +2547,7 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (IS_GEN6(dev)) {
|
||||
I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 +
|
||||
|
@ -2583,7 +2583,7 @@ int
|
|||
i915_gem_object_put_fence_reg(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (obj_priv->fence_reg == I915_FENCE_REG_NONE)
|
||||
return 0;
|
||||
|
@ -2621,7 +2621,7 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
struct drm_mm_node *free_space;
|
||||
gfp_t gfpmask = __GFP_NORETRY | __GFP_NOWARN;
|
||||
int ret;
|
||||
|
@ -2728,7 +2728,7 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
|
|||
void
|
||||
i915_gem_clflush_object(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
/* If we don't have a page list set up, then we're not pinned
|
||||
* to GPU, and we can ignore the cache flush because it'll happen
|
||||
|
@ -2829,7 +2829,7 @@ i915_gem_object_flush_write_domain(struct drm_gem_object *obj)
|
|||
int
|
||||
i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
uint32_t old_write_domain, old_read_domains;
|
||||
int ret;
|
||||
|
||||
|
@ -2879,7 +2879,7 @@ int
|
|||
i915_gem_object_set_to_display_plane(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
uint32_t old_write_domain, old_read_domains;
|
||||
int ret;
|
||||
|
||||
|
@ -3092,7 +3092,7 @@ static void
|
|||
i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
uint32_t invalidate_domains = 0;
|
||||
uint32_t flush_domains = 0;
|
||||
uint32_t old_read_domains;
|
||||
|
@ -3177,7 +3177,7 @@ i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj)
|
|||
static void
|
||||
i915_gem_object_set_to_full_cpu_read_domain(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (!obj_priv->page_cpu_valid)
|
||||
return;
|
||||
|
@ -3217,7 +3217,7 @@ static int
|
|||
i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj,
|
||||
uint64_t offset, uint64_t size)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
uint32_t old_read_domains;
|
||||
int i, ret;
|
||||
|
||||
|
@ -3286,7 +3286,7 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int i, ret;
|
||||
void __iomem *reloc_page;
|
||||
bool need_fence;
|
||||
|
@ -3337,7 +3337,7 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
|
|||
i915_gem_object_unpin(obj);
|
||||
return -EBADF;
|
||||
}
|
||||
target_obj_priv = target_obj->driver_private;
|
||||
target_obj_priv = to_intel_bo(target_obj);
|
||||
|
||||
#if WATCH_RELOC
|
||||
DRM_INFO("%s: obj %p offset %08x target %d "
|
||||
|
@ -3689,7 +3689,7 @@ i915_gem_wait_for_pending_flip(struct drm_device *dev,
|
|||
prepare_to_wait(&dev_priv->pending_flip_queue,
|
||||
&wait, TASK_INTERRUPTIBLE);
|
||||
for (i = 0; i < count; i++) {
|
||||
obj_priv = object_list[i]->driver_private;
|
||||
obj_priv = to_intel_bo(object_list[i]);
|
||||
if (atomic_read(&obj_priv->pending_flip) > 0)
|
||||
break;
|
||||
}
|
||||
|
@ -3798,7 +3798,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
|||
goto err;
|
||||
}
|
||||
|
||||
obj_priv = object_list[i]->driver_private;
|
||||
obj_priv = to_intel_bo(object_list[i]);
|
||||
if (obj_priv->in_execbuffer) {
|
||||
DRM_ERROR("Object %p appears more than once in object list\n",
|
||||
object_list[i]);
|
||||
|
@ -3924,7 +3924,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
|||
|
||||
for (i = 0; i < args->buffer_count; i++) {
|
||||
struct drm_gem_object *obj = object_list[i];
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
uint32_t old_write_domain = obj->write_domain;
|
||||
|
||||
obj->write_domain = obj->pending_write_domain;
|
||||
|
@ -3999,7 +3999,7 @@ err:
|
|||
|
||||
for (i = 0; i < args->buffer_count; i++) {
|
||||
if (object_list[i]) {
|
||||
obj_priv = object_list[i]->driver_private;
|
||||
obj_priv = to_intel_bo(object_list[i]);
|
||||
obj_priv->in_execbuffer = false;
|
||||
}
|
||||
drm_gem_object_unreference(object_list[i]);
|
||||
|
@ -4177,7 +4177,7 @@ int
|
|||
i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int ret;
|
||||
|
||||
i915_verify_inactive(dev, __FILE__, __LINE__);
|
||||
|
@ -4210,7 +4210,7 @@ i915_gem_object_unpin(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
i915_verify_inactive(dev, __FILE__, __LINE__);
|
||||
obj_priv->pin_count--;
|
||||
|
@ -4250,7 +4250,7 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
|
|||
mutex_unlock(&dev->struct_mutex);
|
||||
return -EBADF;
|
||||
}
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (obj_priv->madv != I915_MADV_WILLNEED) {
|
||||
DRM_ERROR("Attempting to pin a purgeable buffer\n");
|
||||
|
@ -4307,7 +4307,7 @@ i915_gem_unpin_ioctl(struct drm_device *dev, void *data,
|
|||
return -EBADF;
|
||||
}
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
if (obj_priv->pin_filp != file_priv) {
|
||||
DRM_ERROR("Not pinned by caller in i915_gem_pin_ioctl(): %d\n",
|
||||
args->handle);
|
||||
|
@ -4349,7 +4349,7 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
|
|||
*/
|
||||
i915_gem_retire_requests(dev);
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
/* Don't count being on the flushing list against the object being
|
||||
* done. Otherwise, a buffer left on the flushing list but not getting
|
||||
* flushed (because nobody's flushing that domain) won't ever return
|
||||
|
@ -4395,7 +4395,7 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
|
|||
}
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (obj_priv->pin_count) {
|
||||
drm_gem_object_unreference(obj);
|
||||
|
@ -4456,7 +4456,7 @@ int i915_gem_init_object(struct drm_gem_object *obj)
|
|||
void i915_gem_free_object(struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
trace_i915_gem_object_destroy(obj);
|
||||
|
||||
|
@ -4565,7 +4565,7 @@ i915_gem_init_hws(struct drm_device *dev)
|
|||
DRM_ERROR("Failed to allocate status page\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
obj_priv->agp_type = AGP_USER_CACHED_MEMORY;
|
||||
|
||||
ret = i915_gem_object_pin(obj, 4096);
|
||||
|
@ -4609,7 +4609,7 @@ i915_gem_cleanup_hws(struct drm_device *dev)
|
|||
return;
|
||||
|
||||
obj = dev_priv->hws_obj;
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
kunmap(obj_priv->pages[0]);
|
||||
i915_gem_object_unpin(obj);
|
||||
|
@ -4643,7 +4643,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev)
|
|||
i915_gem_cleanup_hws(dev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
ret = i915_gem_object_pin(obj, 4096);
|
||||
if (ret != 0) {
|
||||
|
@ -4936,7 +4936,7 @@ void i915_gem_detach_phys_object(struct drm_device *dev,
|
|||
int ret;
|
||||
int page_count;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
if (!obj_priv->phys_obj)
|
||||
return;
|
||||
|
||||
|
@ -4975,7 +4975,7 @@ i915_gem_attach_phys_object(struct drm_device *dev,
|
|||
if (id > I915_MAX_PHYS_OBJECT)
|
||||
return -EINVAL;
|
||||
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (obj_priv->phys_obj) {
|
||||
if (obj_priv->phys_obj->id == id)
|
||||
|
@ -5026,7 +5026,7 @@ i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
|
|||
struct drm_i915_gem_pwrite *args,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
void *obj_addr;
|
||||
int ret;
|
||||
char __user *user_data;
|
||||
|
|
|
@ -72,7 +72,7 @@ void
|
|||
i915_gem_dump_object(struct drm_gem_object *obj, int len,
|
||||
const char *where, uint32_t mark)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int page;
|
||||
|
||||
DRM_INFO("%s: object at offset %08x\n", where, obj_priv->gtt_offset);
|
||||
|
@ -137,7 +137,7 @@ void
|
|||
i915_gem_object_check_coherency(struct drm_gem_object *obj, int handle)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int page;
|
||||
uint32_t *gtt_mapping;
|
||||
uint32_t *backing_map = NULL;
|
||||
|
|
|
@ -240,7 +240,7 @@ bool
|
|||
i915_gem_object_fence_offset_ok(struct drm_gem_object *obj, int tiling_mode)
|
||||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (obj_priv->gtt_space == NULL)
|
||||
return true;
|
||||
|
@ -280,7 +280,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
|
|||
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
|
||||
if (obj == NULL)
|
||||
return -EINVAL;
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
if (!i915_tiling_ok(dev, args->stride, obj->size, args->tiling_mode)) {
|
||||
drm_gem_object_unreference_unlocked(obj);
|
||||
|
@ -364,7 +364,7 @@ i915_gem_get_tiling(struct drm_device *dev, void *data,
|
|||
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
|
||||
if (obj == NULL)
|
||||
return -EINVAL;
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
|
@ -427,7 +427,7 @@ i915_gem_object_do_bit_17_swizzle(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int page_count = obj->size >> PAGE_SHIFT;
|
||||
int i;
|
||||
|
||||
|
@ -456,7 +456,7 @@ i915_gem_object_save_bit_17_swizzle(struct drm_gem_object *obj)
|
|||
{
|
||||
struct drm_device *dev = obj->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
int page_count = obj->size >> PAGE_SHIFT;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -260,10 +260,10 @@ static void i915_hotplug_work_func(struct work_struct *work)
|
|||
|
||||
if (mode_config->num_connector) {
|
||||
list_for_each_entry(connector, &mode_config->connector_list, head) {
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
if (intel_output->hot_plug)
|
||||
(*intel_output->hot_plug) (intel_output);
|
||||
if (intel_encoder->hot_plug)
|
||||
(*intel_encoder->hot_plug) (intel_encoder);
|
||||
}
|
||||
}
|
||||
/* Just fire off a uevent and let userspace tell us what to do */
|
||||
|
@ -444,7 +444,7 @@ i915_error_object_create(struct drm_device *dev,
|
|||
if (src == NULL)
|
||||
return NULL;
|
||||
|
||||
src_priv = src->driver_private;
|
||||
src_priv = to_intel_bo(src);
|
||||
if (src_priv->pages == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -247,19 +247,19 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
|
|||
|
||||
static bool intel_crt_detect_ddc(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
/* CRT should always be at 0, but check anyway */
|
||||
if (intel_output->type != INTEL_OUTPUT_ANALOG)
|
||||
if (intel_encoder->type != INTEL_OUTPUT_ANALOG)
|
||||
return false;
|
||||
|
||||
return intel_ddc_probe(intel_output);
|
||||
return intel_ddc_probe(intel_encoder);
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
intel_crt_load_detect(struct drm_crtc *crtc, struct intel_output *intel_output)
|
||||
intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
|
@ -387,8 +387,8 @@ intel_crt_load_detect(struct drm_crtc *crtc, struct intel_output *intel_output)
|
|||
static enum drm_connector_status intel_crt_detect(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
struct drm_crtc *crtc;
|
||||
int dpms_mode;
|
||||
enum drm_connector_status status;
|
||||
|
@ -405,13 +405,13 @@ static enum drm_connector_status intel_crt_detect(struct drm_connector *connecto
|
|||
|
||||
/* for pre-945g platforms use load detect */
|
||||
if (encoder->crtc && encoder->crtc->enabled) {
|
||||
status = intel_crt_load_detect(encoder->crtc, intel_output);
|
||||
status = intel_crt_load_detect(encoder->crtc, intel_encoder);
|
||||
} else {
|
||||
crtc = intel_get_load_detect_pipe(intel_output,
|
||||
crtc = intel_get_load_detect_pipe(intel_encoder,
|
||||
NULL, &dpms_mode);
|
||||
if (crtc) {
|
||||
status = intel_crt_load_detect(crtc, intel_output);
|
||||
intel_release_load_detect_pipe(intel_output, dpms_mode);
|
||||
status = intel_crt_load_detect(crtc, intel_encoder);
|
||||
intel_release_load_detect_pipe(intel_encoder, dpms_mode);
|
||||
} else
|
||||
status = connector_status_unknown;
|
||||
}
|
||||
|
@ -421,9 +421,9 @@ static enum drm_connector_status intel_crt_detect(struct drm_connector *connecto
|
|||
|
||||
static void intel_crt_destroy(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
intel_i2c_destroy(intel_output->ddc_bus);
|
||||
intel_i2c_destroy(intel_encoder->ddc_bus);
|
||||
drm_sysfs_connector_remove(connector);
|
||||
drm_connector_cleanup(connector);
|
||||
kfree(connector);
|
||||
|
@ -432,28 +432,28 @@ static void intel_crt_destroy(struct drm_connector *connector)
|
|||
static int intel_crt_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
int ret;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct i2c_adapter *ddcbus;
|
||||
struct drm_device *dev = connector->dev;
|
||||
|
||||
|
||||
ret = intel_ddc_get_modes(intel_output);
|
||||
ret = intel_ddc_get_modes(intel_encoder);
|
||||
if (ret || !IS_G4X(dev))
|
||||
goto end;
|
||||
|
||||
ddcbus = intel_output->ddc_bus;
|
||||
ddcbus = intel_encoder->ddc_bus;
|
||||
/* Try to probe digital port for output in DVI-I -> VGA mode. */
|
||||
intel_output->ddc_bus =
|
||||
intel_encoder->ddc_bus =
|
||||
intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D");
|
||||
|
||||
if (!intel_output->ddc_bus) {
|
||||
intel_output->ddc_bus = ddcbus;
|
||||
if (!intel_encoder->ddc_bus) {
|
||||
intel_encoder->ddc_bus = ddcbus;
|
||||
dev_printk(KERN_ERR, &connector->dev->pdev->dev,
|
||||
"DDC bus registration failed for CRTDDC_D.\n");
|
||||
goto end;
|
||||
}
|
||||
/* Try to get modes by GPIOD port */
|
||||
ret = intel_ddc_get_modes(intel_output);
|
||||
ret = intel_ddc_get_modes(intel_encoder);
|
||||
intel_i2c_destroy(ddcbus);
|
||||
|
||||
end:
|
||||
|
@ -506,23 +506,23 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = {
|
|||
void intel_crt_init(struct drm_device *dev)
|
||||
{
|
||||
struct drm_connector *connector;
|
||||
struct intel_output *intel_output;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
u32 i2c_reg;
|
||||
|
||||
intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL);
|
||||
if (!intel_output)
|
||||
intel_encoder = kzalloc(sizeof(struct intel_encoder), GFP_KERNEL);
|
||||
if (!intel_encoder)
|
||||
return;
|
||||
|
||||
connector = &intel_output->base;
|
||||
drm_connector_init(dev, &intel_output->base,
|
||||
connector = &intel_encoder->base;
|
||||
drm_connector_init(dev, &intel_encoder->base,
|
||||
&intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
|
||||
|
||||
drm_encoder_init(dev, &intel_output->enc, &intel_crt_enc_funcs,
|
||||
drm_encoder_init(dev, &intel_encoder->enc, &intel_crt_enc_funcs,
|
||||
DRM_MODE_ENCODER_DAC);
|
||||
|
||||
drm_mode_connector_attach_encoder(&intel_output->base,
|
||||
&intel_output->enc);
|
||||
drm_mode_connector_attach_encoder(&intel_encoder->base,
|
||||
&intel_encoder->enc);
|
||||
|
||||
/* Set up the DDC bus. */
|
||||
if (HAS_PCH_SPLIT(dev))
|
||||
|
@ -533,22 +533,22 @@ void intel_crt_init(struct drm_device *dev)
|
|||
if (dev_priv->crt_ddc_bus != 0)
|
||||
i2c_reg = dev_priv->crt_ddc_bus;
|
||||
}
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A");
|
||||
if (!intel_output->ddc_bus) {
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A");
|
||||
if (!intel_encoder->ddc_bus) {
|
||||
dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
|
||||
"failed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
intel_output->type = INTEL_OUTPUT_ANALOG;
|
||||
intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
|
||||
intel_encoder->type = INTEL_OUTPUT_ANALOG;
|
||||
intel_encoder->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
|
||||
(1 << INTEL_ANALOG_CLONE_BIT) |
|
||||
(1 << INTEL_SDVO_LVDS_CLONE_BIT);
|
||||
intel_output->crtc_mask = (1 << 0) | (1 << 1);
|
||||
intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
|
||||
connector->interlace_allowed = 0;
|
||||
connector->doublescan_allowed = 0;
|
||||
|
||||
drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs);
|
||||
drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs);
|
||||
drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
|
||||
|
||||
drm_sysfs_connector_add(connector);
|
||||
|
|
|
@ -747,16 +747,16 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
|
|||
list_for_each_entry(l_entry, &mode_config->connector_list, head) {
|
||||
if (l_entry->encoder &&
|
||||
l_entry->encoder->crtc == crtc) {
|
||||
struct intel_output *intel_output = to_intel_output(l_entry);
|
||||
if (intel_output->type == type)
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(l_entry);
|
||||
if (intel_encoder->type == type)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
struct drm_connector *
|
||||
intel_pipe_get_output (struct drm_crtc *crtc)
|
||||
static struct drm_connector *
|
||||
intel_pipe_get_connector (struct drm_crtc *crtc)
|
||||
{
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct drm_mode_config *mode_config = &dev->mode_config;
|
||||
|
@ -1003,7 +1003,7 @@ static void i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
|
|||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_framebuffer *fb = crtc->fb;
|
||||
struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
|
||||
struct drm_i915_gem_object *obj_priv = intel_fb->obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(intel_fb->obj);
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
int plane, i;
|
||||
u32 fbc_ctl, fbc_ctl2;
|
||||
|
@ -1080,7 +1080,7 @@ static void g4x_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
|
|||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_framebuffer *fb = crtc->fb;
|
||||
struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
|
||||
struct drm_i915_gem_object *obj_priv = intel_fb->obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(intel_fb->obj);
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
int plane = (intel_crtc->plane == 0 ? DPFC_CTL_PLANEA :
|
||||
DPFC_CTL_PLANEB);
|
||||
|
@ -1176,7 +1176,7 @@ static void intel_update_fbc(struct drm_crtc *crtc,
|
|||
return;
|
||||
|
||||
intel_fb = to_intel_framebuffer(fb);
|
||||
obj_priv = intel_fb->obj->driver_private;
|
||||
obj_priv = to_intel_bo(intel_fb->obj);
|
||||
|
||||
/*
|
||||
* If FBC is already on, we just have to verify that we can
|
||||
|
@ -1243,7 +1243,7 @@ out_disable:
|
|||
static int
|
||||
intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj)
|
||||
{
|
||||
struct drm_i915_gem_object *obj_priv = obj->driver_private;
|
||||
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
|
||||
u32 alignment;
|
||||
int ret;
|
||||
|
||||
|
@ -1323,7 +1323,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
|
|||
|
||||
intel_fb = to_intel_framebuffer(crtc->fb);
|
||||
obj = intel_fb->obj;
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
ret = intel_pin_and_fence_fb_obj(dev, obj);
|
||||
|
@ -1401,7 +1401,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
|
|||
|
||||
if (old_fb) {
|
||||
intel_fb = to_intel_framebuffer(old_fb);
|
||||
obj_priv = intel_fb->obj->driver_private;
|
||||
obj_priv = to_intel_bo(intel_fb->obj);
|
||||
i915_gem_object_unpin(intel_fb->obj);
|
||||
}
|
||||
intel_increase_pllclock(crtc, true);
|
||||
|
@ -2917,7 +2917,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
|
|||
int dspsize_reg = (plane == 0) ? DSPASIZE : DSPBSIZE;
|
||||
int dsppos_reg = (plane == 0) ? DSPAPOS : DSPBPOS;
|
||||
int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC;
|
||||
int refclk, num_outputs = 0;
|
||||
int refclk, num_connectors = 0;
|
||||
intel_clock_t clock, reduced_clock;
|
||||
u32 dpll = 0, fp = 0, fp2 = 0, dspcntr, pipeconf;
|
||||
bool ok, has_reduced_clock = false, is_sdvo = false, is_dvo = false;
|
||||
|
@ -2943,19 +2943,19 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
|
|||
drm_vblank_pre_modeset(dev, pipe);
|
||||
|
||||
list_for_each_entry(connector, &mode_config->connector_list, head) {
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
if (!connector->encoder || connector->encoder->crtc != crtc)
|
||||
continue;
|
||||
|
||||
switch (intel_output->type) {
|
||||
switch (intel_encoder->type) {
|
||||
case INTEL_OUTPUT_LVDS:
|
||||
is_lvds = true;
|
||||
break;
|
||||
case INTEL_OUTPUT_SDVO:
|
||||
case INTEL_OUTPUT_HDMI:
|
||||
is_sdvo = true;
|
||||
if (intel_output->needs_tv_clock)
|
||||
if (intel_encoder->needs_tv_clock)
|
||||
is_tv = true;
|
||||
break;
|
||||
case INTEL_OUTPUT_DVO:
|
||||
|
@ -2975,10 +2975,10 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
|
|||
break;
|
||||
}
|
||||
|
||||
num_outputs++;
|
||||
num_connectors++;
|
||||
}
|
||||
|
||||
if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2) {
|
||||
if (is_lvds && dev_priv->lvds_use_ssc && num_connectors < 2) {
|
||||
refclk = dev_priv->lvds_ssc_freq * 1000;
|
||||
DRM_DEBUG_KMS("using SSC reference clock of %d MHz\n",
|
||||
refclk / 1000);
|
||||
|
@ -3049,8 +3049,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
|
|||
if (is_edp) {
|
||||
struct drm_connector *edp;
|
||||
target_clock = mode->clock;
|
||||
edp = intel_pipe_get_output(crtc);
|
||||
intel_edp_link_config(to_intel_output(edp),
|
||||
edp = intel_pipe_get_connector(crtc);
|
||||
intel_edp_link_config(to_intel_encoder(edp),
|
||||
&lane, &link_bw);
|
||||
} else {
|
||||
/* DP over FDI requires target mode clock
|
||||
|
@ -3231,7 +3231,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
|
|||
/* XXX: just matching BIOS for now */
|
||||
/* dpll |= PLL_REF_INPUT_TVCLKINBC; */
|
||||
dpll |= 3;
|
||||
else if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2)
|
||||
else if (is_lvds && dev_priv->lvds_use_ssc && num_connectors < 2)
|
||||
dpll |= PLLB_REF_INPUT_SPREADSPECTRUMIN;
|
||||
else
|
||||
dpll |= PLL_REF_INPUT_DREFCLK;
|
||||
|
@ -3511,7 +3511,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
|
|||
if (!bo)
|
||||
return -ENOENT;
|
||||
|
||||
obj_priv = bo->driver_private;
|
||||
obj_priv = to_intel_bo(bo);
|
||||
|
||||
if (bo->size < width * height * 4) {
|
||||
DRM_ERROR("buffer is to small\n");
|
||||
|
@ -3655,9 +3655,9 @@ static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
|
|||
* detection.
|
||||
*
|
||||
* It will be up to the load-detect code to adjust the pipe as appropriate for
|
||||
* its requirements. The pipe will be connected to no other outputs.
|
||||
* its requirements. The pipe will be connected to no other encoders.
|
||||
*
|
||||
* Currently this code will only succeed if there is a pipe with no outputs
|
||||
* Currently this code will only succeed if there is a pipe with no encoders
|
||||
* configured for it. In the future, it could choose to temporarily disable
|
||||
* some outputs to free up a pipe for its use.
|
||||
*
|
||||
|
@ -3670,14 +3670,14 @@ static struct drm_display_mode load_detect_mode = {
|
|||
704, 832, 0, 480, 489, 491, 520, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
|
||||
};
|
||||
|
||||
struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output,
|
||||
struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
|
||||
struct drm_display_mode *mode,
|
||||
int *dpms_mode)
|
||||
{
|
||||
struct intel_crtc *intel_crtc;
|
||||
struct drm_crtc *possible_crtc;
|
||||
struct drm_crtc *supported_crtc =NULL;
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
struct drm_crtc *crtc = NULL;
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
|
||||
|
@ -3729,8 +3729,8 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output,
|
|||
}
|
||||
|
||||
encoder->crtc = crtc;
|
||||
intel_output->base.encoder = encoder;
|
||||
intel_output->load_detect_temp = true;
|
||||
intel_encoder->base.encoder = encoder;
|
||||
intel_encoder->load_detect_temp = true;
|
||||
|
||||
intel_crtc = to_intel_crtc(crtc);
|
||||
*dpms_mode = intel_crtc->dpms_mode;
|
||||
|
@ -3755,23 +3755,23 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output,
|
|||
return crtc;
|
||||
}
|
||||
|
||||
void intel_release_load_detect_pipe(struct intel_output *intel_output, int dpms_mode)
|
||||
void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, int dpms_mode)
|
||||
{
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_crtc *crtc = encoder->crtc;
|
||||
struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
|
||||
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
|
||||
|
||||
if (intel_output->load_detect_temp) {
|
||||
if (intel_encoder->load_detect_temp) {
|
||||
encoder->crtc = NULL;
|
||||
intel_output->base.encoder = NULL;
|
||||
intel_output->load_detect_temp = false;
|
||||
intel_encoder->base.encoder = NULL;
|
||||
intel_encoder->load_detect_temp = false;
|
||||
crtc->enabled = drm_helper_crtc_in_use(crtc);
|
||||
drm_helper_disable_unused_functions(dev);
|
||||
}
|
||||
|
||||
/* Switch crtc and output back off if necessary */
|
||||
/* Switch crtc and encoder back off if necessary */
|
||||
if (crtc->enabled && dpms_mode != DRM_MODE_DPMS_ON) {
|
||||
if (encoder->crtc == crtc)
|
||||
encoder_funcs->dpms(encoder, dpms_mode);
|
||||
|
@ -4156,7 +4156,7 @@ void intel_finish_page_flip(struct drm_device *dev, int pipe)
|
|||
work = intel_crtc->unpin_work;
|
||||
if (work == NULL || !work->pending) {
|
||||
if (work && !work->pending) {
|
||||
obj_priv = work->pending_flip_obj->driver_private;
|
||||
obj_priv = to_intel_bo(work->pending_flip_obj);
|
||||
DRM_DEBUG_DRIVER("flip finish: %p (%d) not pending?\n",
|
||||
obj_priv,
|
||||
atomic_read(&obj_priv->pending_flip));
|
||||
|
@ -4181,7 +4181,7 @@ void intel_finish_page_flip(struct drm_device *dev, int pipe)
|
|||
|
||||
spin_unlock_irqrestore(&dev->event_lock, flags);
|
||||
|
||||
obj_priv = work->pending_flip_obj->driver_private;
|
||||
obj_priv = to_intel_bo(work->pending_flip_obj);
|
||||
|
||||
/* Initial scanout buffer will have a 0 pending flip count */
|
||||
if ((atomic_read(&obj_priv->pending_flip) == 0) ||
|
||||
|
@ -4252,7 +4252,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
|
|||
ret = intel_pin_and_fence_fb_obj(dev, obj);
|
||||
if (ret != 0) {
|
||||
DRM_DEBUG_DRIVER("flip queue: %p pin & fence failed\n",
|
||||
obj->driver_private);
|
||||
to_intel_bo(obj));
|
||||
kfree(work);
|
||||
intel_crtc->unpin_work = NULL;
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
@ -4266,7 +4266,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
|
|||
crtc->fb = fb;
|
||||
i915_gem_object_flush_write_domain(obj);
|
||||
drm_vblank_get(dev, intel_crtc->pipe);
|
||||
obj_priv = obj->driver_private;
|
||||
obj_priv = to_intel_bo(obj);
|
||||
atomic_inc(&obj_priv->pending_flip);
|
||||
work->pending_flip_obj = obj;
|
||||
|
||||
|
@ -4399,8 +4399,8 @@ static int intel_connector_clones(struct drm_device *dev, int type_mask)
|
|||
int entry = 0;
|
||||
|
||||
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
if (type_mask & intel_output->clone_mask)
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
if (type_mask & intel_encoder->clone_mask)
|
||||
index_mask |= (1 << entry);
|
||||
entry++;
|
||||
}
|
||||
|
@ -4495,12 +4495,12 @@ static void intel_setup_outputs(struct drm_device *dev)
|
|||
intel_tv_init(dev);
|
||||
|
||||
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
|
||||
encoder->possible_crtcs = intel_output->crtc_mask;
|
||||
encoder->possible_crtcs = intel_encoder->crtc_mask;
|
||||
encoder->possible_clones = intel_connector_clones(dev,
|
||||
intel_output->clone_mask);
|
||||
intel_encoder->clone_mask);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4779,14 +4779,14 @@ void intel_init_clock_gating(struct drm_device *dev)
|
|||
struct drm_i915_gem_object *obj_priv = NULL;
|
||||
|
||||
if (dev_priv->pwrctx) {
|
||||
obj_priv = dev_priv->pwrctx->driver_private;
|
||||
obj_priv = to_intel_bo(dev_priv->pwrctx);
|
||||
} else {
|
||||
struct drm_gem_object *pwrctx;
|
||||
|
||||
pwrctx = intel_alloc_power_context(dev);
|
||||
if (pwrctx) {
|
||||
dev_priv->pwrctx = pwrctx;
|
||||
obj_priv = pwrctx->driver_private;
|
||||
obj_priv = to_intel_bo(pwrctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4815,7 +4815,7 @@ static void intel_init_display(struct drm_device *dev)
|
|||
dev_priv->display.fbc_enabled = g4x_fbc_enabled;
|
||||
dev_priv->display.enable_fbc = g4x_enable_fbc;
|
||||
dev_priv->display.disable_fbc = g4x_disable_fbc;
|
||||
} else if (IS_I965GM(dev) || IS_I945GM(dev) || IS_I915GM(dev)) {
|
||||
} else if (IS_I965GM(dev)) {
|
||||
dev_priv->display.fbc_enabled = i8xx_fbc_enabled;
|
||||
dev_priv->display.enable_fbc = i8xx_enable_fbc;
|
||||
dev_priv->display.disable_fbc = i8xx_disable_fbc;
|
||||
|
@ -4957,7 +4957,7 @@ void intel_modeset_cleanup(struct drm_device *dev)
|
|||
if (dev_priv->pwrctx) {
|
||||
struct drm_i915_gem_object *obj_priv;
|
||||
|
||||
obj_priv = dev_priv->pwrctx->driver_private;
|
||||
obj_priv = to_intel_bo(dev_priv->pwrctx);
|
||||
I915_WRITE(PWRCTXA, obj_priv->gtt_offset &~ PWRCTX_EN);
|
||||
I915_READ(PWRCTXA);
|
||||
i915_gem_object_unpin(dev_priv->pwrctx);
|
||||
|
@ -4978,9 +4978,9 @@ void intel_modeset_cleanup(struct drm_device *dev)
|
|||
*/
|
||||
struct drm_encoder *intel_best_encoder(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
return &intel_output->enc;
|
||||
return &intel_encoder->enc;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -55,23 +55,23 @@ struct intel_dp_priv {
|
|||
uint8_t link_bw;
|
||||
uint8_t lane_count;
|
||||
uint8_t dpcd[4];
|
||||
struct intel_output *intel_output;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct i2c_adapter adapter;
|
||||
struct i2c_algo_dp_aux_data algo;
|
||||
};
|
||||
|
||||
static void
|
||||
intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
|
||||
intel_dp_link_train(struct intel_encoder *intel_encoder, uint32_t DP,
|
||||
uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]);
|
||||
|
||||
static void
|
||||
intel_dp_link_down(struct intel_output *intel_output, uint32_t DP);
|
||||
intel_dp_link_down(struct intel_encoder *intel_encoder, uint32_t DP);
|
||||
|
||||
void
|
||||
intel_edp_link_config (struct intel_output *intel_output,
|
||||
intel_edp_link_config (struct intel_encoder *intel_encoder,
|
||||
int *lane_num, int *link_bw)
|
||||
{
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
|
||||
*lane_num = dp_priv->lane_count;
|
||||
if (dp_priv->link_bw == DP_LINK_BW_1_62)
|
||||
|
@ -81,9 +81,9 @@ intel_edp_link_config (struct intel_output *intel_output,
|
|||
}
|
||||
|
||||
static int
|
||||
intel_dp_max_lane_count(struct intel_output *intel_output)
|
||||
intel_dp_max_lane_count(struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
int max_lane_count = 4;
|
||||
|
||||
if (dp_priv->dpcd[0] >= 0x11) {
|
||||
|
@ -99,9 +99,9 @@ intel_dp_max_lane_count(struct intel_output *intel_output)
|
|||
}
|
||||
|
||||
static int
|
||||
intel_dp_max_link_bw(struct intel_output *intel_output)
|
||||
intel_dp_max_link_bw(struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
int max_link_bw = dp_priv->dpcd[1];
|
||||
|
||||
switch (max_link_bw) {
|
||||
|
@ -127,11 +127,11 @@ intel_dp_link_clock(uint8_t link_bw)
|
|||
/* I think this is a fiction */
|
||||
static int
|
||||
intel_dp_link_required(struct drm_device *dev,
|
||||
struct intel_output *intel_output, int pixel_clock)
|
||||
struct intel_encoder *intel_encoder, int pixel_clock)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
if (IS_eDP(intel_output))
|
||||
if (IS_eDP(intel_encoder))
|
||||
return (pixel_clock * dev_priv->edp_bpp) / 8;
|
||||
else
|
||||
return pixel_clock * 3;
|
||||
|
@ -141,11 +141,11 @@ static int
|
|||
intel_dp_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_output));
|
||||
int max_lanes = intel_dp_max_lane_count(intel_output);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_encoder));
|
||||
int max_lanes = intel_dp_max_lane_count(intel_encoder);
|
||||
|
||||
if (intel_dp_link_required(connector->dev, intel_output, mode->clock)
|
||||
if (intel_dp_link_required(connector->dev, intel_encoder, mode->clock)
|
||||
> max_link_clock * max_lanes)
|
||||
return MODE_CLOCK_HIGH;
|
||||
|
||||
|
@ -209,13 +209,13 @@ intel_hrawclk(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
intel_dp_aux_ch(struct intel_output *intel_output,
|
||||
intel_dp_aux_ch(struct intel_encoder *intel_encoder,
|
||||
uint8_t *send, int send_bytes,
|
||||
uint8_t *recv, int recv_size)
|
||||
{
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
uint32_t output_reg = dp_priv->output_reg;
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
uint32_t ch_ctl = output_reg + 0x10;
|
||||
uint32_t ch_data = ch_ctl + 4;
|
||||
|
@ -230,7 +230,7 @@ intel_dp_aux_ch(struct intel_output *intel_output,
|
|||
* and would like to run at 2MHz. So, take the
|
||||
* hrawclk value and divide by 2 and use that
|
||||
*/
|
||||
if (IS_eDP(intel_output))
|
||||
if (IS_eDP(intel_encoder))
|
||||
aux_clock_divider = 225; /* eDP input clock at 450Mhz */
|
||||
else if (HAS_PCH_SPLIT(dev))
|
||||
aux_clock_divider = 62; /* IRL input clock fixed at 125Mhz */
|
||||
|
@ -313,7 +313,7 @@ intel_dp_aux_ch(struct intel_output *intel_output,
|
|||
|
||||
/* Write data to the aux channel in native mode */
|
||||
static int
|
||||
intel_dp_aux_native_write(struct intel_output *intel_output,
|
||||
intel_dp_aux_native_write(struct intel_encoder *intel_encoder,
|
||||
uint16_t address, uint8_t *send, int send_bytes)
|
||||
{
|
||||
int ret;
|
||||
|
@ -330,7 +330,7 @@ intel_dp_aux_native_write(struct intel_output *intel_output,
|
|||
memcpy(&msg[4], send, send_bytes);
|
||||
msg_bytes = send_bytes + 4;
|
||||
for (;;) {
|
||||
ret = intel_dp_aux_ch(intel_output, msg, msg_bytes, &ack, 1);
|
||||
ret = intel_dp_aux_ch(intel_encoder, msg, msg_bytes, &ack, 1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK)
|
||||
|
@ -345,15 +345,15 @@ intel_dp_aux_native_write(struct intel_output *intel_output,
|
|||
|
||||
/* Write a single byte to the aux channel in native mode */
|
||||
static int
|
||||
intel_dp_aux_native_write_1(struct intel_output *intel_output,
|
||||
intel_dp_aux_native_write_1(struct intel_encoder *intel_encoder,
|
||||
uint16_t address, uint8_t byte)
|
||||
{
|
||||
return intel_dp_aux_native_write(intel_output, address, &byte, 1);
|
||||
return intel_dp_aux_native_write(intel_encoder, address, &byte, 1);
|
||||
}
|
||||
|
||||
/* read bytes from a native aux channel */
|
||||
static int
|
||||
intel_dp_aux_native_read(struct intel_output *intel_output,
|
||||
intel_dp_aux_native_read(struct intel_encoder *intel_encoder,
|
||||
uint16_t address, uint8_t *recv, int recv_bytes)
|
||||
{
|
||||
uint8_t msg[4];
|
||||
|
@ -372,7 +372,7 @@ intel_dp_aux_native_read(struct intel_output *intel_output,
|
|||
reply_bytes = recv_bytes + 1;
|
||||
|
||||
for (;;) {
|
||||
ret = intel_dp_aux_ch(intel_output, msg, msg_bytes,
|
||||
ret = intel_dp_aux_ch(intel_encoder, msg, msg_bytes,
|
||||
reply, reply_bytes);
|
||||
if (ret == 0)
|
||||
return -EPROTO;
|
||||
|
@ -398,7 +398,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
|
|||
struct intel_dp_priv *dp_priv = container_of(adapter,
|
||||
struct intel_dp_priv,
|
||||
adapter);
|
||||
struct intel_output *intel_output = dp_priv->intel_output;
|
||||
struct intel_encoder *intel_encoder = dp_priv->intel_encoder;
|
||||
uint16_t address = algo_data->address;
|
||||
uint8_t msg[5];
|
||||
uint8_t reply[2];
|
||||
|
@ -437,7 +437,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
|
|||
}
|
||||
|
||||
for (;;) {
|
||||
ret = intel_dp_aux_ch(intel_output,
|
||||
ret = intel_dp_aux_ch(intel_encoder,
|
||||
msg, msg_bytes,
|
||||
reply, reply_bytes);
|
||||
if (ret < 0) {
|
||||
|
@ -465,9 +465,9 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
|
|||
}
|
||||
|
||||
static int
|
||||
intel_dp_i2c_init(struct intel_output *intel_output, const char *name)
|
||||
intel_dp_i2c_init(struct intel_encoder *intel_encoder, const char *name)
|
||||
{
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
|
||||
DRM_DEBUG_KMS("i2c_init %s\n", name);
|
||||
dp_priv->algo.running = false;
|
||||
|
@ -480,7 +480,7 @@ intel_dp_i2c_init(struct intel_output *intel_output, const char *name)
|
|||
strncpy (dp_priv->adapter.name, name, sizeof(dp_priv->adapter.name) - 1);
|
||||
dp_priv->adapter.name[sizeof(dp_priv->adapter.name) - 1] = '\0';
|
||||
dp_priv->adapter.algo_data = &dp_priv->algo;
|
||||
dp_priv->adapter.dev.parent = &intel_output->base.kdev;
|
||||
dp_priv->adapter.dev.parent = &intel_encoder->base.kdev;
|
||||
|
||||
return i2c_dp_aux_add_bus(&dp_priv->adapter);
|
||||
}
|
||||
|
@ -489,18 +489,18 @@ static bool
|
|||
intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
int lane_count, clock;
|
||||
int max_lane_count = intel_dp_max_lane_count(intel_output);
|
||||
int max_clock = intel_dp_max_link_bw(intel_output) == DP_LINK_BW_2_7 ? 1 : 0;
|
||||
int max_lane_count = intel_dp_max_lane_count(intel_encoder);
|
||||
int max_clock = intel_dp_max_link_bw(intel_encoder) == DP_LINK_BW_2_7 ? 1 : 0;
|
||||
static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
|
||||
|
||||
for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
|
||||
for (clock = 0; clock <= max_clock; clock++) {
|
||||
int link_avail = intel_dp_link_clock(bws[clock]) * lane_count;
|
||||
|
||||
if (intel_dp_link_required(encoder->dev, intel_output, mode->clock)
|
||||
if (intel_dp_link_required(encoder->dev, intel_encoder, mode->clock)
|
||||
<= link_avail) {
|
||||
dp_priv->link_bw = bws[clock];
|
||||
dp_priv->lane_count = lane_count;
|
||||
|
@ -562,16 +562,16 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
|
|||
struct intel_dp_m_n m_n;
|
||||
|
||||
/*
|
||||
* Find the lane count in the intel_output private
|
||||
* Find the lane count in the intel_encoder private
|
||||
*/
|
||||
list_for_each_entry(connector, &mode_config->connector_list, head) {
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
|
||||
if (!connector->encoder || connector->encoder->crtc != crtc)
|
||||
continue;
|
||||
|
||||
if (intel_output->type == INTEL_OUTPUT_DISPLAYPORT) {
|
||||
if (intel_encoder->type == INTEL_OUTPUT_DISPLAYPORT) {
|
||||
lane_count = dp_priv->lane_count;
|
||||
break;
|
||||
}
|
||||
|
@ -626,9 +626,9 @@ static void
|
|||
intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct drm_crtc *crtc = intel_output->enc.crtc;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
struct drm_crtc *crtc = intel_encoder->enc.crtc;
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
|
||||
dp_priv->DP = (DP_LINK_TRAIN_OFF |
|
||||
|
@ -667,7 +667,7 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
|
|||
if (intel_crtc->pipe == 1)
|
||||
dp_priv->DP |= DP_PIPEB_SELECT;
|
||||
|
||||
if (IS_eDP(intel_output)) {
|
||||
if (IS_eDP(intel_encoder)) {
|
||||
/* don't miss out required setting for eDP */
|
||||
dp_priv->DP |= DP_PLL_ENABLE;
|
||||
if (adjusted_mode->clock < 200000)
|
||||
|
@ -702,22 +702,22 @@ static void ironlake_edp_backlight_off (struct drm_device *dev)
|
|||
static void
|
||||
intel_dp_dpms(struct drm_encoder *encoder, int mode)
|
||||
{
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
uint32_t dp_reg = I915_READ(dp_priv->output_reg);
|
||||
|
||||
if (mode != DRM_MODE_DPMS_ON) {
|
||||
if (dp_reg & DP_PORT_EN) {
|
||||
intel_dp_link_down(intel_output, dp_priv->DP);
|
||||
if (IS_eDP(intel_output))
|
||||
intel_dp_link_down(intel_encoder, dp_priv->DP);
|
||||
if (IS_eDP(intel_encoder))
|
||||
ironlake_edp_backlight_off(dev);
|
||||
}
|
||||
} else {
|
||||
if (!(dp_reg & DP_PORT_EN)) {
|
||||
intel_dp_link_train(intel_output, dp_priv->DP, dp_priv->link_configuration);
|
||||
if (IS_eDP(intel_output))
|
||||
intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration);
|
||||
if (IS_eDP(intel_encoder))
|
||||
ironlake_edp_backlight_on(dev);
|
||||
}
|
||||
}
|
||||
|
@ -729,12 +729,12 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
|
|||
* link status information
|
||||
*/
|
||||
static bool
|
||||
intel_dp_get_link_status(struct intel_output *intel_output,
|
||||
intel_dp_get_link_status(struct intel_encoder *intel_encoder,
|
||||
uint8_t link_status[DP_LINK_STATUS_SIZE])
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = intel_dp_aux_native_read(intel_output,
|
||||
ret = intel_dp_aux_native_read(intel_encoder,
|
||||
DP_LANE0_1_STATUS,
|
||||
link_status, DP_LINK_STATUS_SIZE);
|
||||
if (ret != DP_LINK_STATUS_SIZE)
|
||||
|
@ -752,13 +752,13 @@ intel_dp_link_status(uint8_t link_status[DP_LINK_STATUS_SIZE],
|
|||
static void
|
||||
intel_dp_save(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
|
||||
dp_priv->save_DP = I915_READ(dp_priv->output_reg);
|
||||
intel_dp_aux_native_read(intel_output, DP_LINK_BW_SET,
|
||||
intel_dp_aux_native_read(intel_encoder, DP_LINK_BW_SET,
|
||||
dp_priv->save_link_configuration,
|
||||
sizeof (dp_priv->save_link_configuration));
|
||||
}
|
||||
|
@ -825,7 +825,7 @@ intel_dp_pre_emphasis_max(uint8_t voltage_swing)
|
|||
}
|
||||
|
||||
static void
|
||||
intel_get_adjust_train(struct intel_output *intel_output,
|
||||
intel_get_adjust_train(struct intel_encoder *intel_encoder,
|
||||
uint8_t link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane_count,
|
||||
uint8_t train_set[4])
|
||||
|
@ -942,15 +942,15 @@ intel_channel_eq_ok(uint8_t link_status[DP_LINK_STATUS_SIZE], int lane_count)
|
|||
}
|
||||
|
||||
static bool
|
||||
intel_dp_set_link_train(struct intel_output *intel_output,
|
||||
intel_dp_set_link_train(struct intel_encoder *intel_encoder,
|
||||
uint32_t dp_reg_value,
|
||||
uint8_t dp_train_pat,
|
||||
uint8_t train_set[4],
|
||||
bool first)
|
||||
{
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
int ret;
|
||||
|
||||
I915_WRITE(dp_priv->output_reg, dp_reg_value);
|
||||
|
@ -958,11 +958,11 @@ intel_dp_set_link_train(struct intel_output *intel_output,
|
|||
if (first)
|
||||
intel_wait_for_vblank(dev);
|
||||
|
||||
intel_dp_aux_native_write_1(intel_output,
|
||||
intel_dp_aux_native_write_1(intel_encoder,
|
||||
DP_TRAINING_PATTERN_SET,
|
||||
dp_train_pat);
|
||||
|
||||
ret = intel_dp_aux_native_write(intel_output,
|
||||
ret = intel_dp_aux_native_write(intel_encoder,
|
||||
DP_TRAINING_LANE0_SET, train_set, 4);
|
||||
if (ret != 4)
|
||||
return false;
|
||||
|
@ -971,12 +971,12 @@ intel_dp_set_link_train(struct intel_output *intel_output,
|
|||
}
|
||||
|
||||
static void
|
||||
intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
|
||||
intel_dp_link_train(struct intel_encoder *intel_encoder, uint32_t DP,
|
||||
uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE])
|
||||
{
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
uint8_t train_set[4];
|
||||
uint8_t link_status[DP_LINK_STATUS_SIZE];
|
||||
int i;
|
||||
|
@ -987,7 +987,7 @@ intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
|
|||
int tries;
|
||||
|
||||
/* Write the link configuration data */
|
||||
intel_dp_aux_native_write(intel_output, 0x100,
|
||||
intel_dp_aux_native_write(intel_encoder, 0x100,
|
||||
link_configuration, DP_LINK_CONFIGURATION_SIZE);
|
||||
|
||||
DP |= DP_PORT_EN;
|
||||
|
@ -1001,14 +1001,14 @@ intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
|
|||
uint32_t signal_levels = intel_dp_signal_levels(train_set[0], dp_priv->lane_count);
|
||||
DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
|
||||
|
||||
if (!intel_dp_set_link_train(intel_output, DP | DP_LINK_TRAIN_PAT_1,
|
||||
if (!intel_dp_set_link_train(intel_encoder, DP | DP_LINK_TRAIN_PAT_1,
|
||||
DP_TRAINING_PATTERN_1, train_set, first))
|
||||
break;
|
||||
first = false;
|
||||
/* Set training pattern 1 */
|
||||
|
||||
udelay(100);
|
||||
if (!intel_dp_get_link_status(intel_output, link_status))
|
||||
if (!intel_dp_get_link_status(intel_encoder, link_status))
|
||||
break;
|
||||
|
||||
if (intel_clock_recovery_ok(link_status, dp_priv->lane_count)) {
|
||||
|
@ -1033,7 +1033,7 @@ intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
|
|||
voltage = train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
|
||||
|
||||
/* Compute new train_set as requested by target */
|
||||
intel_get_adjust_train(intel_output, link_status, dp_priv->lane_count, train_set);
|
||||
intel_get_adjust_train(intel_encoder, link_status, dp_priv->lane_count, train_set);
|
||||
}
|
||||
|
||||
/* channel equalization */
|
||||
|
@ -1045,13 +1045,13 @@ intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
|
|||
DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
|
||||
|
||||
/* channel eq pattern */
|
||||
if (!intel_dp_set_link_train(intel_output, DP | DP_LINK_TRAIN_PAT_2,
|
||||
if (!intel_dp_set_link_train(intel_encoder, DP | DP_LINK_TRAIN_PAT_2,
|
||||
DP_TRAINING_PATTERN_2, train_set,
|
||||
false))
|
||||
break;
|
||||
|
||||
udelay(400);
|
||||
if (!intel_dp_get_link_status(intel_output, link_status))
|
||||
if (!intel_dp_get_link_status(intel_encoder, link_status))
|
||||
break;
|
||||
|
||||
if (intel_channel_eq_ok(link_status, dp_priv->lane_count)) {
|
||||
|
@ -1064,26 +1064,26 @@ intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
|
|||
break;
|
||||
|
||||
/* Compute new train_set as requested by target */
|
||||
intel_get_adjust_train(intel_output, link_status, dp_priv->lane_count, train_set);
|
||||
intel_get_adjust_train(intel_encoder, link_status, dp_priv->lane_count, train_set);
|
||||
++tries;
|
||||
}
|
||||
|
||||
I915_WRITE(dp_priv->output_reg, DP | DP_LINK_TRAIN_OFF);
|
||||
POSTING_READ(dp_priv->output_reg);
|
||||
intel_dp_aux_native_write_1(intel_output,
|
||||
intel_dp_aux_native_write_1(intel_encoder,
|
||||
DP_TRAINING_PATTERN_SET, DP_TRAINING_PATTERN_DISABLE);
|
||||
}
|
||||
|
||||
static void
|
||||
intel_dp_link_down(struct intel_output *intel_output, uint32_t DP)
|
||||
intel_dp_link_down(struct intel_encoder *intel_encoder, uint32_t DP)
|
||||
{
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
|
||||
DRM_DEBUG_KMS("\n");
|
||||
|
||||
if (IS_eDP(intel_output)) {
|
||||
if (IS_eDP(intel_encoder)) {
|
||||
DP &= ~DP_PLL_ENABLE;
|
||||
I915_WRITE(dp_priv->output_reg, DP);
|
||||
POSTING_READ(dp_priv->output_reg);
|
||||
|
@ -1096,7 +1096,7 @@ intel_dp_link_down(struct intel_output *intel_output, uint32_t DP)
|
|||
|
||||
udelay(17000);
|
||||
|
||||
if (IS_eDP(intel_output))
|
||||
if (IS_eDP(intel_encoder))
|
||||
DP |= DP_LINK_TRAIN_OFF;
|
||||
I915_WRITE(dp_priv->output_reg, DP & ~DP_PORT_EN);
|
||||
POSTING_READ(dp_priv->output_reg);
|
||||
|
@ -1105,13 +1105,13 @@ intel_dp_link_down(struct intel_output *intel_output, uint32_t DP)
|
|||
static void
|
||||
intel_dp_restore(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
|
||||
if (dp_priv->save_DP & DP_PORT_EN)
|
||||
intel_dp_link_train(intel_output, dp_priv->save_DP, dp_priv->save_link_configuration);
|
||||
intel_dp_link_train(intel_encoder, dp_priv->save_DP, dp_priv->save_link_configuration);
|
||||
else
|
||||
intel_dp_link_down(intel_output, dp_priv->save_DP);
|
||||
intel_dp_link_down(intel_encoder, dp_priv->save_DP);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1124,32 +1124,32 @@ intel_dp_restore(struct drm_connector *connector)
|
|||
*/
|
||||
|
||||
static void
|
||||
intel_dp_check_link_status(struct intel_output *intel_output)
|
||||
intel_dp_check_link_status(struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
uint8_t link_status[DP_LINK_STATUS_SIZE];
|
||||
|
||||
if (!intel_output->enc.crtc)
|
||||
if (!intel_encoder->enc.crtc)
|
||||
return;
|
||||
|
||||
if (!intel_dp_get_link_status(intel_output, link_status)) {
|
||||
intel_dp_link_down(intel_output, dp_priv->DP);
|
||||
if (!intel_dp_get_link_status(intel_encoder, link_status)) {
|
||||
intel_dp_link_down(intel_encoder, dp_priv->DP);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!intel_channel_eq_ok(link_status, dp_priv->lane_count))
|
||||
intel_dp_link_train(intel_output, dp_priv->DP, dp_priv->link_configuration);
|
||||
intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration);
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
ironlake_dp_detect(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
enum drm_connector_status status;
|
||||
|
||||
status = connector_status_disconnected;
|
||||
if (intel_dp_aux_native_read(intel_output,
|
||||
if (intel_dp_aux_native_read(intel_encoder,
|
||||
0x000, dp_priv->dpcd,
|
||||
sizeof (dp_priv->dpcd)) == sizeof (dp_priv->dpcd))
|
||||
{
|
||||
|
@ -1168,10 +1168,10 @@ ironlake_dp_detect(struct drm_connector *connector)
|
|||
static enum drm_connector_status
|
||||
intel_dp_detect(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
uint32_t temp, bit;
|
||||
enum drm_connector_status status;
|
||||
|
||||
|
@ -1210,7 +1210,7 @@ intel_dp_detect(struct drm_connector *connector)
|
|||
return connector_status_disconnected;
|
||||
|
||||
status = connector_status_disconnected;
|
||||
if (intel_dp_aux_native_read(intel_output,
|
||||
if (intel_dp_aux_native_read(intel_encoder,
|
||||
0x000, dp_priv->dpcd,
|
||||
sizeof (dp_priv->dpcd)) == sizeof (dp_priv->dpcd))
|
||||
{
|
||||
|
@ -1222,20 +1222,20 @@ intel_dp_detect(struct drm_connector *connector)
|
|||
|
||||
static int intel_dp_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct drm_device *dev = intel_output->base.dev;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct drm_device *dev = intel_encoder->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
int ret;
|
||||
|
||||
/* We should parse the EDID data and find out if it has an audio sink
|
||||
*/
|
||||
|
||||
ret = intel_ddc_get_modes(intel_output);
|
||||
ret = intel_ddc_get_modes(intel_encoder);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* if eDP has no EDID, try to use fixed panel mode from VBT */
|
||||
if (IS_eDP(intel_output)) {
|
||||
if (IS_eDP(intel_encoder)) {
|
||||
if (dev_priv->panel_fixed_mode != NULL) {
|
||||
struct drm_display_mode *mode;
|
||||
mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode);
|
||||
|
@ -1249,13 +1249,13 @@ static int intel_dp_get_modes(struct drm_connector *connector)
|
|||
static void
|
||||
intel_dp_destroy (struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
if (intel_output->i2c_bus)
|
||||
intel_i2c_destroy(intel_output->i2c_bus);
|
||||
if (intel_encoder->i2c_bus)
|
||||
intel_i2c_destroy(intel_encoder->i2c_bus);
|
||||
drm_sysfs_connector_remove(connector);
|
||||
drm_connector_cleanup(connector);
|
||||
kfree(intel_output);
|
||||
kfree(intel_encoder);
|
||||
}
|
||||
|
||||
static const struct drm_encoder_helper_funcs intel_dp_helper_funcs = {
|
||||
|
@ -1291,12 +1291,12 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {
|
|||
};
|
||||
|
||||
void
|
||||
intel_dp_hot_plug(struct intel_output *intel_output)
|
||||
intel_dp_hot_plug(struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct intel_dp_priv *dp_priv = intel_output->dev_priv;
|
||||
struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
|
||||
|
||||
if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON)
|
||||
intel_dp_check_link_status(intel_output);
|
||||
intel_dp_check_link_status(intel_encoder);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1304,53 +1304,53 @@ intel_dp_init(struct drm_device *dev, int output_reg)
|
|||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_connector *connector;
|
||||
struct intel_output *intel_output;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct intel_dp_priv *dp_priv;
|
||||
const char *name = NULL;
|
||||
|
||||
intel_output = kcalloc(sizeof(struct intel_output) +
|
||||
intel_encoder = kcalloc(sizeof(struct intel_encoder) +
|
||||
sizeof(struct intel_dp_priv), 1, GFP_KERNEL);
|
||||
if (!intel_output)
|
||||
if (!intel_encoder)
|
||||
return;
|
||||
|
||||
dp_priv = (struct intel_dp_priv *)(intel_output + 1);
|
||||
dp_priv = (struct intel_dp_priv *)(intel_encoder + 1);
|
||||
|
||||
connector = &intel_output->base;
|
||||
connector = &intel_encoder->base;
|
||||
drm_connector_init(dev, connector, &intel_dp_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_DisplayPort);
|
||||
drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs);
|
||||
|
||||
if (output_reg == DP_A)
|
||||
intel_output->type = INTEL_OUTPUT_EDP;
|
||||
intel_encoder->type = INTEL_OUTPUT_EDP;
|
||||
else
|
||||
intel_output->type = INTEL_OUTPUT_DISPLAYPORT;
|
||||
intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
|
||||
|
||||
if (output_reg == DP_B || output_reg == PCH_DP_B)
|
||||
intel_output->clone_mask = (1 << INTEL_DP_B_CLONE_BIT);
|
||||
intel_encoder->clone_mask = (1 << INTEL_DP_B_CLONE_BIT);
|
||||
else if (output_reg == DP_C || output_reg == PCH_DP_C)
|
||||
intel_output->clone_mask = (1 << INTEL_DP_C_CLONE_BIT);
|
||||
intel_encoder->clone_mask = (1 << INTEL_DP_C_CLONE_BIT);
|
||||
else if (output_reg == DP_D || output_reg == PCH_DP_D)
|
||||
intel_output->clone_mask = (1 << INTEL_DP_D_CLONE_BIT);
|
||||
intel_encoder->clone_mask = (1 << INTEL_DP_D_CLONE_BIT);
|
||||
|
||||
if (IS_eDP(intel_output))
|
||||
intel_output->clone_mask = (1 << INTEL_EDP_CLONE_BIT);
|
||||
if (IS_eDP(intel_encoder))
|
||||
intel_encoder->clone_mask = (1 << INTEL_EDP_CLONE_BIT);
|
||||
|
||||
intel_output->crtc_mask = (1 << 0) | (1 << 1);
|
||||
intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = 0;
|
||||
|
||||
dp_priv->intel_output = intel_output;
|
||||
dp_priv->intel_encoder = intel_encoder;
|
||||
dp_priv->output_reg = output_reg;
|
||||
dp_priv->has_audio = false;
|
||||
dp_priv->dpms_mode = DRM_MODE_DPMS_ON;
|
||||
intel_output->dev_priv = dp_priv;
|
||||
intel_encoder->dev_priv = dp_priv;
|
||||
|
||||
drm_encoder_init(dev, &intel_output->enc, &intel_dp_enc_funcs,
|
||||
drm_encoder_init(dev, &intel_encoder->enc, &intel_dp_enc_funcs,
|
||||
DRM_MODE_ENCODER_TMDS);
|
||||
drm_encoder_helper_add(&intel_output->enc, &intel_dp_helper_funcs);
|
||||
drm_encoder_helper_add(&intel_encoder->enc, &intel_dp_helper_funcs);
|
||||
|
||||
drm_mode_connector_attach_encoder(&intel_output->base,
|
||||
&intel_output->enc);
|
||||
drm_mode_connector_attach_encoder(&intel_encoder->base,
|
||||
&intel_encoder->enc);
|
||||
drm_sysfs_connector_add(connector);
|
||||
|
||||
/* Set up the DDC bus. */
|
||||
|
@ -1378,10 +1378,10 @@ intel_dp_init(struct drm_device *dev, int output_reg)
|
|||
break;
|
||||
}
|
||||
|
||||
intel_dp_i2c_init(intel_output, name);
|
||||
intel_dp_i2c_init(intel_encoder, name);
|
||||
|
||||
intel_output->ddc_bus = &dp_priv->adapter;
|
||||
intel_output->hot_plug = intel_dp_hot_plug;
|
||||
intel_encoder->ddc_bus = &dp_priv->adapter;
|
||||
intel_encoder->hot_plug = intel_dp_hot_plug;
|
||||
|
||||
if (output_reg == DP_A) {
|
||||
/* initialize panel mode from VBT if available for eDP */
|
||||
|
|
|
@ -95,7 +95,7 @@ struct intel_framebuffer {
|
|||
};
|
||||
|
||||
|
||||
struct intel_output {
|
||||
struct intel_encoder {
|
||||
struct drm_connector base;
|
||||
|
||||
struct drm_encoder enc;
|
||||
|
@ -105,7 +105,7 @@ struct intel_output {
|
|||
bool load_detect_temp;
|
||||
bool needs_tv_clock;
|
||||
void *dev_priv;
|
||||
void (*hot_plug)(struct intel_output *);
|
||||
void (*hot_plug)(struct intel_encoder *);
|
||||
int crtc_mask;
|
||||
int clone_mask;
|
||||
};
|
||||
|
@ -152,15 +152,15 @@ struct intel_crtc {
|
|||
};
|
||||
|
||||
#define to_intel_crtc(x) container_of(x, struct intel_crtc, base)
|
||||
#define to_intel_output(x) container_of(x, struct intel_output, base)
|
||||
#define enc_to_intel_output(x) container_of(x, struct intel_output, enc)
|
||||
#define to_intel_encoder(x) container_of(x, struct intel_encoder, base)
|
||||
#define enc_to_intel_encoder(x) container_of(x, struct intel_encoder, enc)
|
||||
#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
|
||||
|
||||
struct i2c_adapter *intel_i2c_create(struct drm_device *dev, const u32 reg,
|
||||
const char *name);
|
||||
void intel_i2c_destroy(struct i2c_adapter *adapter);
|
||||
int intel_ddc_get_modes(struct intel_output *intel_output);
|
||||
extern bool intel_ddc_probe(struct intel_output *intel_output);
|
||||
int intel_ddc_get_modes(struct intel_encoder *intel_encoder);
|
||||
extern bool intel_ddc_probe(struct intel_encoder *intel_encoder);
|
||||
void intel_i2c_quirk_set(struct drm_device *dev, bool enable);
|
||||
void intel_i2c_reset_gmbus(struct drm_device *dev);
|
||||
|
||||
|
@ -175,7 +175,7 @@ extern void intel_dp_init(struct drm_device *dev, int dp_reg);
|
|||
void
|
||||
intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted_mode);
|
||||
extern void intel_edp_link_config (struct intel_output *, int *, int *);
|
||||
extern void intel_edp_link_config (struct intel_encoder *, int *, int *);
|
||||
|
||||
|
||||
extern int intel_panel_fitter_pipe (struct drm_device *dev);
|
||||
|
@ -191,10 +191,10 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
|
|||
struct drm_file *file_priv);
|
||||
extern void intel_wait_for_vblank(struct drm_device *dev);
|
||||
extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe);
|
||||
extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output,
|
||||
extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
|
||||
struct drm_display_mode *mode,
|
||||
int *dpms_mode);
|
||||
extern void intel_release_load_detect_pipe(struct intel_output *intel_output,
|
||||
extern void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder,
|
||||
int dpms_mode);
|
||||
|
||||
extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB);
|
||||
|
|
|
@ -80,8 +80,8 @@ static struct intel_dvo_device intel_dvo_devices[] = {
|
|||
static void intel_dvo_dpms(struct drm_encoder *encoder, int mode)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
u32 dvo_reg = dvo->dvo_reg;
|
||||
u32 temp = I915_READ(dvo_reg);
|
||||
|
||||
|
@ -99,8 +99,8 @@ static void intel_dvo_dpms(struct drm_encoder *encoder, int mode)
|
|||
static void intel_dvo_save(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = connector->dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
|
||||
/* Each output should probably just save the registers it touches,
|
||||
* but for now, use more overkill.
|
||||
|
@ -115,8 +115,8 @@ static void intel_dvo_save(struct drm_connector *connector)
|
|||
static void intel_dvo_restore(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = connector->dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
|
||||
dvo->dev_ops->restore(dvo);
|
||||
|
||||
|
@ -128,8 +128,8 @@ static void intel_dvo_restore(struct drm_connector *connector)
|
|||
static int intel_dvo_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
|
@ -150,8 +150,8 @@ static bool intel_dvo_mode_fixup(struct drm_encoder *encoder,
|
|||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
|
||||
/* If we have timings from the BIOS for the panel, put them in
|
||||
* to the adjusted mode. The CRTC will be set up for this mode,
|
||||
|
@ -186,8 +186,8 @@ static void intel_dvo_mode_set(struct drm_encoder *encoder,
|
|||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
int pipe = intel_crtc->pipe;
|
||||
u32 dvo_val;
|
||||
u32 dvo_reg = dvo->dvo_reg, dvo_srcdim_reg;
|
||||
|
@ -241,23 +241,23 @@ static void intel_dvo_mode_set(struct drm_encoder *encoder,
|
|||
*/
|
||||
static enum drm_connector_status intel_dvo_detect(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
|
||||
return dvo->dev_ops->detect(dvo);
|
||||
}
|
||||
|
||||
static int intel_dvo_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
|
||||
/* We should probably have an i2c driver get_modes function for those
|
||||
* devices which will have a fixed set of modes determined by the chip
|
||||
* (TV-out, for example), but for now with just TMDS and LVDS,
|
||||
* that's not the case.
|
||||
*/
|
||||
intel_ddc_get_modes(intel_output);
|
||||
intel_ddc_get_modes(intel_encoder);
|
||||
if (!list_empty(&connector->probed_modes))
|
||||
return 1;
|
||||
|
||||
|
@ -275,8 +275,8 @@ static int intel_dvo_get_modes(struct drm_connector *connector)
|
|||
|
||||
static void intel_dvo_destroy (struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
|
||||
if (dvo) {
|
||||
if (dvo->dev_ops->destroy)
|
||||
|
@ -286,13 +286,13 @@ static void intel_dvo_destroy (struct drm_connector *connector)
|
|||
/* no need, in i830_dvoices[] now */
|
||||
//kfree(dvo);
|
||||
}
|
||||
if (intel_output->i2c_bus)
|
||||
intel_i2c_destroy(intel_output->i2c_bus);
|
||||
if (intel_output->ddc_bus)
|
||||
intel_i2c_destroy(intel_output->ddc_bus);
|
||||
if (intel_encoder->i2c_bus)
|
||||
intel_i2c_destroy(intel_encoder->i2c_bus);
|
||||
if (intel_encoder->ddc_bus)
|
||||
intel_i2c_destroy(intel_encoder->ddc_bus);
|
||||
drm_sysfs_connector_remove(connector);
|
||||
drm_connector_cleanup(connector);
|
||||
kfree(intel_output);
|
||||
kfree(intel_encoder);
|
||||
}
|
||||
|
||||
#ifdef RANDR_GET_CRTC_INTERFACE
|
||||
|
@ -300,8 +300,8 @@ static struct drm_crtc *intel_dvo_get_crtc(struct drm_connector *connector)
|
|||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
int pipe = !!(I915_READ(dvo->dvo_reg) & SDVO_PIPE_B_SELECT);
|
||||
|
||||
return intel_pipe_to_crtc(pScrn, pipe);
|
||||
|
@ -352,8 +352,8 @@ intel_dvo_get_current_mode (struct drm_connector *connector)
|
|||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_dvo_device *dvo = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_dvo_device *dvo = intel_encoder->dev_priv;
|
||||
uint32_t dvo_reg = dvo->dvo_reg;
|
||||
uint32_t dvo_val = I915_READ(dvo_reg);
|
||||
struct drm_display_mode *mode = NULL;
|
||||
|
@ -383,24 +383,24 @@ intel_dvo_get_current_mode (struct drm_connector *connector)
|
|||
|
||||
void intel_dvo_init(struct drm_device *dev)
|
||||
{
|
||||
struct intel_output *intel_output;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct intel_dvo_device *dvo;
|
||||
struct i2c_adapter *i2cbus = NULL;
|
||||
int ret = 0;
|
||||
int i;
|
||||
int encoder_type = DRM_MODE_ENCODER_NONE;
|
||||
intel_output = kzalloc (sizeof(struct intel_output), GFP_KERNEL);
|
||||
if (!intel_output)
|
||||
intel_encoder = kzalloc (sizeof(struct intel_encoder), GFP_KERNEL);
|
||||
if (!intel_encoder)
|
||||
return;
|
||||
|
||||
/* Set up the DDC bus */
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "DVODDC_D");
|
||||
if (!intel_output->ddc_bus)
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOD, "DVODDC_D");
|
||||
if (!intel_encoder->ddc_bus)
|
||||
goto free_intel;
|
||||
|
||||
/* Now, try to find a controller */
|
||||
for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) {
|
||||
struct drm_connector *connector = &intel_output->base;
|
||||
struct drm_connector *connector = &intel_encoder->base;
|
||||
int gpio;
|
||||
|
||||
dvo = &intel_dvo_devices[i];
|
||||
|
@ -435,11 +435,11 @@ void intel_dvo_init(struct drm_device *dev)
|
|||
if (!ret)
|
||||
continue;
|
||||
|
||||
intel_output->type = INTEL_OUTPUT_DVO;
|
||||
intel_output->crtc_mask = (1 << 0) | (1 << 1);
|
||||
intel_encoder->type = INTEL_OUTPUT_DVO;
|
||||
intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
|
||||
switch (dvo->type) {
|
||||
case INTEL_DVO_CHIP_TMDS:
|
||||
intel_output->clone_mask =
|
||||
intel_encoder->clone_mask =
|
||||
(1 << INTEL_DVO_TMDS_CLONE_BIT) |
|
||||
(1 << INTEL_ANALOG_CLONE_BIT);
|
||||
drm_connector_init(dev, connector,
|
||||
|
@ -448,7 +448,7 @@ void intel_dvo_init(struct drm_device *dev)
|
|||
encoder_type = DRM_MODE_ENCODER_TMDS;
|
||||
break;
|
||||
case INTEL_DVO_CHIP_LVDS:
|
||||
intel_output->clone_mask =
|
||||
intel_encoder->clone_mask =
|
||||
(1 << INTEL_DVO_LVDS_CLONE_BIT);
|
||||
drm_connector_init(dev, connector,
|
||||
&intel_dvo_connector_funcs,
|
||||
|
@ -463,16 +463,16 @@ void intel_dvo_init(struct drm_device *dev)
|
|||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
|
||||
intel_output->dev_priv = dvo;
|
||||
intel_output->i2c_bus = i2cbus;
|
||||
intel_encoder->dev_priv = dvo;
|
||||
intel_encoder->i2c_bus = i2cbus;
|
||||
|
||||
drm_encoder_init(dev, &intel_output->enc,
|
||||
drm_encoder_init(dev, &intel_encoder->enc,
|
||||
&intel_dvo_enc_funcs, encoder_type);
|
||||
drm_encoder_helper_add(&intel_output->enc,
|
||||
drm_encoder_helper_add(&intel_encoder->enc,
|
||||
&intel_dvo_helper_funcs);
|
||||
|
||||
drm_mode_connector_attach_encoder(&intel_output->base,
|
||||
&intel_output->enc);
|
||||
drm_mode_connector_attach_encoder(&intel_encoder->base,
|
||||
&intel_encoder->enc);
|
||||
if (dvo->type == INTEL_DVO_CHIP_LVDS) {
|
||||
/* For our LVDS chipsets, we should hopefully be able
|
||||
* to dig the fixed panel mode out of the BIOS data.
|
||||
|
@ -490,10 +490,10 @@ void intel_dvo_init(struct drm_device *dev)
|
|||
return;
|
||||
}
|
||||
|
||||
intel_i2c_destroy(intel_output->ddc_bus);
|
||||
intel_i2c_destroy(intel_encoder->ddc_bus);
|
||||
/* Didn't find a chip, so tear down. */
|
||||
if (i2cbus != NULL)
|
||||
intel_i2c_destroy(i2cbus);
|
||||
free_intel:
|
||||
kfree(intel_output);
|
||||
kfree(intel_encoder);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width,
|
|||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
obj_priv = fbo->driver_private;
|
||||
obj_priv = to_intel_bo(fbo);
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
|
|||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_crtc *crtc = encoder->crtc;
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv;
|
||||
u32 sdvox;
|
||||
|
||||
sdvox = SDVO_ENCODING_HDMI |
|
||||
|
@ -74,8 +74,8 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
|
|||
{
|
||||
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_hdmi_priv *hdmi_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv;
|
||||
u32 temp;
|
||||
|
||||
temp = I915_READ(hdmi_priv->sdvox_reg);
|
||||
|
@ -110,8 +110,8 @@ static void intel_hdmi_save(struct drm_connector *connector)
|
|||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv;
|
||||
|
||||
hdmi_priv->save_SDVOX = I915_READ(hdmi_priv->sdvox_reg);
|
||||
}
|
||||
|
@ -120,8 +120,8 @@ static void intel_hdmi_restore(struct drm_connector *connector)
|
|||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv;
|
||||
|
||||
I915_WRITE(hdmi_priv->sdvox_reg, hdmi_priv->save_SDVOX);
|
||||
POSTING_READ(hdmi_priv->sdvox_reg);
|
||||
|
@ -151,21 +151,21 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
|
|||
static enum drm_connector_status
|
||||
intel_hdmi_detect(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv;
|
||||
struct edid *edid = NULL;
|
||||
enum drm_connector_status status = connector_status_disconnected;
|
||||
|
||||
hdmi_priv->has_hdmi_sink = false;
|
||||
edid = drm_get_edid(&intel_output->base,
|
||||
intel_output->ddc_bus);
|
||||
edid = drm_get_edid(&intel_encoder->base,
|
||||
intel_encoder->ddc_bus);
|
||||
|
||||
if (edid) {
|
||||
if (edid->input & DRM_EDID_INPUT_DIGITAL) {
|
||||
status = connector_status_connected;
|
||||
hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
|
||||
}
|
||||
intel_output->base.display_info.raw_edid = NULL;
|
||||
intel_encoder->base.display_info.raw_edid = NULL;
|
||||
kfree(edid);
|
||||
}
|
||||
|
||||
|
@ -174,24 +174,24 @@ intel_hdmi_detect(struct drm_connector *connector)
|
|||
|
||||
static int intel_hdmi_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
/* We should parse the EDID data and find out if it's an HDMI sink so
|
||||
* we can send audio to it.
|
||||
*/
|
||||
|
||||
return intel_ddc_get_modes(intel_output);
|
||||
return intel_ddc_get_modes(intel_encoder);
|
||||
}
|
||||
|
||||
static void intel_hdmi_destroy(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
if (intel_output->i2c_bus)
|
||||
intel_i2c_destroy(intel_output->i2c_bus);
|
||||
if (intel_encoder->i2c_bus)
|
||||
intel_i2c_destroy(intel_encoder->i2c_bus);
|
||||
drm_sysfs_connector_remove(connector);
|
||||
drm_connector_cleanup(connector);
|
||||
kfree(intel_output);
|
||||
kfree(intel_encoder);
|
||||
}
|
||||
|
||||
static const struct drm_encoder_helper_funcs intel_hdmi_helper_funcs = {
|
||||
|
@ -230,63 +230,63 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
|
|||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_connector *connector;
|
||||
struct intel_output *intel_output;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct intel_hdmi_priv *hdmi_priv;
|
||||
|
||||
intel_output = kcalloc(sizeof(struct intel_output) +
|
||||
intel_encoder = kcalloc(sizeof(struct intel_encoder) +
|
||||
sizeof(struct intel_hdmi_priv), 1, GFP_KERNEL);
|
||||
if (!intel_output)
|
||||
if (!intel_encoder)
|
||||
return;
|
||||
hdmi_priv = (struct intel_hdmi_priv *)(intel_output + 1);
|
||||
hdmi_priv = (struct intel_hdmi_priv *)(intel_encoder + 1);
|
||||
|
||||
connector = &intel_output->base;
|
||||
connector = &intel_encoder->base;
|
||||
drm_connector_init(dev, connector, &intel_hdmi_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_HDMIA);
|
||||
drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs);
|
||||
|
||||
intel_output->type = INTEL_OUTPUT_HDMI;
|
||||
intel_encoder->type = INTEL_OUTPUT_HDMI;
|
||||
|
||||
connector->interlace_allowed = 0;
|
||||
connector->doublescan_allowed = 0;
|
||||
intel_output->crtc_mask = (1 << 0) | (1 << 1);
|
||||
intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
|
||||
|
||||
/* Set up the DDC bus. */
|
||||
if (sdvox_reg == SDVOB) {
|
||||
intel_output->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT);
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB");
|
||||
intel_encoder->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT);
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB");
|
||||
dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS;
|
||||
} else if (sdvox_reg == SDVOC) {
|
||||
intel_output->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT);
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC");
|
||||
intel_encoder->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT);
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC");
|
||||
dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS;
|
||||
} else if (sdvox_reg == HDMIB) {
|
||||
intel_output->clone_mask = (1 << INTEL_HDMID_CLONE_BIT);
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOE,
|
||||
intel_encoder->clone_mask = (1 << INTEL_HDMID_CLONE_BIT);
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, PCH_GPIOE,
|
||||
"HDMIB");
|
||||
dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS;
|
||||
} else if (sdvox_reg == HDMIC) {
|
||||
intel_output->clone_mask = (1 << INTEL_HDMIE_CLONE_BIT);
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOD,
|
||||
intel_encoder->clone_mask = (1 << INTEL_HDMIE_CLONE_BIT);
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, PCH_GPIOD,
|
||||
"HDMIC");
|
||||
dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS;
|
||||
} else if (sdvox_reg == HDMID) {
|
||||
intel_output->clone_mask = (1 << INTEL_HDMIF_CLONE_BIT);
|
||||
intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOF,
|
||||
intel_encoder->clone_mask = (1 << INTEL_HDMIF_CLONE_BIT);
|
||||
intel_encoder->ddc_bus = intel_i2c_create(dev, PCH_GPIOF,
|
||||
"HDMID");
|
||||
dev_priv->hotplug_supported_mask |= HDMID_HOTPLUG_INT_STATUS;
|
||||
}
|
||||
if (!intel_output->ddc_bus)
|
||||
if (!intel_encoder->ddc_bus)
|
||||
goto err_connector;
|
||||
|
||||
hdmi_priv->sdvox_reg = sdvox_reg;
|
||||
intel_output->dev_priv = hdmi_priv;
|
||||
intel_encoder->dev_priv = hdmi_priv;
|
||||
|
||||
drm_encoder_init(dev, &intel_output->enc, &intel_hdmi_enc_funcs,
|
||||
drm_encoder_init(dev, &intel_encoder->enc, &intel_hdmi_enc_funcs,
|
||||
DRM_MODE_ENCODER_TMDS);
|
||||
drm_encoder_helper_add(&intel_output->enc, &intel_hdmi_helper_funcs);
|
||||
drm_encoder_helper_add(&intel_encoder->enc, &intel_hdmi_helper_funcs);
|
||||
|
||||
drm_mode_connector_attach_encoder(&intel_output->base,
|
||||
&intel_output->enc);
|
||||
drm_mode_connector_attach_encoder(&intel_encoder->base,
|
||||
&intel_encoder->enc);
|
||||
drm_sysfs_connector_add(connector);
|
||||
|
||||
/* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
|
||||
|
@ -302,7 +302,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
|
|||
|
||||
err_connector:
|
||||
drm_connector_cleanup(connector);
|
||||
kfree(intel_output);
|
||||
kfree(intel_encoder);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -239,8 +239,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;
|
||||
|
@ -587,8 +587,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
|
||||
|
@ -635,14 +635,16 @@ 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);
|
||||
if (dev_priv->lvds_edid_good) {
|
||||
ret = intel_ddc_get_modes(intel_encoder);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Didn't get an EDID, so
|
||||
* Set wide sync ranges so we get all modes
|
||||
|
@ -715,11 +717,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);
|
||||
|
@ -732,13 +734,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;
|
||||
|
@ -858,6 +860,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = intel_no_lvds_dmi_callback,
|
||||
.ident = "Clientron U800",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Clientron"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "U800"),
|
||||
},
|
||||
},
|
||||
|
||||
{ } /* terminating entry */
|
||||
};
|
||||
|
@ -968,7 +978,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; */
|
||||
|
@ -996,40 +1006,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;
|
||||
|
@ -1044,8 +1054,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;
|
||||
|
@ -1055,7 +1065,10 @@ 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);
|
||||
dev_priv->lvds_edid_good = true;
|
||||
|
||||
if (!intel_ddc_get_modes(intel_encoder))
|
||||
dev_priv->lvds_edid_good = false;
|
||||
|
||||
list_for_each_entry(scan, &connector->probed_modes, head) {
|
||||
mutex_lock(&dev->mode_config.mutex);
|
||||
|
@ -1133,9 +1146,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);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
* intel_ddc_probe
|
||||
*
|
||||
*/
|
||||
bool intel_ddc_probe(struct intel_output *intel_output)
|
||||
bool intel_ddc_probe(struct intel_encoder *intel_encoder)
|
||||
{
|
||||
u8 out_buf[] = { 0x0, 0x0};
|
||||
u8 buf[2];
|
||||
|
@ -54,9 +54,9 @@ bool intel_ddc_probe(struct intel_output *intel_output)
|
|||
}
|
||||
};
|
||||
|
||||
intel_i2c_quirk_set(intel_output->base.dev, true);
|
||||
ret = i2c_transfer(intel_output->ddc_bus, msgs, 2);
|
||||
intel_i2c_quirk_set(intel_output->base.dev, false);
|
||||
intel_i2c_quirk_set(intel_encoder->base.dev, true);
|
||||
ret = i2c_transfer(intel_encoder->ddc_bus, msgs, 2);
|
||||
intel_i2c_quirk_set(intel_encoder->base.dev, false);
|
||||
if (ret == 2)
|
||||
return true;
|
||||
|
||||
|
@ -69,19 +69,19 @@ bool intel_ddc_probe(struct intel_output *intel_output)
|
|||
*
|
||||
* Fetch the EDID information from @connector using the DDC bus.
|
||||
*/
|
||||
int intel_ddc_get_modes(struct intel_output *intel_output)
|
||||
int intel_ddc_get_modes(struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct edid *edid;
|
||||
int ret = 0;
|
||||
|
||||
intel_i2c_quirk_set(intel_output->base.dev, true);
|
||||
edid = drm_get_edid(&intel_output->base, intel_output->ddc_bus);
|
||||
intel_i2c_quirk_set(intel_output->base.dev, false);
|
||||
intel_i2c_quirk_set(intel_encoder->base.dev, true);
|
||||
edid = drm_get_edid(&intel_encoder->base, intel_encoder->ddc_bus);
|
||||
intel_i2c_quirk_set(intel_encoder->base.dev, false);
|
||||
if (edid) {
|
||||
drm_mode_connector_update_edid_property(&intel_output->base,
|
||||
drm_mode_connector_update_edid_property(&intel_encoder->base,
|
||||
edid);
|
||||
ret = drm_add_edid_modes(&intel_output->base, edid);
|
||||
intel_output->base.display_info.raw_edid = NULL;
|
||||
ret = drm_add_edid_modes(&intel_encoder->base, edid);
|
||||
intel_encoder->base.display_info.raw_edid = NULL;
|
||||
kfree(edid);
|
||||
}
|
||||
|
||||
|
|
|
@ -724,7 +724,7 @@ int intel_overlay_do_put_image(struct intel_overlay *overlay,
|
|||
int ret, tmp_width;
|
||||
struct overlay_registers *regs;
|
||||
bool scale_changed = false;
|
||||
struct drm_i915_gem_object *bo_priv = new_bo->driver_private;
|
||||
struct drm_i915_gem_object *bo_priv = to_intel_bo(new_bo);
|
||||
struct drm_device *dev = overlay->dev;
|
||||
|
||||
BUG_ON(!mutex_is_locked(&dev->struct_mutex));
|
||||
|
@ -809,7 +809,7 @@ int intel_overlay_do_put_image(struct intel_overlay *overlay,
|
|||
intel_overlay_continue(overlay, scale_changed);
|
||||
|
||||
overlay->old_vid_bo = overlay->vid_bo;
|
||||
overlay->vid_bo = new_bo->driver_private;
|
||||
overlay->vid_bo = to_intel_bo(new_bo);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -1344,7 +1344,7 @@ void intel_setup_overlay(struct drm_device *dev)
|
|||
reg_bo = drm_gem_object_alloc(dev, PAGE_SIZE);
|
||||
if (!reg_bo)
|
||||
goto out_free;
|
||||
overlay->reg_bo = reg_bo->driver_private;
|
||||
overlay->reg_bo = to_intel_bo(reg_bo);
|
||||
|
||||
if (OVERLAY_NONPHYSICAL(dev)) {
|
||||
ret = i915_gem_object_pin(reg_bo, PAGE_SIZE);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -921,8 +921,8 @@ intel_tv_save(struct drm_connector *connector)
|
|||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_encoder->dev_priv;
|
||||
int i;
|
||||
|
||||
tv_priv->save_TV_H_CTL_1 = I915_READ(TV_H_CTL_1);
|
||||
|
@ -971,8 +971,8 @@ intel_tv_restore(struct drm_connector *connector)
|
|||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_encoder->dev_priv;
|
||||
struct drm_crtc *crtc = connector->encoder->crtc;
|
||||
struct intel_crtc *intel_crtc;
|
||||
int i;
|
||||
|
@ -1068,9 +1068,9 @@ intel_tv_mode_lookup (char *tv_format)
|
|||
}
|
||||
|
||||
static const struct tv_mode *
|
||||
intel_tv_mode_find (struct intel_output *intel_output)
|
||||
intel_tv_mode_find (struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
|
||||
struct intel_tv_priv *tv_priv = intel_encoder->dev_priv;
|
||||
|
||||
return intel_tv_mode_lookup(tv_priv->tv_format);
|
||||
}
|
||||
|
@ -1078,8 +1078,8 @@ intel_tv_mode_find (struct intel_output *intel_output)
|
|||
static enum drm_mode_status
|
||||
intel_tv_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder);
|
||||
|
||||
/* Ensure TV refresh is close to desired refresh */
|
||||
if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000)
|
||||
|
@ -1095,8 +1095,8 @@ intel_tv_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
|
|||
{
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_mode_config *drm_config = &dev->mode_config;
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find (intel_output);
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find (intel_encoder);
|
||||
struct drm_encoder *other_encoder;
|
||||
|
||||
if (!tv_mode)
|
||||
|
@ -1121,9 +1121,9 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
|
|||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_crtc *crtc = encoder->crtc;
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
struct intel_output *intel_output = enc_to_intel_output(encoder);
|
||||
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
|
||||
struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
|
||||
struct intel_tv_priv *tv_priv = intel_encoder->dev_priv;
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder);
|
||||
u32 tv_ctl;
|
||||
u32 hctl1, hctl2, hctl3;
|
||||
u32 vctl1, vctl2, vctl3, vctl4, vctl5, vctl6, vctl7;
|
||||
|
@ -1360,9 +1360,9 @@ static const struct drm_display_mode reported_modes[] = {
|
|||
* \return false if TV is disconnected.
|
||||
*/
|
||||
static int
|
||||
intel_tv_detect_type (struct drm_crtc *crtc, struct intel_output *intel_output)
|
||||
intel_tv_detect_type (struct drm_crtc *crtc, struct intel_encoder *intel_encoder)
|
||||
{
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
unsigned long irqflags;
|
||||
|
@ -1441,9 +1441,9 @@ intel_tv_detect_type (struct drm_crtc *crtc, struct intel_output *intel_output)
|
|||
*/
|
||||
static void intel_tv_find_better_format(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_encoder->dev_priv;
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder);
|
||||
int i;
|
||||
|
||||
if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) ==
|
||||
|
@ -1475,9 +1475,9 @@ intel_tv_detect(struct drm_connector *connector)
|
|||
{
|
||||
struct drm_crtc *crtc;
|
||||
struct drm_display_mode mode;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_encoder->dev_priv;
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
int dpms_mode;
|
||||
int type = tv_priv->type;
|
||||
|
||||
|
@ -1485,12 +1485,12 @@ intel_tv_detect(struct drm_connector *connector)
|
|||
drm_mode_set_crtcinfo(&mode, CRTC_INTERLACE_HALVE_V);
|
||||
|
||||
if (encoder->crtc && encoder->crtc->enabled) {
|
||||
type = intel_tv_detect_type(encoder->crtc, intel_output);
|
||||
type = intel_tv_detect_type(encoder->crtc, intel_encoder);
|
||||
} else {
|
||||
crtc = intel_get_load_detect_pipe(intel_output, &mode, &dpms_mode);
|
||||
crtc = intel_get_load_detect_pipe(intel_encoder, &mode, &dpms_mode);
|
||||
if (crtc) {
|
||||
type = intel_tv_detect_type(crtc, intel_output);
|
||||
intel_release_load_detect_pipe(intel_output, dpms_mode);
|
||||
type = intel_tv_detect_type(crtc, intel_encoder);
|
||||
intel_release_load_detect_pipe(intel_encoder, dpms_mode);
|
||||
} else
|
||||
type = -1;
|
||||
}
|
||||
|
@ -1525,8 +1525,8 @@ static void
|
|||
intel_tv_chose_preferred_modes(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode_ptr)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder);
|
||||
|
||||
if (tv_mode->nbr_end < 480 && mode_ptr->vdisplay == 480)
|
||||
mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
|
||||
|
@ -1550,8 +1550,8 @@ static int
|
|||
intel_tv_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_display_mode *mode_ptr;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder);
|
||||
int j, count = 0;
|
||||
u64 tmp;
|
||||
|
||||
|
@ -1604,11 +1604,11 @@ intel_tv_get_modes(struct drm_connector *connector)
|
|||
static void
|
||||
intel_tv_destroy (struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
|
||||
drm_sysfs_connector_remove(connector);
|
||||
drm_connector_cleanup(connector);
|
||||
kfree(intel_output);
|
||||
kfree(intel_encoder);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1617,9 +1617,9 @@ intel_tv_set_property(struct drm_connector *connector, struct drm_property *prop
|
|||
uint64_t val)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
|
||||
struct drm_encoder *encoder = &intel_output->enc;
|
||||
struct intel_encoder *intel_encoder = to_intel_encoder(connector);
|
||||
struct intel_tv_priv *tv_priv = intel_encoder->dev_priv;
|
||||
struct drm_encoder *encoder = &intel_encoder->enc;
|
||||
struct drm_crtc *crtc = encoder->crtc;
|
||||
int ret = 0;
|
||||
bool changed = false;
|
||||
|
@ -1740,7 +1740,7 @@ intel_tv_init(struct drm_device *dev)
|
|||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_connector *connector;
|
||||
struct intel_output *intel_output;
|
||||
struct intel_encoder *intel_encoder;
|
||||
struct intel_tv_priv *tv_priv;
|
||||
u32 tv_dac_on, tv_dac_off, save_tv_dac;
|
||||
char **tv_format_names;
|
||||
|
@ -1780,28 +1780,28 @@ intel_tv_init(struct drm_device *dev)
|
|||
(tv_dac_off & TVDAC_STATE_CHG_EN) != 0)
|
||||
return;
|
||||
|
||||
intel_output = kzalloc(sizeof(struct intel_output) +
|
||||
intel_encoder = kzalloc(sizeof(struct intel_encoder) +
|
||||
sizeof(struct intel_tv_priv), GFP_KERNEL);
|
||||
if (!intel_output) {
|
||||
if (!intel_encoder) {
|
||||
return;
|
||||
}
|
||||
|
||||
connector = &intel_output->base;
|
||||
connector = &intel_encoder->base;
|
||||
|
||||
drm_connector_init(dev, connector, &intel_tv_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_SVIDEO);
|
||||
|
||||
drm_encoder_init(dev, &intel_output->enc, &intel_tv_enc_funcs,
|
||||
drm_encoder_init(dev, &intel_encoder->enc, &intel_tv_enc_funcs,
|
||||
DRM_MODE_ENCODER_TVDAC);
|
||||
|
||||
drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);
|
||||
tv_priv = (struct intel_tv_priv *)(intel_output + 1);
|
||||
intel_output->type = INTEL_OUTPUT_TVOUT;
|
||||
intel_output->crtc_mask = (1 << 0) | (1 << 1);
|
||||
intel_output->clone_mask = (1 << INTEL_TV_CLONE_BIT);
|
||||
intel_output->enc.possible_crtcs = ((1 << 0) | (1 << 1));
|
||||
intel_output->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT);
|
||||
intel_output->dev_priv = tv_priv;
|
||||
drm_mode_connector_attach_encoder(&intel_encoder->base, &intel_encoder->enc);
|
||||
tv_priv = (struct intel_tv_priv *)(intel_encoder + 1);
|
||||
intel_encoder->type = INTEL_OUTPUT_TVOUT;
|
||||
intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
|
||||
intel_encoder->clone_mask = (1 << INTEL_TV_CLONE_BIT);
|
||||
intel_encoder->enc.possible_crtcs = ((1 << 0) | (1 << 1));
|
||||
intel_encoder->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT);
|
||||
intel_encoder->dev_priv = tv_priv;
|
||||
tv_priv->type = DRM_MODE_CONNECTOR_Unknown;
|
||||
|
||||
/* BIOS margin values */
|
||||
|
@ -1812,7 +1812,7 @@ intel_tv_init(struct drm_device *dev)
|
|||
|
||||
tv_priv->tv_format = kstrdup(tv_modes[initial_mode].name, GFP_KERNEL);
|
||||
|
||||
drm_encoder_helper_add(&intel_output->enc, &intel_tv_helper_funcs);
|
||||
drm_encoder_helper_add(&intel_encoder->enc, &intel_tv_helper_funcs);
|
||||
drm_connector_helper_add(connector, &intel_tv_connector_helper_funcs);
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче