Commit 0a4583eb authored by Dave Airlie's avatar Dave Airlie

Merge branch 'drm-radeon-linus' of ../drm-next

* 'drm-radeon-linus' of ../drm-next:
  drm/radeon/kms: retry auxch on 0x20 timeout value.
  drm/radeon: Skip dma copy test in benchmark if card doesn't have dma engine.
  drm/radeon/kms: fix screen clearing before fbcon.
  drm/radeon/kms: add quirk for VGA without DDC on rv730 XFX card.
  drm/radeon/kms: don't crash if no DDC bus on VGA/DVI connector.
  drm/radeon/kms: change Kconfig text to reflect the new option.
  drm/radeon/kms: suspend and resume audio stuff
parents e8a47c10 648ac05c
config DRM_RADEON_KMS config DRM_RADEON_KMS
bool "Enable modesetting on radeon by default" bool "Enable modesetting on radeon by default - NEW DRIVER"
depends on DRM_RADEON depends on DRM_RADEON
help help
Choose this option if you want kernel modesetting enabled by default, Choose this option if you want kernel modesetting enabled by default.
and you have a new enough userspace to support this. Running old
userspaces with this enabled will cause pain. This is a completely new driver. It's only part of the existing drm
for compatibility reasons. It requires an entirely different graphics
stack above it and works very differently from the old drm stack.
i.e. don't enable this unless you know what you are doing it may
cause issues or bugs compared to the previous userspace driver stack.
When kernel modesetting is enabled the IOCTL of radeon/drm When kernel modesetting is enabled the IOCTL of radeon/drm
driver are considered as invalid and an error message is printed driver are considered as invalid and an error message is printed
......
...@@ -332,11 +332,13 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes, ...@@ -332,11 +332,13 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes,
PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION args; PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION args;
int index = GetIndexIntoMasterTable(COMMAND, ProcessAuxChannelTransaction); int index = GetIndexIntoMasterTable(COMMAND, ProcessAuxChannelTransaction);
unsigned char *base; unsigned char *base;
int retry_count = 0;
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
base = (unsigned char *)rdev->mode_info.atom_context->scratch; base = (unsigned char *)rdev->mode_info.atom_context->scratch;
retry:
memcpy(base, req_bytes, num_bytes); memcpy(base, req_bytes, num_bytes);
args.lpAuxRequest = 0; args.lpAuxRequest = 0;
...@@ -347,10 +349,12 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes, ...@@ -347,10 +349,12 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes,
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
if (args.ucReplyStatus) { if (args.ucReplyStatus && !args.ucDataOutLen) {
DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x\n", if (args.ucReplyStatus == 0x20 && retry_count < 10)
goto retry;
DRM_DEBUG("failed to get auxch %02x%02x %02x %02x 0x%02x %02x after %d retries\n",
req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3], req_bytes[1], req_bytes[0], req_bytes[2], req_bytes[3],
chan->rec.i2c_id, args.ucReplyStatus); chan->rec.i2c_id, args.ucReplyStatus, retry_count);
return false; return false;
} }
......
...@@ -1950,6 +1950,13 @@ int r600_resume(struct radeon_device *rdev) ...@@ -1950,6 +1950,13 @@ int r600_resume(struct radeon_device *rdev)
DRM_ERROR("radeon: failled testing IB (%d).\n", r); DRM_ERROR("radeon: failled testing IB (%d).\n", r);
return r; return r;
} }
r = r600_audio_init(rdev);
if (r) {
DRM_ERROR("radeon: audio resume failed\n");
return r;
}
return r; return r;
} }
...@@ -1957,6 +1964,7 @@ int r600_suspend(struct radeon_device *rdev) ...@@ -1957,6 +1964,7 @@ int r600_suspend(struct radeon_device *rdev)
{ {
int r; int r;
r600_audio_fini(rdev);
/* FIXME: we should wait for ring to be empty */ /* FIXME: we should wait for ring to be empty */
r600_cp_stop(rdev); r600_cp_stop(rdev);
rdev->cp.ready = false; rdev->cp.ready = false;
......
...@@ -261,7 +261,6 @@ void r600_audio_fini(struct radeon_device *rdev) ...@@ -261,7 +261,6 @@ void r600_audio_fini(struct radeon_device *rdev)
if (!r600_audio_chipset_supported(rdev)) if (!r600_audio_chipset_supported(rdev))
return; return;
WREG32_P(R600_AUDIO_ENABLE, 0x0, ~0x81000000);
del_timer(&rdev->audio_timer); del_timer(&rdev->audio_timer);
WREG32_P(R600_AUDIO_ENABLE, 0x0, ~0x81000000);
} }
...@@ -287,6 +287,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, ...@@ -287,6 +287,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
*connector_type = DRM_MODE_CONNECTOR_DVID; *connector_type = DRM_MODE_CONNECTOR_DVID;
} }
/* XFX Pine Group device rv730 reports no VGA DDC lines
* even though they are wired up to record 0x93
*/
if ((dev->pdev->device == 0x9498) &&
(dev->pdev->subsystem_vendor == 0x1682) &&
(dev->pdev->subsystem_device == 0x2452)) {
struct radeon_device *rdev = dev->dev_private;
*i2c_bus = radeon_lookup_i2c_gpio(rdev, 0x93);
}
return true; return true;
} }
......
...@@ -65,31 +65,42 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize, ...@@ -65,31 +65,42 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize,
if (r) { if (r) {
goto out_cleanup; goto out_cleanup;
} }
start_jiffies = jiffies;
for (i = 0; i < n; i++) { /* r100 doesn't have dma engine so skip the test */
r = radeon_fence_create(rdev, &fence); if (rdev->asic->copy_dma) {
if (r) {
goto out_cleanup; start_jiffies = jiffies;
for (i = 0; i < n; i++) {
r = radeon_fence_create(rdev, &fence);
if (r) {
goto out_cleanup;
}
r = radeon_copy_dma(rdev, saddr, daddr,
size / RADEON_GPU_PAGE_SIZE, fence);
if (r) {
goto out_cleanup;
}
r = radeon_fence_wait(fence, false);
if (r) {
goto out_cleanup;
}
radeon_fence_unref(&fence);
} }
r = radeon_copy_dma(rdev, saddr, daddr, size / RADEON_GPU_PAGE_SIZE, fence); end_jiffies = jiffies;
if (r) { time = end_jiffies - start_jiffies;
goto out_cleanup; time = jiffies_to_msecs(time);
if (time > 0) {
i = ((n * size) >> 10) / time;
printk(KERN_INFO "radeon: dma %u bo moves of %ukb from"
" %d to %d in %lums (%ukb/ms %ukb/s %uM/s)\n",
n, size >> 10,
sdomain, ddomain, time,
i, i * 1000, (i * 1000) / 1024);
} }
r = radeon_fence_wait(fence, false);
if (r) {
goto out_cleanup;
}
radeon_fence_unref(&fence);
}
end_jiffies = jiffies;
time = end_jiffies - start_jiffies;
time = jiffies_to_msecs(time);
if (time > 0) {
i = ((n * size) >> 10) / time;
printk(KERN_INFO "radeon: dma %u bo moves of %ukb from %d to %d"
" in %lums (%ukb/ms %ukb/s %uM/s)\n", n, size >> 10,
sdomain, ddomain, time, i, i * 1000, (i * 1000) / 1024);
} }
start_jiffies = jiffies; start_jiffies = jiffies;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
r = radeon_fence_create(rdev, &fence); r = radeon_fence_create(rdev, &fence);
......
...@@ -580,16 +580,18 @@ static enum drm_connector_status radeon_vga_detect(struct drm_connector *connect ...@@ -580,16 +580,18 @@ static enum drm_connector_status radeon_vga_detect(struct drm_connector *connect
struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct radeon_connector *radeon_connector = to_radeon_connector(connector);
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_encoder_helper_funcs *encoder_funcs; struct drm_encoder_helper_funcs *encoder_funcs;
bool dret; bool dret = false;
enum drm_connector_status ret = connector_status_disconnected; enum drm_connector_status ret = connector_status_disconnected;
encoder = radeon_best_single_encoder(connector); encoder = radeon_best_single_encoder(connector);
if (!encoder) if (!encoder)
ret = connector_status_disconnected; ret = connector_status_disconnected;
radeon_i2c_do_lock(radeon_connector->ddc_bus, 1); if (radeon_connector->ddc_bus) {
dret = radeon_ddc_probe(radeon_connector); radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
radeon_i2c_do_lock(radeon_connector->ddc_bus, 0); dret = radeon_ddc_probe(radeon_connector);
radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
}
if (dret) { if (dret) {
if (radeon_connector->edid) { if (radeon_connector->edid) {
kfree(radeon_connector->edid); kfree(radeon_connector->edid);
...@@ -740,11 +742,13 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect ...@@ -740,11 +742,13 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect
struct drm_mode_object *obj; struct drm_mode_object *obj;
int i; int i;
enum drm_connector_status ret = connector_status_disconnected; enum drm_connector_status ret = connector_status_disconnected;
bool dret; bool dret = false;
radeon_i2c_do_lock(radeon_connector->ddc_bus, 1); if (radeon_connector->ddc_bus) {
dret = radeon_ddc_probe(radeon_connector); radeon_i2c_do_lock(radeon_connector->ddc_bus, 1);
radeon_i2c_do_lock(radeon_connector->ddc_bus, 0); dret = radeon_ddc_probe(radeon_connector);
radeon_i2c_do_lock(radeon_connector->ddc_bus, 0);
}
if (dret) { if (dret) {
if (radeon_connector->edid) { if (radeon_connector->edid) {
kfree(radeon_connector->edid); kfree(radeon_connector->edid);
......
...@@ -278,7 +278,7 @@ static void radeon_print_display_setup(struct drm_device *dev) ...@@ -278,7 +278,7 @@ static void radeon_print_display_setup(struct drm_device *dev)
DRM_INFO(" %s\n", connector_names[connector->connector_type]); DRM_INFO(" %s\n", connector_names[connector->connector_type]);
if (radeon_connector->hpd.hpd != RADEON_HPD_NONE) if (radeon_connector->hpd.hpd != RADEON_HPD_NONE)
DRM_INFO(" %s\n", hpd_names[radeon_connector->hpd.hpd]); DRM_INFO(" %s\n", hpd_names[radeon_connector->hpd.hpd]);
if (radeon_connector->ddc_bus) if (radeon_connector->ddc_bus) {
DRM_INFO(" DDC: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", DRM_INFO(" DDC: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
radeon_connector->ddc_bus->rec.mask_clk_reg, radeon_connector->ddc_bus->rec.mask_clk_reg,
radeon_connector->ddc_bus->rec.mask_data_reg, radeon_connector->ddc_bus->rec.mask_data_reg,
...@@ -288,6 +288,15 @@ static void radeon_print_display_setup(struct drm_device *dev) ...@@ -288,6 +288,15 @@ static void radeon_print_display_setup(struct drm_device *dev)
radeon_connector->ddc_bus->rec.en_data_reg, radeon_connector->ddc_bus->rec.en_data_reg,
radeon_connector->ddc_bus->rec.y_clk_reg, radeon_connector->ddc_bus->rec.y_clk_reg,
radeon_connector->ddc_bus->rec.y_data_reg); radeon_connector->ddc_bus->rec.y_data_reg);
} else {
if (connector->connector_type == DRM_MODE_CONNECTOR_VGA ||
connector->connector_type == DRM_MODE_CONNECTOR_DVII ||
connector->connector_type == DRM_MODE_CONNECTOR_DVID ||
connector->connector_type == DRM_MODE_CONNECTOR_DVIA ||
connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)
DRM_INFO(" DDC: no ddc bus - possible BIOS bug - please report to xorg-driver-ati@lists.x.org\n");
}
DRM_INFO(" Encoders:\n"); DRM_INFO(" Encoders:\n");
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
radeon_encoder = to_radeon_encoder(encoder); radeon_encoder = to_radeon_encoder(encoder);
......
...@@ -248,7 +248,7 @@ int radeonfb_create(struct drm_device *dev, ...@@ -248,7 +248,7 @@ int radeonfb_create(struct drm_device *dev,
if (ret) if (ret)
goto out_unref; goto out_unref;
memset_io(fbptr, 0xff, aligned_size); memset_io(fbptr, 0x0, aligned_size);
strcpy(info->fix.id, "radeondrmfb"); strcpy(info->fix.id, "radeondrmfb");
......
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