Commit b2a8b4b8 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm: fix "persistant" typo
  drm/radeon/kms: add some new ontario pci ids
  drm/radeon/kms: pageflipping cleanup for avivo+
  drm/radeon/kms: Add support for tv-out dongle on G5 9600
  drm: export drm_find_cea_extension to drivers
  drm/radeon/kms: add some sanity checks to obj info record parsingi (v2)
  drm/i915: Reset GMBUS controller after NAK
  drm/i915: Busy-spin wait_for condition in atomic contexts
  drm/i915/lvds: Always return connected in the absence of better information
parents bdfd6b7d 5df23979
...@@ -1297,7 +1297,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid, ...@@ -1297,7 +1297,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
/** /**
* Search EDID for CEA extension block. * Search EDID for CEA extension block.
*/ */
static u8 *drm_find_cea_extension(struct edid *edid) u8 *drm_find_cea_extension(struct edid *edid)
{ {
u8 *edid_ext = NULL; u8 *edid_ext = NULL;
int i; int i;
...@@ -1318,6 +1318,7 @@ static u8 *drm_find_cea_extension(struct edid *edid) ...@@ -1318,6 +1318,7 @@ static u8 *drm_find_cea_extension(struct edid *edid)
return edid_ext; return edid_ext;
} }
EXPORT_SYMBOL(drm_find_cea_extension);
/** /**
* drm_detect_hdmi_monitor - detect whether monitor is hdmi. * drm_detect_hdmi_monitor - detect whether monitor is hdmi.
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
ret__ = -ETIMEDOUT; \ ret__ = -ETIMEDOUT; \
break; \ break; \
} \ } \
if (W && !in_dbg_master()) msleep(W); \ if (W && !(in_atomic() || in_dbg_master())) msleep(W); \
} \ } \
ret__; \ ret__; \
}) })
......
...@@ -259,7 +259,7 @@ gmbus_xfer(struct i2c_adapter *adapter, ...@@ -259,7 +259,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50))
goto timeout; goto timeout;
if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
return 0; goto clear_err;
val = I915_READ(GMBUS3 + reg_offset); val = I915_READ(GMBUS3 + reg_offset);
do { do {
...@@ -287,7 +287,7 @@ gmbus_xfer(struct i2c_adapter *adapter, ...@@ -287,7 +287,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50))
goto timeout; goto timeout;
if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
return 0; goto clear_err;
val = loop = 0; val = loop = 0;
do { do {
...@@ -302,14 +302,31 @@ gmbus_xfer(struct i2c_adapter *adapter, ...@@ -302,14 +302,31 @@ gmbus_xfer(struct i2c_adapter *adapter,
if (i + 1 < num && wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_WAIT_PHASE), 50)) if (i + 1 < num && wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_WAIT_PHASE), 50))
goto timeout; goto timeout;
if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
return 0; goto clear_err;
} }
return num; goto done;
clear_err:
/* Toggle the Software Clear Interrupt bit. This has the effect
* of resetting the GMBUS controller and so clearing the
* BUS_ERROR raised by the slave's NAK.
*/
I915_WRITE(GMBUS1 + reg_offset, GMBUS_SW_CLR_INT);
I915_WRITE(GMBUS1 + reg_offset, 0);
done:
/* Mark the GMBUS interface as disabled. We will re-enable it at the
* start of the next xfer, till then let it sleep.
*/
I915_WRITE(GMBUS0 + reg_offset, 0);
return i;
timeout: timeout:
DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n", DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n",
bus->reg0 & 0xff, bus->adapter.name); bus->reg0 & 0xff, bus->adapter.name);
I915_WRITE(GMBUS0 + reg_offset, 0);
/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */ /* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */
bus->force_bit = intel_gpio_create(dev_priv, bus->reg0 & 0xff); bus->force_bit = intel_gpio_create(dev_priv, bus->reg0 & 0xff);
if (!bus->force_bit) if (!bus->force_bit)
......
...@@ -473,19 +473,13 @@ static enum drm_connector_status ...@@ -473,19 +473,13 @@ static enum drm_connector_status
intel_lvds_detect(struct drm_connector *connector, bool force) intel_lvds_detect(struct drm_connector *connector, bool force)
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
enum drm_connector_status status = connector_status_connected; enum drm_connector_status status;
status = intel_panel_detect(dev); status = intel_panel_detect(dev);
if (status != connector_status_unknown) if (status != connector_status_unknown)
return status; return status;
/* ACPI lid methods were generally unreliable in this generation, so return connector_status_connected;
* don't even bother.
*/
if (IS_GEN2(dev) || IS_GEN3(dev))
return connector_status_connected;
return status;
} }
/** /**
......
...@@ -97,7 +97,7 @@ nouveau_gem_new(struct drm_device *dev, struct nouveau_channel *chan, ...@@ -97,7 +97,7 @@ nouveau_gem_new(struct drm_device *dev, struct nouveau_channel *chan,
return -ENOMEM; return -ENOMEM;
} }
nvbo->bo.persistant_swap_storage = nvbo->gem->filp; nvbo->bo.persistent_swap_storage = nvbo->gem->filp;
nvbo->gem->driver_private = nvbo; nvbo->gem->driver_private = nvbo;
return 0; return 0;
} }
......
...@@ -1009,6 +1009,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, ...@@ -1009,6 +1009,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
uint64_t fb_location; uint64_t fb_location;
uint32_t fb_format, fb_pitch_pixels, tiling_flags; uint32_t fb_format, fb_pitch_pixels, tiling_flags;
u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE); u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE);
u32 tmp;
int r; int r;
/* no fb bound */ /* no fb bound */
...@@ -1137,6 +1138,15 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, ...@@ -1137,6 +1138,15 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset, WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
(crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
/* pageflip setup */
/* make sure flip is at vb rather than hb */
tmp = RREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN;
WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
/* set pageflip to happen anywhere in vblank interval */
WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
if (!atomic && fb && fb != crtc->fb) { if (!atomic && fb && fb != crtc->fb) {
radeon_fb = to_radeon_framebuffer(fb); radeon_fb = to_radeon_framebuffer(fb);
rbo = gem_to_radeon_bo(radeon_fb->obj); rbo = gem_to_radeon_bo(radeon_fb->obj);
...@@ -1167,6 +1177,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, ...@@ -1167,6 +1177,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
uint64_t fb_location; uint64_t fb_location;
uint32_t fb_format, fb_pitch_pixels, tiling_flags; uint32_t fb_format, fb_pitch_pixels, tiling_flags;
u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE; u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE;
u32 tmp;
int r; int r;
/* no fb bound */ /* no fb bound */
...@@ -1294,6 +1305,15 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, ...@@ -1294,6 +1305,15 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset, WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
(crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
/* pageflip setup */
/* make sure flip is at vb rather than hb */
tmp = RREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN;
WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
/* set pageflip to happen anywhere in vblank interval */
WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
if (!atomic && fb && fb != crtc->fb) { if (!atomic && fb && fb != crtc->fb) {
radeon_fb = to_radeon_framebuffer(fb); radeon_fb = to_radeon_framebuffer(fb);
rbo = gem_to_radeon_bo(radeon_fb->obj); rbo = gem_to_radeon_bo(radeon_fb->obj);
......
...@@ -43,17 +43,6 @@ static void evergreen_pcie_gen2_enable(struct radeon_device *rdev); ...@@ -43,17 +43,6 @@ static void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc) void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc)
{ {
struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc];
u32 tmp;
/* make sure flip is at vb rather than hb */
tmp = RREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN;
WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
/* set pageflip to happen anywhere in vblank interval */
WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
/* enable the pflip int */ /* enable the pflip int */
radeon_irq_kms_pflip_irq_get(rdev, crtc); radeon_irq_kms_pflip_irq_get(rdev, crtc);
} }
......
...@@ -675,7 +675,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) ...@@ -675,7 +675,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
ATOM_ENCODER_CAP_RECORD *cap_record; ATOM_ENCODER_CAP_RECORD *cap_record;
u16 caps = 0; u16 caps = 0;
while (record->ucRecordType > 0 && while (record->ucRecordSize > 0 &&
record->ucRecordType > 0 &&
record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) { record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
switch (record->ucRecordType) { switch (record->ucRecordType) {
case ATOM_ENCODER_CAP_RECORD_TYPE: case ATOM_ENCODER_CAP_RECORD_TYPE:
...@@ -720,7 +721,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) ...@@ -720,7 +721,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
break; break;
} }
while (record->ucRecordType > 0 && while (record->ucRecordSize > 0 &&
record->ucRecordType > 0 &&
record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) { record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
switch (record->ucRecordType) { switch (record->ucRecordType) {
case ATOM_I2C_RECORD_TYPE: case ATOM_I2C_RECORD_TYPE:
...@@ -782,10 +784,9 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) ...@@ -782,10 +784,9 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
ATOM_HPD_INT_RECORD *hpd_record; ATOM_HPD_INT_RECORD *hpd_record;
ATOM_I2C_ID_CONFIG_ACCESS *i2c_config; ATOM_I2C_ID_CONFIG_ACCESS *i2c_config;
while (record->ucRecordType > 0 while (record->ucRecordSize > 0 &&
&& record-> record->ucRecordType > 0 &&
ucRecordType <= record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
ATOM_MAX_OBJECT_RECORD_NUMBER) {
switch (record->ucRecordType) { switch (record->ucRecordType) {
case ATOM_I2C_RECORD_TYPE: case ATOM_I2C_RECORD_TYPE:
i2c_record = i2c_record =
......
...@@ -2079,6 +2079,19 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -2079,6 +2079,19 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
DRM_MODE_CONNECTOR_DVII, &ddc_i2c, DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
&hpd); &hpd);
/* TV - TV DAC */
ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev,
radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT,
2),
ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO,
&hpd);
break; break;
default: default:
DRM_INFO("Connector table: %d (invalid)\n", DRM_INFO("Connector table: %d (invalid)\n",
......
...@@ -48,17 +48,6 @@ int rs600_mc_wait_for_idle(struct radeon_device *rdev); ...@@ -48,17 +48,6 @@ int rs600_mc_wait_for_idle(struct radeon_device *rdev);
void rs600_pre_page_flip(struct radeon_device *rdev, int crtc) void rs600_pre_page_flip(struct radeon_device *rdev, int crtc)
{ {
struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc];
u32 tmp;
/* make sure flip is at vb rather than hb */
tmp = RREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN;
WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
/* set pageflip to happen anywhere in vblank interval */
WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
/* enable the pflip int */ /* enable the pflip int */
radeon_irq_kms_pflip_irq_get(rdev, crtc); radeon_irq_kms_pflip_irq_get(rdev, crtc);
} }
......
...@@ -1168,7 +1168,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1168,7 +1168,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start, unsigned long buffer_start,
bool interruptible, bool interruptible,
struct file *persistant_swap_storage, struct file *persistent_swap_storage,
size_t acc_size, size_t acc_size,
void (*destroy) (struct ttm_buffer_object *)) void (*destroy) (struct ttm_buffer_object *))
{ {
...@@ -1211,7 +1211,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -1211,7 +1211,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
bo->priv_flags = 0; bo->priv_flags = 0;
bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED); bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED);
bo->seq_valid = false; bo->seq_valid = false;
bo->persistant_swap_storage = persistant_swap_storage; bo->persistent_swap_storage = persistent_swap_storage;
bo->acc_size = acc_size; bo->acc_size = acc_size;
atomic_inc(&bo->glob->bo_count); atomic_inc(&bo->glob->bo_count);
...@@ -1260,7 +1260,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -1260,7 +1260,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start, unsigned long buffer_start,
bool interruptible, bool interruptible,
struct file *persistant_swap_storage, struct file *persistent_swap_storage,
struct ttm_buffer_object **p_bo) struct ttm_buffer_object **p_bo)
{ {
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
...@@ -1282,7 +1282,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -1282,7 +1282,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment,
buffer_start, interruptible, buffer_start, interruptible,
persistant_swap_storage, acc_size, NULL); persistent_swap_storage, acc_size, NULL);
if (likely(ret == 0)) if (likely(ret == 0))
*p_bo = bo; *p_bo = bo;
...@@ -1863,7 +1863,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) ...@@ -1863,7 +1863,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
if (bo->bdev->driver->swap_notify) if (bo->bdev->driver->swap_notify)
bo->bdev->driver->swap_notify(bo); bo->bdev->driver->swap_notify(bo);
ret = ttm_tt_swapout(bo->ttm, bo->persistant_swap_storage); ret = ttm_tt_swapout(bo->ttm, bo->persistent_swap_storage);
out: out:
/** /**
......
...@@ -332,7 +332,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm) ...@@ -332,7 +332,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
ttm_tt_free_page_directory(ttm); ttm_tt_free_page_directory(ttm);
} }
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP) && if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) &&
ttm->swap_storage) ttm->swap_storage)
fput(ttm->swap_storage); fput(ttm->swap_storage);
...@@ -503,7 +503,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm) ...@@ -503,7 +503,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
page_cache_release(from_page); page_cache_release(from_page);
} }
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP)) if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP))
fput(swap_storage); fput(swap_storage);
ttm->swap_storage = NULL; ttm->swap_storage = NULL;
ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED; ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
...@@ -514,7 +514,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm) ...@@ -514,7 +514,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
return ret; return ret;
} }
int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
{ {
struct address_space *swap_space; struct address_space *swap_space;
struct file *swap_storage; struct file *swap_storage;
...@@ -540,7 +540,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) ...@@ -540,7 +540,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
return 0; return 0;
} }
if (!persistant_swap_storage) { if (!persistent_swap_storage) {
swap_storage = shmem_file_setup("ttm swap", swap_storage = shmem_file_setup("ttm swap",
ttm->num_pages << PAGE_SHIFT, ttm->num_pages << PAGE_SHIFT,
0); 0);
...@@ -549,7 +549,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) ...@@ -549,7 +549,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
return PTR_ERR(swap_storage); return PTR_ERR(swap_storage);
} }
} else } else
swap_storage = persistant_swap_storage; swap_storage = persistent_swap_storage;
swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
...@@ -577,12 +577,12 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) ...@@ -577,12 +577,12 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
ttm_tt_free_alloced_pages(ttm); ttm_tt_free_alloced_pages(ttm);
ttm->swap_storage = swap_storage; ttm->swap_storage = swap_storage;
ttm->page_flags |= TTM_PAGE_FLAG_SWAPPED; ttm->page_flags |= TTM_PAGE_FLAG_SWAPPED;
if (persistant_swap_storage) if (persistent_swap_storage)
ttm->page_flags |= TTM_PAGE_FLAG_PERSISTANT_SWAP; ttm->page_flags |= TTM_PAGE_FLAG_PERSISTENT_SWAP;
return 0; return 0;
out_err: out_err:
if (!persistant_swap_storage) if (!persistent_swap_storage)
fput(swap_storage); fput(swap_storage);
return ret; return ret;
......
...@@ -778,6 +778,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev, ...@@ -778,6 +778,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv); void *data, struct drm_file *file_priv);
extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv); void *data, struct drm_file *file_priv);
extern u8 *drm_find_cea_extension(struct edid *edid);
extern bool drm_detect_hdmi_monitor(struct edid *edid); extern bool drm_detect_hdmi_monitor(struct edid *edid);
extern bool drm_detect_monitor_audio(struct edid *edid); extern bool drm_detect_monitor_audio(struct edid *edid);
extern int drm_mode_page_flip_ioctl(struct drm_device *dev, extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
......
...@@ -472,6 +472,8 @@ ...@@ -472,6 +472,8 @@
{0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0x1002, 0x9806, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0x1002, 0x9807, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0, 0, 0} {0, 0, 0}
#define r128_PCI_IDS \ #define r128_PCI_IDS \
......
...@@ -158,9 +158,9 @@ struct ttm_tt; ...@@ -158,9 +158,9 @@ struct ttm_tt;
* the object is destroyed. * the object is destroyed.
* @event_queue: Queue for processes waiting on buffer object status change. * @event_queue: Queue for processes waiting on buffer object status change.
* @mem: structure describing current placement. * @mem: structure describing current placement.
* @persistant_swap_storage: Usually the swap storage is deleted for buffers * @persistent_swap_storage: Usually the swap storage is deleted for buffers
* pinned in physical memory. If this behaviour is not desired, this member * pinned in physical memory. If this behaviour is not desired, this member
* holds a pointer to a persistant shmem object. * holds a pointer to a persistent shmem object.
* @ttm: TTM structure holding system pages. * @ttm: TTM structure holding system pages.
* @evicted: Whether the object was evicted without user-space knowing. * @evicted: Whether the object was evicted without user-space knowing.
* @cpu_writes: For synchronization. Number of cpu writers. * @cpu_writes: For synchronization. Number of cpu writers.
...@@ -221,7 +221,7 @@ struct ttm_buffer_object { ...@@ -221,7 +221,7 @@ struct ttm_buffer_object {
*/ */
struct ttm_mem_reg mem; struct ttm_mem_reg mem;
struct file *persistant_swap_storage; struct file *persistent_swap_storage;
struct ttm_tt *ttm; struct ttm_tt *ttm;
bool evicted; bool evicted;
...@@ -459,9 +459,9 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo); ...@@ -459,9 +459,9 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo);
* user buffer object. * user buffer object.
* @interruptible: If needing to sleep to wait for GPU resources, * @interruptible: If needing to sleep to wait for GPU resources,
* sleep interruptible. * sleep interruptible.
* @persistant_swap_storage: Usually the swap storage is deleted for buffers * @persistent_swap_storage: Usually the swap storage is deleted for buffers
* pinned in physical memory. If this behaviour is not desired, this member * pinned in physical memory. If this behaviour is not desired, this member
* holds a pointer to a persistant shmem object. Typically, this would * holds a pointer to a persistent shmem object. Typically, this would
* point to the shmem object backing a GEM object if TTM is used to back a * point to the shmem object backing a GEM object if TTM is used to back a
* GEM user interface. * GEM user interface.
* @acc_size: Accounted size for this object. * @acc_size: Accounted size for this object.
...@@ -490,7 +490,7 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -490,7 +490,7 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start, unsigned long buffer_start,
bool interrubtible, bool interrubtible,
struct file *persistant_swap_storage, struct file *persistent_swap_storage,
size_t acc_size, size_t acc_size,
void (*destroy) (struct ttm_buffer_object *)); void (*destroy) (struct ttm_buffer_object *));
/** /**
...@@ -506,9 +506,9 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev, ...@@ -506,9 +506,9 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev,
* user buffer object. * user buffer object.
* @interruptible: If needing to sleep while waiting for GPU resources, * @interruptible: If needing to sleep while waiting for GPU resources,
* sleep interruptible. * sleep interruptible.
* @persistant_swap_storage: Usually the swap storage is deleted for buffers * @persistent_swap_storage: Usually the swap storage is deleted for buffers
* pinned in physical memory. If this behaviour is not desired, this member * pinned in physical memory. If this behaviour is not desired, this member
* holds a pointer to a persistant shmem object. Typically, this would * holds a pointer to a persistent shmem object. Typically, this would
* point to the shmem object backing a GEM object if TTM is used to back a * point to the shmem object backing a GEM object if TTM is used to back a
* GEM user interface. * GEM user interface.
* @p_bo: On successful completion *p_bo points to the created object. * @p_bo: On successful completion *p_bo points to the created object.
...@@ -528,7 +528,7 @@ extern int ttm_bo_create(struct ttm_bo_device *bdev, ...@@ -528,7 +528,7 @@ extern int ttm_bo_create(struct ttm_bo_device *bdev,
uint32_t page_alignment, uint32_t page_alignment,
unsigned long buffer_start, unsigned long buffer_start,
bool interruptible, bool interruptible,
struct file *persistant_swap_storage, struct file *persistent_swap_storage,
struct ttm_buffer_object **p_bo); struct ttm_buffer_object **p_bo);
/** /**
......
...@@ -122,7 +122,7 @@ struct ttm_backend { ...@@ -122,7 +122,7 @@ struct ttm_backend {
#define TTM_PAGE_FLAG_USER_DIRTY (1 << 2) #define TTM_PAGE_FLAG_USER_DIRTY (1 << 2)
#define TTM_PAGE_FLAG_WRITE (1 << 3) #define TTM_PAGE_FLAG_WRITE (1 << 3)
#define TTM_PAGE_FLAG_SWAPPED (1 << 4) #define TTM_PAGE_FLAG_SWAPPED (1 << 4)
#define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) #define TTM_PAGE_FLAG_PERSISTENT_SWAP (1 << 5)
#define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6)
#define TTM_PAGE_FLAG_DMA32 (1 << 7) #define TTM_PAGE_FLAG_DMA32 (1 << 7)
...@@ -714,7 +714,7 @@ extern void ttm_tt_cache_flush(struct page *pages[], unsigned long num_pages); ...@@ -714,7 +714,7 @@ extern void ttm_tt_cache_flush(struct page *pages[], unsigned long num_pages);
*/ */
extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement); extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement);
extern int ttm_tt_swapout(struct ttm_tt *ttm, extern int ttm_tt_swapout(struct ttm_tt *ttm,
struct file *persistant_swap_storage); struct file *persistent_swap_storage);
/* /*
* ttm_bo.c * ttm_bo.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment