[Bug 31572] [bisected piketon] urbanterror performance regression
https://bugs.freedesktop.org/show_bug.cgi?id=31572 fangxun changed: What|Removed |Added Summary|[piketon] urbanterror |[bisected piketon] |performance regression |urbanterror performance ||regression Product|Mesa|DRI Component|Drivers/DRI/i965|libdrm AssignedTo|e...@anholt.net |dri-de...@lists.freedesktop ||.org --- Comment #1 from fangxun 2010-11-16 01:33:24 PST --- Sorry, bisect shows it's Libdrm caused this issue. 877b2ce15b80975b4dac42657bdfb0a3da833e1c is first bad commit. commit 877b2ce15b80975b4dac42657bdfb0a3da833e1c 49447a9b957047db2549b8a929e763bbd87808ba Author: Eric Anholt Date: Tue Nov 9 13:51:45 2010 -0800 intel: Fix drm_intel_gem_bo_wait_rendering to wait for read-only usage too. Both the consumers of this API (sync objects and client throttling) were expecting this behavior. The kernel used to actually behave the desired (but incorrect) way for us anyway, but that got fixed a while back. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31572] [bisected piketon] urbanterror performance regression
https://bugs.freedesktop.org/show_bug.cgi?id=31572 fangxun changed: What|Removed |Added AssignedTo|dri-de...@lists.freedesktop |e...@anholt.net |.org| -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31255] Unigine Sanctuary v2.2: some surfaces have wrong colours
https://bugs.freedesktop.org/show_bug.cgi?id=31255 Pavel Ondračka changed: What|Removed |Added Summary|Unigine Sanctuary v 2.2:|Unigine Sanctuary v2.2: |some surfaces have wrong|some surfaces have wrong |colours |colours Component|Mesa core |Drivers/Gallium/r300 AssignedTo|mesa-...@lists.freedesktop. |dri-de...@lists.freedesktop |org |.org --- Comment #1 from Pavel Ondračka 2010-11-16 03:04:33 PST --- This works fine with Tom Stellards sched-perf-rebase branch, so it seems like r300g bug after all. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/ttm: Add a bo list reserve fastpath
Makes it possible to reserve a list of buffer objects with a single spin lock / unlock if there is no contention. Should improve cpu usage on SMP kernels. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c | 32 +- drivers/gpu/drm/ttm/ttm_execbuf_util.c | 117 +--- include/drm/ttm/ttm_bo_api.h | 38 ++ include/drm/ttm/ttm_bo_driver.h| 14 include/drm/ttm/ttm_execbuf_util.h |6 ++- 5 files changed, 180 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 148a322..a586378 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -169,7 +169,7 @@ int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, bool interruptible) } EXPORT_SYMBOL(ttm_bo_wait_unreserved); -static void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) +void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) { struct ttm_bo_device *bdev = bo->bdev; struct ttm_mem_type_manager *man; @@ -191,11 +191,7 @@ static void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) } } -/** - * Call with the lru_lock held. - */ - -static int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) +int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) { int put_count = 0; @@ -267,6 +263,15 @@ static void ttm_bo_ref_bug(struct kref *list_kref) BUG(); } +void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, +bool never_free) +{ + while (count--) + kref_put(&bo->list_kref, +(never_free || (count >= 0)) ? ttm_bo_ref_bug : +ttm_bo_release_list); +} + int ttm_bo_reserve(struct ttm_buffer_object *bo, bool interruptible, bool no_wait, bool use_sequence, uint32_t sequence) @@ -282,8 +287,7 @@ int ttm_bo_reserve(struct ttm_buffer_object *bo, put_count = ttm_bo_del_from_lru(bo); spin_unlock(&glob->lru_lock); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); return ret; } @@ -496,8 +500,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) spin_unlock(&glob->lru_lock); ttm_bo_cleanup_memtype_use(bo); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); return; } else { @@ -580,8 +583,7 @@ retry: spin_unlock(&glob->lru_lock); ttm_bo_cleanup_memtype_use(bo); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); return 0; } @@ -802,8 +804,7 @@ retry: BUG_ON(ret != 0); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); ret = ttm_bo_evict(bo, interruptible, no_wait_reserve, no_wait_gpu); ttm_bo_unreserve(bo); @@ -1783,8 +1784,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) put_count = ttm_bo_del_from_lru(bo); spin_unlock(&glob->lru_lock); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); /** * Wait for GPU, then move to system cached. diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index c285c29..efb42a8 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c @@ -32,6 +32,70 @@ #include #include +static void ttm_eu_backoff_reservation_locked(struct list_head *list) +{ + struct ttm_validate_buffer *entry; + + list_for_each_entry(entry, list, head) { + struct ttm_buffer_object *bo = entry->bo; + if (!entry->reserved) + continue; + + if (entry->removed) { + ttm_bo_add_to_lru(bo); + entry->removed = false; + + } + entry->reserved = false; + atomic_set(&bo->reserved, 0); + wake_up_all(&bo->event_queue); + } +} + +static void ttm_eu_del_from_lru_locked(struct list_head *list) +{ + struct ttm_validate_buffer *entry; + + list_for_each_entry(entry, list, head) { + struct ttm_buffer_object *bo = entry->bo; + if (!entry->reserved) + continue; + + if (!entry->removed) { + entry->put_count = ttm_bo_del_from_lru(bo); + entry->removed = true; + } + } +} + +static void ttm_eu_list_ref_sub(struct list_head *list) +{ + struct ttm_validate_buffer *en
[PATCH 2/2] drm/ttm: Use kref_sub instead of repeatedly calling kref_put
Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index a586378..9ef893d 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -266,10 +266,8 @@ static void ttm_bo_ref_bug(struct kref *list_kref) void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, bool never_free) { - while (count--) - kref_put(&bo->list_kref, -(never_free || (count >= 0)) ? ttm_bo_ref_bug : -ttm_bo_release_list); + kref_sub(&bo->list_kref, count, +(never_free) ? ttm_bo_ref_bug : ttm_bo_release_list); } int ttm_bo_reserve(struct ttm_buffer_object *bo, -- 1.6.2.5 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/3] embed drm_gem_object into radeon_bo
[ CCing Arnd Bergmann ] Hi, I have tested both patchsets from Daniel (see [1] and [2]) again on a Radeon RV250 in a none-BKL-config and it looks like agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch is the culprit in combination with the below listed drm patches. I have switched to a "normal" DDX (w/o pageflip-support). The OpenArena benchmarks is now between 17.5 - 18.6 [fps] @1024x768 resolution. ( w/o below patchset: 840 frames 50.6 seconds 16.6 fps 12.0/60.2/267.0/21.3 ms ) Kind Regards, - Sedat - [1] http://lists.freedesktop.org/archives/dri-devel/2010-November/005420.html [2] http://lists.freedesktop.org/archives/dri-devel/2010-November/005441.html $ cd $HOME/src/linux-2.6/linux-2.6.37-rc2/debian/build/source_i386_none/ $ cat .pc/applied-patches danvet-drm-for-sedat-dilek/0001-drm-nouveau-don-t-munge-in-drm_mm-internals.patch danvet-drm-for-sedat-dilek/0002-drm_mm-add-support-for-range-restricted-fair-lru-sca.patch danvet-drm-for-sedat-dilek/0003-drm-mm-track-free-areas-implicitly.patch danvet-drm-for-sedat-dilek/0004-drm-mm-extract-node-insert-helper-functions.patch danvet-drm-for-sedat-dilek/0005-drm-mm-add-api-for-embedding-struct-drm_mm_node.patch danvet-drm-for-sedat-dilek/0006-drm-mm-add-helper-to-unwind-scan-state.patch danvet-embed-drm_gem_object-into-radeon_bo/1-3-drm-radeon-embed-struct-drm_gem_object.patch danvet-embed-drm_gem_object-into-radeon_bo/2-3-drm-radeon-introduce-gem_to_radeon_bo-helper.patch danvet-embed-drm_gem_object-into-radeon_bo/3-3-drm-radeon-kill-radeon_bo--gobj-pointer.patch drm-vblank-timestamping/0001-drm-vblank-Add-support-for-precise-vblank-timestampi.patch drm-vblank-timestamping/0002-drm-radeon-Add-support-for-precise-vblank-timestampi.patch for-drm-radeon-testing/drm-radeon-kms-enable-writeback-on-radeon-AGP-boards.patch $ cd $HOME/src/mesa/ $ ./scripts/run_openarena-benchmark.sh 840 frames 46.5 seconds 18.1 fps 10.0/55.3/147.0/18.9 ms $ grep OK LATEST_linux-2.6/logs/setup_linux-2.6_git0.sd.1.log (+) OK bkl-config/0002-drm-i810-remove-the-BKL.patch (+) OK bkl-config/0003-staging-stradis-mark-as-depends-on-BKL.patch (+) OK bkl-config/0004-BKL-remove-extraneous-include-smp_lock.h.patch (+) OK bkl-config/0005-BKL-remove-references-to-lock_kernel-from-comments.patch (+) OK bkl-config/0006-BKL-disable-by-default.patch (+) OK bkl-config/0007-BKL-mark-lock_kernel-as-deprecated.patch (+) OK bkl-config/0008-BKL-move-CONFIG_BKL-to-staging.patch (+) OK debian/version.patch (+) OK debian/kernelvariables-2.6.37.patch (+) OK debian/doc-build-parallel.patch (+) OK bugfix/ia64/hardcode-arch-script-output.patch (+) OK bugfix/mips/disable-advansys.patch (+) OK bugfix/arm/disable-scsi_acard.patch (+) OK debian/mips-disable-werror.patch (+) OK bugfix/powerpc/lpar-console.patch (+) OK features/all/i915-autoload-without-CONFIG_DRM_I915_KMS.patch (+) OK debian/arch-sh4-fix-uimage-build.patch (+) OK bugfix/mips/mips-ide-flush-dcache.patch (+) OK bugfix/all/qla4xxx-Fix-build-on-some-architectures-lacking-64-bit-I-O.patch (+) OK bugfix/x86/Skip-looking-for-ioapic-overrides-when-ioapics-are-not-present.patch ( NOTE: bkl-config/0001-preempt-fix-kernel-build-with-CONFIG_BKL.patch is already in Linux 2.6.37-rc2 ) ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/4] drm/radeon/kms: turn the backlight off explicitly for dpms
Seems some newer systems require this explicitly. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_encoders.c | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index f678257..d55cb58 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -1086,6 +1086,8 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (ASIC_IS_DCE4(rdev)) atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON); } + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) + atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0); break; case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_SUSPEND: @@ -1095,20 +1097,31 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (ASIC_IS_DCE4(rdev)) atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF); } + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) + atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_LCD_BLOFF, 0, 0); break; } } else { switch (mode) { case DRM_MODE_DPMS_ON: args.ucAction = ATOM_ENABLE; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + args.ucAction = ATOM_LCD_BLON; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + } break; case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_SUSPEND: case DRM_MODE_DPMS_OFF: args.ucAction = ATOM_DISABLE; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + args.ucAction = ATOM_LCD_BLOFF; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + } break; } - atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } radeon_atombios_encoder_dpms_scratch_regs(encoder, (mode == DRM_MODE_DPMS_ON) ? true : false); -- 1.7.1.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/4] drm/radeon/kms: properly power up/down the eDP panel as needed
The eDP panel must be powered up for aux transactions, so power it up for detect and mode probe functions, otherwise power it up or down based on dpms. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_connectors.c | 13 + drivers/gpu/drm/radeon/radeon_encoders.c | 41 drivers/gpu/drm/radeon/radeon_mode.h |2 + 3 files changed, 56 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe6c747..76008a5 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1008,9 +1008,16 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector) static int radeon_dp_get_modes(struct drm_connector *connector) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; int ret; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, +ATOM_TRANSMITTER_ACTION_POWER_ON); ret = radeon_ddc_get_modes(radeon_connector); + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, +ATOM_TRANSMITTER_ACTION_POWER_OFF); return ret; } @@ -1029,8 +1036,14 @@ radeon_dp_detect(struct drm_connector *connector, bool force) if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { /* eDP is always DP */ radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); if (radeon_dp_getdpcd(radeon_connector)) ret = connector_status_connected; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); } else { radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index d55cb58..701103c 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -978,6 +978,29 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +void +atombios_set_edp_panel_power(struct radeon_connector *radeon_connector, int action) +{ + struct drm_device *dev = radeon_connector->base.dev; + struct radeon_device *rdev = dev->dev_private; + union dig_transmitter_control args; + int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); + uint8_t frev, crev; + + if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || + (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) + return; + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + memset(&args, 0, sizeof(args)); + + args.v1.ucAction = action; + + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1082,6 +1105,14 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = + radeon_connector->con_priv; + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); + radeon_dig_connector->edp_on = true; + } dp_link_train(encoder, connector); if (ASIC_IS_DCE4(rdev)) atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON); @@ -1
[PATCH 3/4] drm/radeon/kms/atom: cleanup and unify DVO handling
Handle all the various asic family specific things for DVO. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon.h |4 + drivers/gpu/drm/radeon/radeon_encoders.c| 90 --- drivers/gpu/drm/radeon/radeon_legacy_encoders.c |2 +- drivers/gpu/drm/radeon/radeon_mode.h|2 +- 4 files changed, 52 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 73f600d..3a70957 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -1262,6 +1262,10 @@ void r100_pll_errata_after_index(struct radeon_device *rdev); (rdev->family == CHIP_RS400) || \ (rdev->family == CHIP_RS480)) #define ASIC_IS_AVIVO(rdev) ((rdev->family >= CHIP_RS600)) +#define ASIC_IS_DCE2(rdev) ((rdev->family == CHIP_RS600) || \ + (rdev->family == CHIP_RS690) ||\ + (rdev->family == CHIP_RS740) ||\ + (rdev->family >= CHIP_R600)) #define ASIC_IS_DCE3(rdev) ((rdev->family >= CHIP_RV620)) #define ASIC_IS_DCE32(rdev) ((rdev->family >= CHIP_RV730)) #define ASIC_IS_DCE4(rdev) ((rdev->family >= CHIP_CEDAR)) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 701103c..8374131 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -176,6 +176,7 @@ static inline bool radeon_encoder_is_digital(struct drm_encoder *encoder) return false; } } + void radeon_link_encoder_connector(struct drm_device *dev) { @@ -426,52 +427,49 @@ atombios_tv_setup(struct drm_encoder *encoder, int action) } -void -atombios_external_tmds_setup(struct drm_encoder *encoder, int action) -{ - struct drm_device *dev = encoder->dev; - struct radeon_device *rdev = dev->dev_private; - struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); - ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION args; - int index = 0; - - memset(&args, 0, sizeof(args)); - - index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); - - args.sXTmdsEncoder.ucEnable = action; - - if (radeon_encoder->pixel_clock > 165000) - args.sXTmdsEncoder.ucMisc = PANEL_ENCODER_MISC_DUAL; - - /*if (pScrn->rgbBits == 8)*/ - args.sXTmdsEncoder.ucMisc |= (1 << 1); - - atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); - -} +union dvo_encoder_control { + ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION ext_tmds; + DVO_ENCODER_CONTROL_PS_ALLOCATION dvo; + DVO_ENCODER_CONTROL_PS_ALLOCATION_V3 dvo_v3; +}; -static void -atombios_ddia_setup(struct drm_encoder *encoder, int action) +void +atombios_dvo_setup(struct drm_encoder *encoder, int action) { struct drm_device *dev = encoder->dev; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); - DVO_ENCODER_CONTROL_PS_ALLOCATION args; - int index = 0; + union dvo_encoder_control args; + int index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); memset(&args, 0, sizeof(args)); - index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); + if (ASIC_IS_DCE3(rdev)) { + /* DCE3+ */ + args.dvo_v3.ucAction = action; + args.dvo_v3.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + args.dvo_v3.ucDVOConfig = 0; /* XXX */ + } else if (ASIC_IS_DCE2(rdev)) { + /* DCE2 (pre-DCE3 R6xx, RS600/690/740 */ + args.dvo.sDVOEncoder.ucAction = action; + args.dvo.sDVOEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + /* DFP1, CRT1, TV1 depending on the type of port */ + args.dvo.sDVOEncoder.ucDeviceType = ATOM_DEVICE_DFP1_INDEX; + + if (radeon_encoder->pixel_clock > 165000) + args.dvo.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute |= PANEL_ENCODER_MISC_DUAL; + } else { + /* R4xx, R5xx */ + args.ext_tmds.sXTmdsEncoder.ucEnable = action; - args.sDVOEncoder.ucAction = action; - args.sDVOEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + if (radeon_encoder->pixel_clock > 165000) + args.ext_tmds.sXTmdsEncoder.ucMisc |= PANEL_ENCODER_MISC_DUAL; - if (radeon_encoder->pixel_clock > 165000) - args.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute = PANEL_ENCODER_MISC_DUAL; + /*if (pScrn->rgbBits == 8)*/ + args.ext_tmds.sXTmdsEncoder.ucMisc |= ATOM_PANEL_MISC_888RGB; + } atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); - } union
[PATCH 4/4] drm/radeon/kms/atom: add proper external encoders support
These are external encoder chips connected via DVO or DP. The actual external encoder programming is handled by the kms encoder functions for primary encoder. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_encoders.c | 183 ++ drivers/gpu/drm/radeon/radeon_mode.h |1 + 2 files changed, 184 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 8374131..712f1d2 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -229,6 +229,27 @@ radeon_get_connector_for_encoder(struct drm_encoder *encoder) return NULL; } +struct drm_encoder *radeon_atom_get_external_encoder(struct drm_encoder *encoder) +{ + struct drm_device *dev = encoder->dev; + struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); + struct drm_encoder *other_encoder; + struct radeon_encoder *other_radeon_encoder; + + if (radeon_encoder->is_ext_encoder) + return NULL; + + list_for_each_entry(other_encoder, &dev->mode_config.encoder_list, head) { + if (other_encoder == encoder) + continue; + other_radeon_encoder = to_radeon_encoder(other_encoder); + if (other_radeon_encoder->is_ext_encoder && + (radeon_encoder->devices & other_radeon_encoder->devices)) + return other_encoder; + } + return NULL; +} + void radeon_panel_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *adjusted_mode) { @@ -1002,6 +1023,75 @@ atombios_set_edp_panel_power(struct radeon_connector *radeon_connector, int acti atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +union external_encoder_control { + EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION v1; +}; + +static void +atombios_external_encoder_setup(struct drm_encoder *encoder, + struct drm_encoder *ext_encoder, + int action) +{ + struct drm_device *dev = encoder->dev; + struct radeon_device *rdev = dev->dev_private; + struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); + union external_encoder_control args; + struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + int index = GetIndexIntoMasterTable(COMMAND, ExternalEncoderControl); + u8 frev, crev; + int dp_clock = 0; + int dp_lane_count = 0; + int connector_object_id = 0; + + if (connector) { + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *dig_connector = + radeon_connector->con_priv; + + dp_clock = dig_connector->dp_clock; + dp_lane_count = dig_connector->dp_lane_count; + connector_object_id = + (radeon_connector->connector_object_id & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT; + } + + memset(&args, 0, sizeof(args)); + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + switch (frev) { + case 1: + /* no params on frev 1 */ + break; + case 2: + switch (crev) { + case 1: + case 2: + args.v1.sDigEncoder.ucAction = action; + args.v1.sDigEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + args.v1.sDigEncoder.ucEncoderMode = atombios_get_encoder_mode(encoder); + + if (args.v1.sDigEncoder.ucEncoderMode == ATOM_ENCODER_MODE_DP) { + if (dp_clock == 27) + args.v1.sDigEncoder.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ; + args.v1.sDigEncoder.ucLaneNum = dp_lane_count; + } else if (radeon_encoder->pixel_clock > 165000) + args.v1.sDigEncoder.ucLaneNum = 8; + else + args.v1.sDigEncoder.ucLaneNum = 4; + break; + default: + DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); + return; + } + break; + default: + DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); + return; + } + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1045,6 +1135,7 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) struct drm_device *dev = encoder->d
Re: Radeon drm: dpms backlight problem / question / bug?
On Wed, Nov 10, 2010 at 12:10 PM, Alex Deucher wrote: > 2010/11/6 Prof. Dr. Klaus Kusche : >> On 2010-11-02 08:20, Michel Dänzer wrote: >>> >>> On Mon, 2010-11-01 at 16:09 +0100, Prof. Dr. Klaus Kusche wrote: On my Dell Precision M6500, backlight power switching does not work, neither by using bl_power in /sys/backlight/... >>> >>> Please provide the full path of the file you're using. >>> nor by using DPMS: * Any changes of bl_power are simply and silently ignored (no effect, except that brightness is set to minimum), although brightness tuning works fine (in other words: Both the generic ACPI BIOS driver and the in-kernel Dell laptop backlight driver can control backlight brightness, but not backlight power). * If DPMS becomes active, the screen contents on the internal display slowly becomes garbled or fades away (so video output drivers seem to be off), but the backlight remains on (which is very bad for battery power). The external screen (on display port) behaves even worse: It enters energy saving mode (backlight off) and immediately wakes up again, continuously cycling the backlight power every few seconds. Another problem which optically looks the same: Zapping the X server (Xorg 1.9.1, radeon 6.13.2) with Ctrl-Alt-Bksp leaves the system in an undefined state: * Similar to DPMS, the display fades away or gets garbled (video output off), but the backlight remains on. * It does not switch to the text console automatically, nor is it possible to switch manually with Ctrl-Alt-Fn. Configuration: * Kernel 2.6.35.7-grsec * Radeon DRM with KMS * Radeon framebuffer with backlight control enabled * The Radeon chip is a JUNIPER 0x1002:0x68A0, the kernel should contain all the microcode needed for it. * The displays are LCD1: INTERNAL_UNIPHY and DFP1: INTERNAL_UNIPHY1 >>> >>> Please provide the full Xorg.0.log file and dmesg output. >> >> I've sent the full logs on Nov 2nd. >> Did they arrive? >> Did they provide any insight? >> >> Anything else I can do / try / provide? >> > > I have some ideas, but I won't be able to look at this until next week. Try these patches: http://lists.freedesktop.org/archives/dri-devel/2010-November/005506.html http://lists.freedesktop.org/archives/dri-devel/2010-November/005507.html Alex > > Alex > >> Many thanks in advance for your help! >> >> -- >> Prof. Dr. Klaus Kusche >> Private address: Rainstraße 9/1, 88316 Isny, Germany >> +49 7562 6211377 klaus.kus...@computerix.info http://www.computerix.info >> Office address: NTA Isny gGmbH, Seidenstraße 12-35, 88316 Isny, Germany >> +49 7562 9707 36 kus...@nta-isny.de http://www.nta-isny.de >> >> ___ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel >> > ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31667] New: r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 Summary: r600c and r600g: wrong rendering for Savage2 game Product: Mesa Version: git Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: edwinto...@gmail.com Created an attachment (id=40311) --> (https://bugs.freedesktop.org/attachment.cgi?id=40311) r600g_bad_transp_lines.jpg Savage2 is a free to play (but not opensource) game with native Linux clients, it renders correctly with llvmpipe and fglrx. It doesn't render correctly with r600c and r600g. Using latest git version (commit 063c6b8f74d114241f663ef8fd93732a0a07c10f). llvmpipe that works (sort of, its very very slow): $ LD_LIBRARY_PATH=$HOME/mesa/lib/gallium glxinfo | grep OpenGL OpenGL vendor string: VMware, Inc. OpenGL renderer string: Gallium 0.4 on llvmpipe OpenGL version string: 2.1 Mesa 7.10-devel OpenGL shading language version string: 1.20 OpenGL extensions: r600c has part of the screen black (see attached screenshot r600c_bad_partblack.jpg), but the menu is good (r600c_menu_good.jpg): $ glxinfo|grep OpenGL OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: Mesa DRI R600 (RV730 9498) 20090101 TCL DRI2 OpenGL version string: 2.1 Mesa 7.10-devel OpenGL shading language version string: 1.20 OpenGL extensions: r600g doesn't have the blackness bug, but the main character is missing/totally transparent you just see some swords running around (r600g_bad_transp_lines.jpg), and it has some thin black horizontal lines all over the screen. The menu also has the thin black horizontal lines (r600g_bad_menu_lines.jpg). LIBGL_DRIVERS_PATH=$HOME/mesa/lib/gallium glxinfo|grep OpenGL OpenGL vendor string: X.Org OpenGL renderer string: Gallium 0.4 on AMD RV730 OpenGL version string: 2.1 Mesa 7.10-devel OpenGL shading language version string: 1.20 OpenGL extensions: The video card is: 01:00.0 VGA compatible controller: ATI Technologies Inc RV730 PRO [Radeon HD 4650] -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #1 from Török Edwin 2010-11-16 09:19:58 PST --- Created an attachment (id=40312) --> (https://bugs.freedesktop.org/attachment.cgi?id=40312) r600g_bad_menu_lines.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #2 from Török Edwin 2010-11-16 09:20:16 PST --- Created an attachment (id=40313) --> (https://bugs.freedesktop.org/attachment.cgi?id=40313) r600c_bad_partblack.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #3 from Török Edwin 2010-11-16 09:20:32 PST --- Created an attachment (id=40314) --> (https://bugs.freedesktop.org/attachment.cgi?id=40314) r600c_menu_good.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #4 from Török Edwin 2010-11-16 09:20:46 PST --- Created an attachment (id=40315) --> (https://bugs.freedesktop.org/attachment.cgi?id=40315) llvmpipe_ok.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #5 from Török Edwin 2010-11-16 09:22:37 PST --- To reproduce bug: 1. Install Savage2 2. LIBGL_DRIVERS_PATH=$HOME/mesa/lib/gallium ./savage2.bin 3. Press "Practice" (that way you can play locally, and don't have to join multiplayer server etc.) 4. Wait till it loads, can take quite a while 5. When in the game you can take screenshot with F5 (they are saved in ~/.savage2/game/screenshots), as soon as you enter the game you can see the rendering errors. If you need any more info please ask. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/3] embed drm_gem_object into radeon_bo
On Tue, Nov 16, 2010 at 06:05:25PM +0100, Sedat Dilek wrote: > I have tested both patchsets from Daniel (see [1] and [2]) again on a > Radeon RV250 in a none-BKL-config and it looks like > >agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch > > is the culprit in combination with the below listed drm patches. Likely a gem_bo->driver_private access. My patches set this to NULL to catch conversion bugs. -Daniel -- Daniel Vetter Mail: dan...@ffwll.ch Mobile: +41 (0)79 365 57 48 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31670] New: RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2
https://bugs.freedesktop.org/show_bug.cgi?id=31670 Summary: RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2 Product: DRI Version: unspecified Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: DRM/Radeon AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: alain.per...@gmail.com When running the OpenArena anholt benchmark on my Radeon HD 3870 (RV670, PCIe) on my 64-bit Kubuntu 10.10 system with kernel 2.6.37 rc1 or rc2, and libdrm, mesa, xorg-video-ati from git master, I often get a GPU lockup on the level loading screen. I can still log into the system through SSH and reboot it, but I cannot kill the openarena process. There is nothing in dmesg when the lockup occurs. There is no such issue with kernel 2.6.36 and the same versions of libdrm, mesa, xorg-video-ati. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31670] RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2
https://bugs.freedesktop.org/show_bug.cgi?id=31670 --- Comment #1 from Alain Perrot 2010-11-16 10:40:51 PST --- I forgot to tell that this is with KMS enabled and Gallium based r600g Mesa driver. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 31670] RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2
https://bugs.freedesktop.org/show_bug.cgi?id=31670 --- Comment #2 from Alex Deucher 2010-11-16 10:49:22 PST --- Can you bisect to see which commit is problematic? -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 0/3] embed drm_gem_object into radeon_bo
On Tue, Nov 16, 2010 at 6:30 PM, Daniel Vetter wrote: > On Tue, Nov 16, 2010 at 06:05:25PM +0100, Sedat Dilek wrote: >> I have tested both patchsets from Daniel (see [1] and [2]) again on a >> Radeon RV250 in a none-BKL-config and it looks like >> >> agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch >> >> is the culprit in combination with the below listed drm patches. > Likely a gem_bo->driver_private access. My patches set this to NULL to > catch conversion bugs. > -Daniel > -- > Daniel Vetter > Mail: dan...@ffwll.ch > Mobile: +41 (0)79 365 57 48 > [ CCing Alex Deucher ] With the attached diff to the original patch from [1], OpenArena works with pageflip-support for radeon-KMS. Unfortunately, there is a drop in fps from 18.5 down to 13.5. - Sedat - [1] http://people.freedesktop.org/~agd5f/pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch $ cd ~/src/linux-2.6/linux-2.6.37-rc2/debian/build/source_i386_none/ $ cat .pc/applied-patches danvet-drm-for-sedat-dilek/0001-drm-nouveau-don-t-munge-in-drm_mm-internals.patch danvet-drm-for-sedat-dilek/0002-drm_mm-add-support-for-range-restricted-fair-lru-sca.patch danvet-drm-for-sedat-dilek/0003-drm-mm-track-free-areas-implicitly.patch danvet-drm-for-sedat-dilek/0004-drm-mm-extract-node-insert-helper-functions.patch danvet-drm-for-sedat-dilek/0005-drm-mm-add-api-for-embedding-struct-drm_mm_node.patch danvet-drm-for-sedat-dilek/0006-drm-mm-add-helper-to-unwind-scan-state.patch danvet-embed-drm_gem_object-into-radeon_bo/1-3-drm-radeon-embed-struct-drm_gem_object.patch danvet-embed-drm_gem_object-into-radeon_bo/2-3-drm-radeon-introduce-gem_to_radeon_bo-helper.patch danvet-embed-drm_gem_object-into-radeon_bo/3-3-drm-radeon-kill-radeon_bo--gobj-pointer.patch drm-vblank-timestamping/0001-drm-vblank-Add-support-for-precise-vblank-timestampi.patch drm-vblank-timestamping/0002-drm-radeon-Add-support-for-precise-vblank-timestampi.patch for-drm-radeon-testing/drm-radeon-kms-enable-writeback-on-radeon-AGP-boards.patch agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support-for-danvet-v2.patch $ cd ~/src/mesa/ $ ./scripts/run_openarena-benchmark.sh 840 frames 62.6 seconds 13.4 fps 16.0/74.5/224.0/19.7 ms diff -Naur 0002-drm-radeon-kms-add-pageflip-ioctl-support.patch 0002-drm-radeon-kms-add-pageflip-ioctl-support-for-danvet-v2.patch --- 0002-drm-radeon-kms-add-pageflip-ioctl-support.patch 2010-10-31 18:53:38.0 +0100 +++ 0002-drm-radeon-kms-add-pageflip-ioctl-support-for-danvet-v2.patch 2010-11-16 20:07:12.380393000 +0100 @@ -1319,7 +1319,7 @@ + new_radeon_fb = to_radeon_framebuffer(fb); + /* schedule unpin of the old buffer */ + obj = old_radeon_fb->obj; -+ rbo = obj->driver_private; ++ rbo = gem_to_radeon_bo(obj); + work->old_rbo = rbo; + INIT_WORK(&work->work, radeon_unpin_work_func); + @@ -1338,7 +1338,7 @@ + + /* pin the new buffer */ + obj = new_radeon_fb->obj; -+ rbo = obj->driver_private; ++ rbo = gem_to_radeon_bo(obj); + r = radeon_bo_reserve(rbo, false); + if (unlikely(r != 0)) + goto pflip_cleanup; ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/radeon/kms: fix typo in r600 cs checker
Looks like a typo in: drm/radeon/r600: fix tiling issues in CS checker. (f30df2fad0c901e74ac9a52a488a54c69a373a41) Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/r600_cs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 0f90fc3..9bebac1 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -315,7 +315,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { /* the initial DDX does bad things with the CB size occasionally */ /* it rounds up height too far for slice tile max but the BO is smaller */ - tmp = (height - 7) * 8 * bpe; + tmp = (height - 7) * pitch * bpe; if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); return -EINVAL; -- 1.7.1.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 0/2] Fix nouveau-related freezes
On Wed, Nov 10, 2010 at 6:04 PM, Andy Lutomirski wrote: > Nouveau takes down my system quite reliably when any hotplug event occurs. > The bug happens because the IRQ handler didn't acknowledge the hotplug > state until the bottom half, so the card generated a new interrupt > immediately, starving the bottom half and permanently starving that CPU > (and hence the bottom half). > > Even with this fix, a lot of the IRQ code looks rather broken. > > This is tested on 2.6.36 (and makes the system stable for me), but it also > applies cleanly to 2.6.37 (untested, but surely also necessary). Fedora 14's > 2.6.35 kernels seem to have to same problem for me, so I suspect that 2.6.35 > needs this fix as well. (All of my tests are on an NV50 card.) > > Changes from v1: > - Ignore unrequested hotplug bits (I accidentally removed that part). > - Support newer hardware (untested -- Ben, can you check this?) Just a quick ping: is this making its way to Linus (and stable)? I've been running it for five days through (literally, due to monitor bugs) thousands of plug/unplug cycles with no ill effects. (Can we *please* get rid of, or at least ratelimit, the plugged/unplugged printk? It's taking over my logs, and I'm almost certain that it's not a driver bug.) --Andy ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 0/2] Fix nouveau-related freezes
On Tue, 2010-11-16 at 17:19 -0500, Andrew Lutomirski wrote: > On Wed, Nov 10, 2010 at 6:04 PM, Andy Lutomirski wrote: > > Nouveau takes down my system quite reliably when any hotplug event occurs. > > The bug happens because the IRQ handler didn't acknowledge the hotplug > > state until the bottom half, so the card generated a new interrupt > > immediately, starving the bottom half and permanently starving that CPU > > (and hence the bottom half). > > > > Even with this fix, a lot of the IRQ code looks rather broken. > > > > This is tested on 2.6.36 (and makes the system stable for me), but it also > > applies cleanly to 2.6.37 (untested, but surely also necessary). Fedora > > 14's > > 2.6.35 kernels seem to have to same problem for me, so I suspect that 2.6.35 > > needs this fix as well. (All of my tests are on an NV50 card.) > > > > Changes from v1: > > - Ignore unrequested hotplug bits (I accidentally removed that part). > > - Support newer hardware (untested -- Ben, can you check this?) > > Just a quick ping: is this making its way to Linus (and stable)? I've > been running it for five days through (literally, due to monitor bugs) > thousands of plug/unplug cycles with no ill effects. This issue has been fixed in nouveau git now, but that fix can't be pulled into stable/linus as it depends on architectural changes to nouveau that Linus probably wouldn't accept this late. I responded to a mail asking that the patches be redone to just fix the bug *without* removing the "magic numbers" (so, just patch 2/2 essentially), to avoid more unnecessary conflicts with nouveau git. Ben. > > (Can we *please* get rid of, or at least ratelimit, the > plugged/unplugged printk? It's taking over my logs, and I'm almost > certain that it's not a driver bug.) > > --Andy ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 28995] [r300g] dri rejects command buffers
https://bugs.freedesktop.org/show_bug.cgi?id=28995 --- Comment #21 from Álmos 2010-11-16 15:19:40 PST --- I now tried with 2.6.36 and mesa git from nov 12. vdrift 2009 release with large textures on monaco: [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation -12! vdrift 2010 release with the same settings: OK sauerbraten with venice map: OK nexuiz with desertfactory map: [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation -12! doom3: I couldn't test, because since I increased GART from 64MB to 256MB, it segfaults immediately with: WARNING: vertex array range in virtual memory (SLOW) signal caught: Segmentation fault si_code 1 Trying to exit gracefully.. Meanwhile I found out what caused the hardlock: the preemption model was set to preemptible kernel, now with voluntary kernel preemption it seems to be stable. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3] nouveau: Acknowledge HPD irq in handler, not bottom half
The old code generated an interrupt storm bad enough to completely take down my system. Signed-off-by: Andy Lutomirski Cc: sta...@kernel.org --- Changes from v2: Don't use (wrong) #define'd register names. drivers/gpu/drm/nouveau/nouveau_drv.h |6 + drivers/gpu/drm/nouveau/nouveau_irq.c |1 + drivers/gpu/drm/nouveau/nv50_display.c | 35 +++ 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index b1be617..c926d88 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -531,6 +531,12 @@ struct drm_nouveau_private { struct work_struct irq_work; struct work_struct hpd_work; + struct { + spinlock_t lock; + uint32_t hpd0_bits; + uint32_t hpd1_bits; + } hpd_state; + struct list_head vbl_waiting; struct { diff --git a/drivers/gpu/drm/nouveau/nouveau_irq.c b/drivers/gpu/drm/nouveau/nouveau_irq.c index 794b0ee..b62a601 100644 --- a/drivers/gpu/drm/nouveau/nouveau_irq.c +++ b/drivers/gpu/drm/nouveau/nouveau_irq.c @@ -52,6 +52,7 @@ nouveau_irq_preinstall(struct drm_device *dev) if (dev_priv->card_type >= NV_50) { INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh); INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh); + spin_lock_init(&dev_priv->hpd_state.lock); INIT_LIST_HEAD(&dev_priv->vbl_waiting); } } diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 612fa6d..d967cb6 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -1012,11 +1012,18 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) struct drm_connector *connector; const uint32_t gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 }; uint32_t unplug_mask, plug_mask, change_mask; - uint32_t hpd0, hpd1 = 0; + uint32_t hpd0, hpd1; - hpd0 = nv_rd32(dev, 0xe054) & nv_rd32(dev, 0xe050); + spin_lock_irq(&dev_priv->hpd_state.lock); + hpd0 = dev_priv->hpd_state.hpd0_bits; + dev_priv->hpd_state.hpd0_bits = 0; + hpd1 = dev_priv->hpd_state.hpd1_bits; + dev_priv->hpd_state.hpd1_bits = 0; + spin_unlock_irq(&dev_priv->hpd_state.lock); + + hpd0 &= nv_rd32(dev, 0xe050); if (dev_priv->chipset >= 0x90) - hpd1 = nv_rd32(dev, 0xe074) & nv_rd32(dev, 0xe070); + hpd1 &= nv_rd32(dev, 0xe070); plug_mask = (hpd0 & 0x) | (hpd1 << 16); unplug_mask = (hpd0 >> 16) | (hpd1 & 0x); @@ -1058,10 +1065,6 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) helper->dpms(connector->encoder, DRM_MODE_DPMS_OFF); } - nv_wr32(dev, 0xe054, nv_rd32(dev, 0xe054)); - if (dev_priv->chipset >= 0x90) - nv_wr32(dev, 0xe074, nv_rd32(dev, 0xe074)); - drm_helper_hpd_irq_event(dev); } @@ -1072,8 +1075,22 @@ nv50_display_irq_handler(struct drm_device *dev) uint32_t delayed = 0; if (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_HOTPLUG) { - if (!work_pending(&dev_priv->hpd_work)) - queue_work(dev_priv->wq, &dev_priv->hpd_work); + uint32_t hpd0_bits, hpd1_bits = 0; + + hpd0_bits = nv_rd32(dev, 0xe054); + nv_wr32(dev, 0xe054, hpd0_bits); + + if (dev_priv->chipset >= 0x90) { + hpd1_bits = nv_rd32(dev, 0xe074); + nv_wr32(dev, 0xe074, hpd1_bits); + } + + spin_lock(&dev_priv->hpd_state.lock); + dev_priv->hpd_state.hpd0_bits |= hpd0_bits; + dev_priv->hpd_state.hpd1_bits |= hpd1_bits; + spin_unlock(&dev_priv->hpd_state.lock); + + queue_work(dev_priv->wq, &dev_priv->hpd_work); } while (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_DISPLAY) { -- 1.7.3.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/radeon/kms: properly power up/down the eDP panel as needed (v2)
The eDP panel must be powered up for aux transactions, so power it up for detect and mode probe functions, otherwise power it up or down based on dpms. v2: - only mess with eDP panel on DCE4+ - only mess with eDP panel on eDP connectors, not all DP connectors Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_connectors.c | 18 +++ drivers/gpu/drm/radeon/radeon_encoders.c | 44 drivers/gpu/drm/radeon/radeon_mode.h |2 + 3 files changed, 64 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe6c747..fd7341b 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1008,9 +1008,21 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector) static int radeon_dp_get_modes(struct drm_connector *connector) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; int ret; + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); + } ret = radeon_ddc_get_modes(radeon_connector); + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); + } + return ret; } @@ -1029,8 +1041,14 @@ radeon_dp_detect(struct drm_connector *connector, bool force) if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { /* eDP is always DP */ radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); if (radeon_dp_getdpcd(radeon_connector)) ret = connector_status_connected; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); } else { radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index d55cb58..ccd1cfe 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -978,6 +978,32 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +void +atombios_set_edp_panel_power(struct radeon_connector *radeon_connector, int action) +{ + struct drm_device *dev = radeon_connector->base.dev; + struct radeon_device *rdev = dev->dev_private; + union dig_transmitter_control args; + int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); + uint8_t frev, crev; + + if (!ASIC_IS_DCE4(rdev)) + return; + + if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || + (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) + return; + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + memset(&args, 0, sizeof(args)); + + args.v1.ucAction = action; + + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1082,6 +1108,14 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = + radeon_connector->con_priv; + atombios_set_edp_panel_power(radeon_connector, + ATOM_T
[PATCH] drm/radeon/kms: properly power up/down the eDP panel as needed (v3)
The eDP panel must be powered up for aux transactions, so power it up for detect and mode probe functions, otherwise power it up or down based on dpms. v2: - only mess with eDP panel on DCE4+ - only mess with eDP panel on eDP connectors, not all DP connectors v3: - be extra careful to only mess with eDP panels on eDP connectors Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_connectors.c | 18 ++ drivers/gpu/drm/radeon/radeon_encoders.c | 48 drivers/gpu/drm/radeon/radeon_mode.h |2 + 3 files changed, 68 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe6c747..3bef9f6 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1008,9 +1008,21 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector) static int radeon_dp_get_modes(struct drm_connector *connector) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; int ret; + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); + } ret = radeon_ddc_get_modes(radeon_connector); + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); + } + return ret; } @@ -1029,8 +1041,14 @@ radeon_dp_detect(struct drm_connector *connector, bool force) if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { /* eDP is always DP */ radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); if (radeon_dp_getdpcd(radeon_connector)) ret = connector_status_connected; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); } else { radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index d55cb58..5ad24fd 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -978,6 +978,36 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +void +atombios_set_edp_panel_power(struct drm_connector *connector, int action) +{ + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct drm_device *dev = radeon_connector->base.dev; + struct radeon_device *rdev = dev->dev_private; + union dig_transmitter_control args; + int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); + uint8_t frev, crev; + + if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) + return; + + if (!ASIC_IS_DCE4(rdev)) + return; + + if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || + (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) + return; + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + memset(&args, 0, sizeof(args)); + + args.v1.ucAction = action; + + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1082,6 +1112,14 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = +
[PATCH] drm/radeon/kms/atom: set sane defaults in atombios_get_encoder_mode()
If there was no connector mapped to the encoder, atombios_get_encoder_mode() returned 0 which is the id for DP. Return something sane instead based on the encoder id. This avoids hitting the DP paths on non-DP encoders. Signed-off-by: Alex Deucher Cc: sta...@kernel.org --- drivers/gpu/drm/radeon/radeon_encoders.c | 18 +++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index d55cb58..c6981df 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -595,6 +595,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) int atombios_get_encoder_mode(struct drm_encoder *encoder) { + struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct drm_device *dev = encoder->dev; struct radeon_device *rdev = dev->dev_private; struct drm_connector *connector; @@ -602,9 +603,20 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) struct radeon_connector_atom_dig *dig_connector; connector = radeon_get_connector_for_encoder(encoder); - if (!connector) - return 0; - + if (!connector) { + switch (radeon_encoder->encoder_id) { + case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: + case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: + case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: + case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: + case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: + return ATOM_ENCODER_MODE_DVI; + case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: + case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: + default: + return ATOM_ENCODER_MODE_CRT; + } + } radeon_connector = to_radeon_connector(connector); switch (connector->connector_type) { -- 1.7.1.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/radeon/kms: properly power up/down the eDP panel as needed (v4)
The eDP panel must be powered up for aux transactions, so power it up for detect and mode probe functions, otherwise power it up or down based on dpms. v2: - only mess with eDP panel on DCE4+ - only mess with eDP panel on eDP connectors, not all DP connectors v3: - be extra careful to only mess with eDP panels on eDP connectors v4: - avoid possible null derefernce if a connector has not been assigned to the encoder Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_connectors.c | 18 ++ drivers/gpu/drm/radeon/radeon_encoders.c | 50 drivers/gpu/drm/radeon/radeon_mode.h |2 + 3 files changed, 70 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe6c747..3bef9f6 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1008,9 +1008,21 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector) static int radeon_dp_get_modes(struct drm_connector *connector) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; int ret; + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); + } ret = radeon_ddc_get_modes(radeon_connector); + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); + } + return ret; } @@ -1029,8 +1041,14 @@ radeon_dp_detect(struct drm_connector *connector, bool force) if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { /* eDP is always DP */ radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); if (radeon_dp_getdpcd(radeon_connector)) ret = connector_status_connected; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); } else { radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index c6981df..63f4964 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -990,6 +990,36 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +void +atombios_set_edp_panel_power(struct drm_connector *connector, int action) +{ + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct drm_device *dev = radeon_connector->base.dev; + struct radeon_device *rdev = dev->dev_private; + union dig_transmitter_control args; + int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); + uint8_t frev, crev; + + if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) + return; + + if (!ASIC_IS_DCE4(rdev)) + return; + + if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || + (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) + return; + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + memset(&args, 0, sizeof(args)); + + args.v1.ucAction = action; + + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1094,6 +1124,15 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + if (connector && + (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { + struct radeon_connector *radeon_connector = to_radeon_connector(conn
[Bug 31572] [bisected piketon] urbanterror performance regression
https://bugs.freedesktop.org/show_bug.cgi?id=31572 fangxun changed: What|Removed |Added Summary|[piketon] urbanterror |[bisected piketon] |performance regression |urbanterror performance ||regression Product|Mesa|DRI Component|Drivers/DRI/i965|libdrm AssignedTo|eric at anholt.net |dri-devel at lists.freedesktop ||.org --- Comment #1 from fangxun 2010-11-16 01:33:24 PST --- Sorry, bisect shows it's Libdrm caused this issue. 877b2ce15b80975b4dac42657bdfb0a3da833e1c is first bad commit. commit 877b2ce15b80975b4dac42657bdfb0a3da833e1c 49447a9b957047db2549b8a929e763bbd87808ba Author: Eric Anholt Date: Tue Nov 9 13:51:45 2010 -0800 intel: Fix drm_intel_gem_bo_wait_rendering to wait for read-only usage too. Both the consumers of this API (sync objects and client throttling) were expecting this behavior. The kernel used to actually behave the desired (but incorrect) way for us anyway, but that got fixed a while back. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31572] [bisected piketon] urbanterror performance regression
https://bugs.freedesktop.org/show_bug.cgi?id=31572 fangxun changed: What|Removed |Added AssignedTo|dri-devel at lists.freedesktop |eric at anholt.net |.org| -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31255] Unigine Sanctuary v2.2: some surfaces have wrong colours
https://bugs.freedesktop.org/show_bug.cgi?id=31255 Pavel Ondra?ka changed: What|Removed |Added Summary|Unigine Sanctuary v 2.2:|Unigine Sanctuary v2.2: |some surfaces have wrong|some surfaces have wrong |colours |colours Component|Mesa core |Drivers/Gallium/r300 AssignedTo|mesa-dev at lists.freedesktop. |dri-devel at lists.freedesktop |org |.org --- Comment #1 from Pavel Ondra?ka 2010-11-16 03:04:33 PST --- This works fine with Tom Stellards sched-perf-rebase branch, so it seems like r300g bug after all. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[PATCH] drm/ttm: Add a bo list reserve fastpath
Makes it possible to reserve a list of buffer objects with a single spin lock / unlock if there is no contention. Should improve cpu usage on SMP kernels. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c | 32 +- drivers/gpu/drm/ttm/ttm_execbuf_util.c | 117 +--- include/drm/ttm/ttm_bo_api.h | 38 ++ include/drm/ttm/ttm_bo_driver.h| 14 include/drm/ttm/ttm_execbuf_util.h |6 ++- 5 files changed, 180 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 148a322..a586378 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -169,7 +169,7 @@ int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, bool interruptible) } EXPORT_SYMBOL(ttm_bo_wait_unreserved); -static void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) +void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) { struct ttm_bo_device *bdev = bo->bdev; struct ttm_mem_type_manager *man; @@ -191,11 +191,7 @@ static void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) } } -/** - * Call with the lru_lock held. - */ - -static int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) +int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) { int put_count = 0; @@ -267,6 +263,15 @@ static void ttm_bo_ref_bug(struct kref *list_kref) BUG(); } +void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, +bool never_free) +{ + while (count--) + kref_put(&bo->list_kref, +(never_free || (count >= 0)) ? ttm_bo_ref_bug : +ttm_bo_release_list); +} + int ttm_bo_reserve(struct ttm_buffer_object *bo, bool interruptible, bool no_wait, bool use_sequence, uint32_t sequence) @@ -282,8 +287,7 @@ int ttm_bo_reserve(struct ttm_buffer_object *bo, put_count = ttm_bo_del_from_lru(bo); spin_unlock(&glob->lru_lock); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); return ret; } @@ -496,8 +500,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) spin_unlock(&glob->lru_lock); ttm_bo_cleanup_memtype_use(bo); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); return; } else { @@ -580,8 +583,7 @@ retry: spin_unlock(&glob->lru_lock); ttm_bo_cleanup_memtype_use(bo); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); return 0; } @@ -802,8 +804,7 @@ retry: BUG_ON(ret != 0); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); ret = ttm_bo_evict(bo, interruptible, no_wait_reserve, no_wait_gpu); ttm_bo_unreserve(bo); @@ -1783,8 +1784,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) put_count = ttm_bo_del_from_lru(bo); spin_unlock(&glob->lru_lock); - while (put_count--) - kref_put(&bo->list_kref, ttm_bo_ref_bug); + ttm_bo_list_ref_sub(bo, put_count, true); /** * Wait for GPU, then move to system cached. diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index c285c29..efb42a8 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c @@ -32,6 +32,70 @@ #include #include +static void ttm_eu_backoff_reservation_locked(struct list_head *list) +{ + struct ttm_validate_buffer *entry; + + list_for_each_entry(entry, list, head) { + struct ttm_buffer_object *bo = entry->bo; + if (!entry->reserved) + continue; + + if (entry->removed) { + ttm_bo_add_to_lru(bo); + entry->removed = false; + + } + entry->reserved = false; + atomic_set(&bo->reserved, 0); + wake_up_all(&bo->event_queue); + } +} + +static void ttm_eu_del_from_lru_locked(struct list_head *list) +{ + struct ttm_validate_buffer *entry; + + list_for_each_entry(entry, list, head) { + struct ttm_buffer_object *bo = entry->bo; + if (!entry->reserved) + continue; + + if (!entry->removed) { + entry->put_count = ttm_bo_del_from_lru(bo); + entry->removed = true; + } + } +} + +static void ttm_eu_list_ref_sub(struct list_head *list) +{ + struct ttm_validate_buffer *entry; + + l
[PATCH 0/2] Introduce kref_sub
Adding a function in order to be able to optimize away a number of locked bus cycles. Callers might for whatever reason want to accumulate unreferences in certain code paths (rcu grace periods, atomic regions ...). This makes it possible to perform the batched unreference more efficiently. If accepted, I'd prefer patch 1 goes through Dave's DRM tree.
[PATCH 1/2] kref: Add a kref_sub function
Makes it possible to optimize batched multiple unrefs. Initial user will be drivers/gpu/ttm which accumulates unrefs to be processed outside of atomic code. Signed-off-by: Thomas Hellstrom --- include/linux/kref.h |2 ++ lib/kref.c | 30 ++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/include/linux/kref.h b/include/linux/kref.h index 6cc38fc..d4a62ab 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h @@ -24,5 +24,7 @@ struct kref { void kref_init(struct kref *kref); void kref_get(struct kref *kref); int kref_put(struct kref *kref, void (*release) (struct kref *kref)); +int kref_sub(struct kref *kref, unsigned int count, +void (*release) (struct kref *kref)); #endif /* _KREF_H_ */ diff --git a/lib/kref.c b/lib/kref.c index d3d227a..3efb882 100644 --- a/lib/kref.c +++ b/lib/kref.c @@ -62,6 +62,36 @@ int kref_put(struct kref *kref, void (*release)(struct kref *kref)) return 0; } + +/** + * kref_sub - subtract a number of refcounts for object. + * @kref: object. + * @count: Number of recounts to subtract. + * @release: pointer to the function that will clean up the object when the + * last reference to the object is released. + * This pointer is required, and it is not acceptable to pass kfree + * in as this function. + * + * Subtract @count from the refcount, and if 0, call release(). + * Return 1 if the object was removed, otherwise return 0. Beware, if this + * function returns 0, you still can not count on the kref from remaining in + * memory. Only use the return value if you want to see if the kref is now + * gone, not present. + */ +int kref_sub(struct kref *kref, unsigned int count, +void (*release)(struct kref *kref)) +{ + WARN_ON(release == NULL); + WARN_ON(release == (void (*)(struct kref *))kfree); + + if (atomic_sub_and_test((int) count, &kref->refcount)) { + release(kref); + return 1; + } + return 0; +} + EXPORT_SYMBOL(kref_init); EXPORT_SYMBOL(kref_get); EXPORT_SYMBOL(kref_put); +EXPORT_SYMBOL(kref_sub); -- 1.6.2.5
[PATCH 2/2] drm/ttm: Use kref_sub instead of repeatedly calling kref_put
Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index a586378..9ef893d 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -266,10 +266,8 @@ static void ttm_bo_ref_bug(struct kref *list_kref) void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, bool never_free) { - while (count--) - kref_put(&bo->list_kref, -(never_free || (count >= 0)) ? ttm_bo_ref_bug : -ttm_bo_release_list); + kref_sub(&bo->list_kref, count, +(never_free) ? ttm_bo_ref_bug : ttm_bo_release_list); } int ttm_bo_reserve(struct ttm_buffer_object *bo, -- 1.6.2.5
[PATCH 0/3] embed drm_gem_object into radeon_bo
[ CCing Arnd Bergmann ] Hi, I have tested both patchsets from Daniel (see [1] and [2]) again on a Radeon RV250 in a none-BKL-config and it looks like agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch is the culprit in combination with the below listed drm patches. I have switched to a "normal" DDX (w/o pageflip-support). The OpenArena benchmarks is now between 17.5 - 18.6 [fps] @1024x768 resolution. ( w/o below patchset: 840 frames 50.6 seconds 16.6 fps 12.0/60.2/267.0/21.3 ms ) Kind Regards, - Sedat - [1] http://lists.freedesktop.org/archives/dri-devel/2010-November/005420.html [2] http://lists.freedesktop.org/archives/dri-devel/2010-November/005441.html $ cd $HOME/src/linux-2.6/linux-2.6.37-rc2/debian/build/source_i386_none/ $ cat .pc/applied-patches danvet-drm-for-sedat-dilek/0001-drm-nouveau-don-t-munge-in-drm_mm-internals.patch danvet-drm-for-sedat-dilek/0002-drm_mm-add-support-for-range-restricted-fair-lru-sca.patch danvet-drm-for-sedat-dilek/0003-drm-mm-track-free-areas-implicitly.patch danvet-drm-for-sedat-dilek/0004-drm-mm-extract-node-insert-helper-functions.patch danvet-drm-for-sedat-dilek/0005-drm-mm-add-api-for-embedding-struct-drm_mm_node.patch danvet-drm-for-sedat-dilek/0006-drm-mm-add-helper-to-unwind-scan-state.patch danvet-embed-drm_gem_object-into-radeon_bo/1-3-drm-radeon-embed-struct-drm_gem_object.patch danvet-embed-drm_gem_object-into-radeon_bo/2-3-drm-radeon-introduce-gem_to_radeon_bo-helper.patch danvet-embed-drm_gem_object-into-radeon_bo/3-3-drm-radeon-kill-radeon_bo--gobj-pointer.patch drm-vblank-timestamping/0001-drm-vblank-Add-support-for-precise-vblank-timestampi.patch drm-vblank-timestamping/0002-drm-radeon-Add-support-for-precise-vblank-timestampi.patch for-drm-radeon-testing/drm-radeon-kms-enable-writeback-on-radeon-AGP-boards.patch $ cd $HOME/src/mesa/ $ ./scripts/run_openarena-benchmark.sh 840 frames 46.5 seconds 18.1 fps 10.0/55.3/147.0/18.9 ms $ grep OK LATEST_linux-2.6/logs/setup_linux-2.6_git0.sd.1.log (+) OK bkl-config/0002-drm-i810-remove-the-BKL.patch (+) OK bkl-config/0003-staging-stradis-mark-as-depends-on-BKL.patch (+) OK bkl-config/0004-BKL-remove-extraneous-include-smp_lock.h.patch (+) OK bkl-config/0005-BKL-remove-references-to-lock_kernel-from-comments.patch (+) OK bkl-config/0006-BKL-disable-by-default.patch (+) OK bkl-config/0007-BKL-mark-lock_kernel-as-deprecated.patch (+) OK bkl-config/0008-BKL-move-CONFIG_BKL-to-staging.patch (+) OK debian/version.patch (+) OK debian/kernelvariables-2.6.37.patch (+) OK debian/doc-build-parallel.patch (+) OK bugfix/ia64/hardcode-arch-script-output.patch (+) OK bugfix/mips/disable-advansys.patch (+) OK bugfix/arm/disable-scsi_acard.patch (+) OK debian/mips-disable-werror.patch (+) OK bugfix/powerpc/lpar-console.patch (+) OK features/all/i915-autoload-without-CONFIG_DRM_I915_KMS.patch (+) OK debian/arch-sh4-fix-uimage-build.patch (+) OK bugfix/mips/mips-ide-flush-dcache.patch (+) OK bugfix/all/qla4xxx-Fix-build-on-some-architectures-lacking-64-bit-I-O.patch (+) OK bugfix/x86/Skip-looking-for-ioapic-overrides-when-ioapics-are-not-present.patch ( NOTE: bkl-config/0001-preempt-fix-kernel-build-with-CONFIG_BKL.patch is already in Linux 2.6.37-rc2 )
[PATCH 1/4] drm/radeon/kms: turn the backlight off explicitly for dpms
Seems some newer systems require this explicitly. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_encoders.c | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index f678257..d55cb58 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -1086,6 +1086,8 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (ASIC_IS_DCE4(rdev)) atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON); } + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) + atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0); break; case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_SUSPEND: @@ -1095,20 +1097,31 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (ASIC_IS_DCE4(rdev)) atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF); } + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) + atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_LCD_BLOFF, 0, 0); break; } } else { switch (mode) { case DRM_MODE_DPMS_ON: args.ucAction = ATOM_ENABLE; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + args.ucAction = ATOM_LCD_BLON; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + } break; case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_SUSPEND: case DRM_MODE_DPMS_OFF: args.ucAction = ATOM_DISABLE; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + args.ucAction = ATOM_LCD_BLOFF; + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); + } break; } - atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } radeon_atombios_encoder_dpms_scratch_regs(encoder, (mode == DRM_MODE_DPMS_ON) ? true : false); -- 1.7.1.1
[PATCH 2/4] drm/radeon/kms: properly power up/down the eDP panel as needed
The eDP panel must be powered up for aux transactions, so power it up for detect and mode probe functions, otherwise power it up or down based on dpms. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_connectors.c | 13 + drivers/gpu/drm/radeon/radeon_encoders.c | 41 drivers/gpu/drm/radeon/radeon_mode.h |2 + 3 files changed, 56 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe6c747..76008a5 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1008,9 +1008,16 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector) static int radeon_dp_get_modes(struct drm_connector *connector) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; int ret; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, +ATOM_TRANSMITTER_ACTION_POWER_ON); ret = radeon_ddc_get_modes(radeon_connector); + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, +ATOM_TRANSMITTER_ACTION_POWER_OFF); return ret; } @@ -1029,8 +1036,14 @@ radeon_dp_detect(struct drm_connector *connector, bool force) if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { /* eDP is always DP */ radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); if (radeon_dp_getdpcd(radeon_connector)) ret = connector_status_connected; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); } else { radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index d55cb58..701103c 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -978,6 +978,29 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +void +atombios_set_edp_panel_power(struct radeon_connector *radeon_connector, int action) +{ + struct drm_device *dev = radeon_connector->base.dev; + struct radeon_device *rdev = dev->dev_private; + union dig_transmitter_control args; + int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); + uint8_t frev, crev; + + if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || + (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) + return; + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + memset(&args, 0, sizeof(args)); + + args.v1.ucAction = action; + + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1082,6 +1105,14 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = + radeon_connector->con_priv; + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); + radeon_dig_connector->edp_on = true; + } dp_link_train(encoder, connector); if (ASIC_IS_DCE4(rdev)) atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON); @@ -1096,
[PATCH 3/4] drm/radeon/kms/atom: cleanup and unify DVO handling
Handle all the various asic family specific things for DVO. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon.h |4 + drivers/gpu/drm/radeon/radeon_encoders.c| 90 --- drivers/gpu/drm/radeon/radeon_legacy_encoders.c |2 +- drivers/gpu/drm/radeon/radeon_mode.h|2 +- 4 files changed, 52 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 73f600d..3a70957 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -1262,6 +1262,10 @@ void r100_pll_errata_after_index(struct radeon_device *rdev); (rdev->family == CHIP_RS400) || \ (rdev->family == CHIP_RS480)) #define ASIC_IS_AVIVO(rdev) ((rdev->family >= CHIP_RS600)) +#define ASIC_IS_DCE2(rdev) ((rdev->family == CHIP_RS600) || \ + (rdev->family == CHIP_RS690) ||\ + (rdev->family == CHIP_RS740) ||\ + (rdev->family >= CHIP_R600)) #define ASIC_IS_DCE3(rdev) ((rdev->family >= CHIP_RV620)) #define ASIC_IS_DCE32(rdev) ((rdev->family >= CHIP_RV730)) #define ASIC_IS_DCE4(rdev) ((rdev->family >= CHIP_CEDAR)) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 701103c..8374131 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -176,6 +176,7 @@ static inline bool radeon_encoder_is_digital(struct drm_encoder *encoder) return false; } } + void radeon_link_encoder_connector(struct drm_device *dev) { @@ -426,52 +427,49 @@ atombios_tv_setup(struct drm_encoder *encoder, int action) } -void -atombios_external_tmds_setup(struct drm_encoder *encoder, int action) -{ - struct drm_device *dev = encoder->dev; - struct radeon_device *rdev = dev->dev_private; - struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); - ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION args; - int index = 0; - - memset(&args, 0, sizeof(args)); - - index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); - - args.sXTmdsEncoder.ucEnable = action; - - if (radeon_encoder->pixel_clock > 165000) - args.sXTmdsEncoder.ucMisc = PANEL_ENCODER_MISC_DUAL; - - /*if (pScrn->rgbBits == 8)*/ - args.sXTmdsEncoder.ucMisc |= (1 << 1); - - atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); - -} +union dvo_encoder_control { + ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION ext_tmds; + DVO_ENCODER_CONTROL_PS_ALLOCATION dvo; + DVO_ENCODER_CONTROL_PS_ALLOCATION_V3 dvo_v3; +}; -static void -atombios_ddia_setup(struct drm_encoder *encoder, int action) +void +atombios_dvo_setup(struct drm_encoder *encoder, int action) { struct drm_device *dev = encoder->dev; struct radeon_device *rdev = dev->dev_private; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); - DVO_ENCODER_CONTROL_PS_ALLOCATION args; - int index = 0; + union dvo_encoder_control args; + int index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); memset(&args, 0, sizeof(args)); - index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); + if (ASIC_IS_DCE3(rdev)) { + /* DCE3+ */ + args.dvo_v3.ucAction = action; + args.dvo_v3.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + args.dvo_v3.ucDVOConfig = 0; /* XXX */ + } else if (ASIC_IS_DCE2(rdev)) { + /* DCE2 (pre-DCE3 R6xx, RS600/690/740 */ + args.dvo.sDVOEncoder.ucAction = action; + args.dvo.sDVOEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + /* DFP1, CRT1, TV1 depending on the type of port */ + args.dvo.sDVOEncoder.ucDeviceType = ATOM_DEVICE_DFP1_INDEX; + + if (radeon_encoder->pixel_clock > 165000) + args.dvo.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute |= PANEL_ENCODER_MISC_DUAL; + } else { + /* R4xx, R5xx */ + args.ext_tmds.sXTmdsEncoder.ucEnable = action; - args.sDVOEncoder.ucAction = action; - args.sDVOEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + if (radeon_encoder->pixel_clock > 165000) + args.ext_tmds.sXTmdsEncoder.ucMisc |= PANEL_ENCODER_MISC_DUAL; - if (radeon_encoder->pixel_clock > 165000) - args.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute = PANEL_ENCODER_MISC_DUAL; + /*if (pScrn->rgbBits == 8)*/ + args.ext_tmds.sXTmdsEncoder.ucMisc |= ATOM_PANEL_MISC_888RGB; + } atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); - } union lvds_enc
[PATCH 4/4] drm/radeon/kms/atom: add proper external encoders support
These are external encoder chips connected via DVO or DP. The actual external encoder programming is handled by the kms encoder functions for primary encoder. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_encoders.c | 183 ++ drivers/gpu/drm/radeon/radeon_mode.h |1 + 2 files changed, 184 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 8374131..712f1d2 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -229,6 +229,27 @@ radeon_get_connector_for_encoder(struct drm_encoder *encoder) return NULL; } +struct drm_encoder *radeon_atom_get_external_encoder(struct drm_encoder *encoder) +{ + struct drm_device *dev = encoder->dev; + struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); + struct drm_encoder *other_encoder; + struct radeon_encoder *other_radeon_encoder; + + if (radeon_encoder->is_ext_encoder) + return NULL; + + list_for_each_entry(other_encoder, &dev->mode_config.encoder_list, head) { + if (other_encoder == encoder) + continue; + other_radeon_encoder = to_radeon_encoder(other_encoder); + if (other_radeon_encoder->is_ext_encoder && + (radeon_encoder->devices & other_radeon_encoder->devices)) + return other_encoder; + } + return NULL; +} + void radeon_panel_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *adjusted_mode) { @@ -1002,6 +1023,75 @@ atombios_set_edp_panel_power(struct radeon_connector *radeon_connector, int acti atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +union external_encoder_control { + EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION v1; +}; + +static void +atombios_external_encoder_setup(struct drm_encoder *encoder, + struct drm_encoder *ext_encoder, + int action) +{ + struct drm_device *dev = encoder->dev; + struct radeon_device *rdev = dev->dev_private; + struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); + union external_encoder_control args; + struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + int index = GetIndexIntoMasterTable(COMMAND, ExternalEncoderControl); + u8 frev, crev; + int dp_clock = 0; + int dp_lane_count = 0; + int connector_object_id = 0; + + if (connector) { + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *dig_connector = + radeon_connector->con_priv; + + dp_clock = dig_connector->dp_clock; + dp_lane_count = dig_connector->dp_lane_count; + connector_object_id = + (radeon_connector->connector_object_id & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT; + } + + memset(&args, 0, sizeof(args)); + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + switch (frev) { + case 1: + /* no params on frev 1 */ + break; + case 2: + switch (crev) { + case 1: + case 2: + args.v1.sDigEncoder.ucAction = action; + args.v1.sDigEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); + args.v1.sDigEncoder.ucEncoderMode = atombios_get_encoder_mode(encoder); + + if (args.v1.sDigEncoder.ucEncoderMode == ATOM_ENCODER_MODE_DP) { + if (dp_clock == 27) + args.v1.sDigEncoder.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ; + args.v1.sDigEncoder.ucLaneNum = dp_lane_count; + } else if (radeon_encoder->pixel_clock > 165000) + args.v1.sDigEncoder.ucLaneNum = 8; + else + args.v1.sDigEncoder.ucLaneNum = 4; + break; + default: + DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); + return; + } + break; + default: + DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); + return; + } + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1045,6 +1135,7 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) struct drm_device *dev = encoder->dev
Radeon drm: dpms backlight problem / question / bug?
On Wed, Nov 10, 2010 at 12:10 PM, Alex Deucher wrote: > 2010/11/6 Prof. Dr. Klaus Kusche : >> On 2010-11-02 08:20, Michel D?nzer wrote: >>> >>> On Mon, 2010-11-01 at 16:09 +0100, Prof. Dr. Klaus Kusche wrote: On my Dell Precision M6500, backlight power switching does not work, neither by using bl_power in /sys/backlight/... >>> >>> Please provide the full path of the file you're using. >>> nor by using DPMS: * Any changes of bl_power are simply and silently ignored ? ?(no effect, except that brightness is set to minimum), ? ?although brightness tuning works fine ? ?(in other words: Both the generic ACPI BIOS driver and the in-kernel ? ?Dell laptop backlight driver can control backlight brightness, ? ?but not backlight power). * If DPMS becomes active, the screen contents on the internal display ? ?slowly becomes garbled or fades away (so video output drivers ? ?seem to be off), but the backlight remains on ? ?(which is very bad for battery power). ? ?The external screen (on display port) behaves even worse: ? ?It enters energy saving mode (backlight off) and immediately wakes up ? ?again, continuously cycling the backlight power every few seconds. Another problem which optically looks the same: Zapping the X server (Xorg 1.9.1, radeon 6.13.2) with Ctrl-Alt-Bksp leaves the system in an undefined state: * Similar to DPMS, the display fades away or gets garbled ? ?(video output off), but the backlight remains on. * It does not switch to the text console automatically, ? ?nor is it possible to switch manually with Ctrl-Alt-Fn. Configuration: * Kernel 2.6.35.7-grsec * Radeon DRM with KMS * Radeon framebuffer with backlight control enabled * The Radeon chip is a JUNIPER 0x1002:0x68A0, ? ?the kernel should contain all the microcode needed for it. * The displays are LCD1: INTERNAL_UNIPHY and DFP1: INTERNAL_UNIPHY1 >>> >>> Please provide the full Xorg.0.log file and dmesg output. >> >> I've sent the full logs on Nov 2nd. >> Did they arrive? >> Did they provide any insight? >> >> Anything else I can do / try / provide? >> > > I have some ideas, but I won't be able to look at this until next week. Try these patches: http://lists.freedesktop.org/archives/dri-devel/2010-November/005506.html http://lists.freedesktop.org/archives/dri-devel/2010-November/005507.html Alex > > Alex > >> Many thanks in advance for your help! >> >> -- >> Prof. Dr. Klaus Kusche >> Private address: Rainstra?e 9/1, 88316 Isny, Germany >> +49 7562 6211377 Klaus.Kusche at computerix.info http://www.computerix.info >> Office address: NTA Isny gGmbH, Seidenstra?e 12-35, 88316 Isny, Germany >> +49 7562 9707 36 kusche at nta-isny.de http://www.nta-isny.de >> >> ___ >> dri-devel mailing list >> dri-devel at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel >> >
[Bug 31667] New: r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 Summary: r600c and r600g: wrong rendering for Savage2 game Product: Mesa Version: git Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel at lists.freedesktop.org ReportedBy: edwintorok at gmail.com Created an attachment (id=40311) --> (https://bugs.freedesktop.org/attachment.cgi?id=40311) r600g_bad_transp_lines.jpg Savage2 is a free to play (but not opensource) game with native Linux clients, it renders correctly with llvmpipe and fglrx. It doesn't render correctly with r600c and r600g. Using latest git version (commit 063c6b8f74d114241f663ef8fd93732a0a07c10f). llvmpipe that works (sort of, its very very slow): $ LD_LIBRARY_PATH=$HOME/mesa/lib/gallium glxinfo | grep OpenGL OpenGL vendor string: VMware, Inc. OpenGL renderer string: Gallium 0.4 on llvmpipe OpenGL version string: 2.1 Mesa 7.10-devel OpenGL shading language version string: 1.20 OpenGL extensions: r600c has part of the screen black (see attached screenshot r600c_bad_partblack.jpg), but the menu is good (r600c_menu_good.jpg): $ glxinfo|grep OpenGL OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: Mesa DRI R600 (RV730 9498) 20090101 TCL DRI2 OpenGL version string: 2.1 Mesa 7.10-devel OpenGL shading language version string: 1.20 OpenGL extensions: r600g doesn't have the blackness bug, but the main character is missing/totally transparent you just see some swords running around (r600g_bad_transp_lines.jpg), and it has some thin black horizontal lines all over the screen. The menu also has the thin black horizontal lines (r600g_bad_menu_lines.jpg). LIBGL_DRIVERS_PATH=$HOME/mesa/lib/gallium glxinfo|grep OpenGL OpenGL vendor string: X.Org OpenGL renderer string: Gallium 0.4 on AMD RV730 OpenGL version string: 2.1 Mesa 7.10-devel OpenGL shading language version string: 1.20 OpenGL extensions: The video card is: 01:00.0 VGA compatible controller: ATI Technologies Inc RV730 PRO [Radeon HD 4650] -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #1 from T?r?k Edwin 2010-11-16 09:19:58 PST --- Created an attachment (id=40312) --> (https://bugs.freedesktop.org/attachment.cgi?id=40312) r600g_bad_menu_lines.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #2 from T?r?k Edwin 2010-11-16 09:20:16 PST --- Created an attachment (id=40313) --> (https://bugs.freedesktop.org/attachment.cgi?id=40313) r600c_bad_partblack.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #3 from T?r?k Edwin 2010-11-16 09:20:32 PST --- Created an attachment (id=40314) --> (https://bugs.freedesktop.org/attachment.cgi?id=40314) r600c_menu_good.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #4 from T?r?k Edwin 2010-11-16 09:20:46 PST --- Created an attachment (id=40315) --> (https://bugs.freedesktop.org/attachment.cgi?id=40315) llvmpipe_ok.jpg -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31667] r600c and r600g: wrong rendering for Savage2 game
https://bugs.freedesktop.org/show_bug.cgi?id=31667 --- Comment #5 from T?r?k Edwin 2010-11-16 09:22:37 PST --- To reproduce bug: 1. Install Savage2 2. LIBGL_DRIVERS_PATH=$HOME/mesa/lib/gallium ./savage2.bin 3. Press "Practice" (that way you can play locally, and don't have to join multiplayer server etc.) 4. Wait till it loads, can take quite a while 5. When in the game you can take screenshot with F5 (they are saved in ~/.savage2/game/screenshots), as soon as you enter the game you can see the rendering errors. If you need any more info please ask. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[PATCH 0/3] embed drm_gem_object into radeon_bo
On Tue, Nov 16, 2010 at 06:05:25PM +0100, Sedat Dilek wrote: > I have tested both patchsets from Daniel (see [1] and [2]) again on a > Radeon RV250 in a none-BKL-config and it looks like > >agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch > > is the culprit in combination with the below listed drm patches. Likely a gem_bo->driver_private access. My patches set this to NULL to catch conversion bugs. -Daniel -- Daniel Vetter Mail: daniel at ffwll.ch Mobile: +41 (0)79 365 57 48
[Bug 31670] New: RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2
https://bugs.freedesktop.org/show_bug.cgi?id=31670 Summary: RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2 Product: DRI Version: unspecified Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: DRM/Radeon AssignedTo: dri-devel at lists.freedesktop.org ReportedBy: alain.perrot at gmail.com When running the OpenArena anholt benchmark on my Radeon HD 3870 (RV670, PCIe) on my 64-bit Kubuntu 10.10 system with kernel 2.6.37 rc1 or rc2, and libdrm, mesa, xorg-video-ati from git master, I often get a GPU lockup on the level loading screen. I can still log into the system through SSH and reboot it, but I cannot kill the openarena process. There is nothing in dmesg when the lockup occurs. There is no such issue with kernel 2.6.36 and the same versions of libdrm, mesa, xorg-video-ati. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31670] RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2
https://bugs.freedesktop.org/show_bug.cgi?id=31670 --- Comment #1 from Alain Perrot 2010-11-16 10:40:51 PST --- I forgot to tell that this is with KMS enabled and Gallium based r600g Mesa driver. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 31670] RV670 GPU lockup with OpenArena benchmark and kernel 2.6.37 rc1/rc2
https://bugs.freedesktop.org/show_bug.cgi?id=31670 --- Comment #2 from Alex Deucher 2010-11-16 10:49:22 PST --- Can you bisect to see which commit is problematic? -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[PATCH 0/3] embed drm_gem_object into radeon_bo
On Tue, Nov 16, 2010 at 6:30 PM, Daniel Vetter wrote: > On Tue, Nov 16, 2010 at 06:05:25PM +0100, Sedat Dilek wrote: >> I have tested both patchsets from Daniel (see [1] and [2]) again on a >> Radeon RV250 in a none-BKL-config and it looks like >> >> ? ? ? ?agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch >> >> is the culprit in combination with the below listed drm patches. > Likely a gem_bo->driver_private access. My patches set this to NULL to > catch conversion bugs. > -Daniel > -- > Daniel Vetter > Mail: daniel at ffwll.ch > Mobile: +41 (0)79 365 57 48 > [ CCing Alex Deucher ] With the attached diff to the original patch from [1], OpenArena works with pageflip-support for radeon-KMS. Unfortunately, there is a drop in fps from 18.5 down to 13.5. - Sedat - [1] http://people.freedesktop.org/~agd5f/pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch $ cd ~/src/linux-2.6/linux-2.6.37-rc2/debian/build/source_i386_none/ $ cat .pc/applied-patches danvet-drm-for-sedat-dilek/0001-drm-nouveau-don-t-munge-in-drm_mm-internals.patch danvet-drm-for-sedat-dilek/0002-drm_mm-add-support-for-range-restricted-fair-lru-sca.patch danvet-drm-for-sedat-dilek/0003-drm-mm-track-free-areas-implicitly.patch danvet-drm-for-sedat-dilek/0004-drm-mm-extract-node-insert-helper-functions.patch danvet-drm-for-sedat-dilek/0005-drm-mm-add-api-for-embedding-struct-drm_mm_node.patch danvet-drm-for-sedat-dilek/0006-drm-mm-add-helper-to-unwind-scan-state.patch danvet-embed-drm_gem_object-into-radeon_bo/1-3-drm-radeon-embed-struct-drm_gem_object.patch danvet-embed-drm_gem_object-into-radeon_bo/2-3-drm-radeon-introduce-gem_to_radeon_bo-helper.patch danvet-embed-drm_gem_object-into-radeon_bo/3-3-drm-radeon-kill-radeon_bo--gobj-pointer.patch drm-vblank-timestamping/0001-drm-vblank-Add-support-for-precise-vblank-timestampi.patch drm-vblank-timestamping/0002-drm-radeon-Add-support-for-precise-vblank-timestampi.patch for-drm-radeon-testing/drm-radeon-kms-enable-writeback-on-radeon-AGP-boards.patch agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support-for-danvet-v2.patch $ cd ~/src/mesa/ $ ./scripts/run_openarena-benchmark.sh 840 frames 62.6 seconds 13.4 fps 16.0/74.5/224.0/19.7 ms -- next part -- A non-text attachment was scrubbed... Name: agd5f-pflip.diff Type: text/x-diff Size: 840 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20101116/56496824/attachment.diff>
[PATCH 0/3] embed drm_gem_object into radeon_bo
On Tue, Nov 16, 2010 at 8:37 PM, Sedat Dilek wrote: > On Tue, Nov 16, 2010 at 6:30 PM, Daniel Vetter wrote: >> On Tue, Nov 16, 2010 at 06:05:25PM +0100, Sedat Dilek wrote: >>> I have tested both patchsets from Daniel (see [1] and [2]) again on a >>> Radeon RV250 in a none-BKL-config and it looks like >>> >>> ? ? ? ?agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch >>> >>> is the culprit in combination with the below listed drm patches. >> Likely a gem_bo->driver_private access. My patches set this to NULL to >> catch conversion bugs. >> -Daniel >> -- >> Daniel Vetter >> Mail: daniel at ffwll.ch >> Mobile: +41 (0)79 365 57 48 >> > > [ CCing Alex Deucher ] > > With the attached diff to the original patch from [1], OpenArena works > with pageflip-support for radeon-KMS. > Unfortunately, there is a drop in fps from 18.5 down to 13.5. > > - Sedat - > > [1] > http://people.freedesktop.org/~agd5f/pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch > > $ cd ~/src/linux-2.6/linux-2.6.37-rc2/debian/build/source_i386_none/ > > $ cat .pc/applied-patches > danvet-drm-for-sedat-dilek/0001-drm-nouveau-don-t-munge-in-drm_mm-internals.patch > danvet-drm-for-sedat-dilek/0002-drm_mm-add-support-for-range-restricted-fair-lru-sca.patch > danvet-drm-for-sedat-dilek/0003-drm-mm-track-free-areas-implicitly.patch > danvet-drm-for-sedat-dilek/0004-drm-mm-extract-node-insert-helper-functions.patch > danvet-drm-for-sedat-dilek/0005-drm-mm-add-api-for-embedding-struct-drm_mm_node.patch > danvet-drm-for-sedat-dilek/0006-drm-mm-add-helper-to-unwind-scan-state.patch > danvet-embed-drm_gem_object-into-radeon_bo/1-3-drm-radeon-embed-struct-drm_gem_object.patch > danvet-embed-drm_gem_object-into-radeon_bo/2-3-drm-radeon-introduce-gem_to_radeon_bo-helper.patch > danvet-embed-drm_gem_object-into-radeon_bo/3-3-drm-radeon-kill-radeon_bo--gobj-pointer.patch > drm-vblank-timestamping/0001-drm-vblank-Add-support-for-precise-vblank-timestampi.patch > drm-vblank-timestamping/0002-drm-radeon-Add-support-for-precise-vblank-timestampi.patch > for-drm-radeon-testing/drm-radeon-kms-enable-writeback-on-radeon-AGP-boards.patch > agd5f-pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support-for-danvet-v2.patch > > $ cd ~/src/mesa/ > > $ ./scripts/run_openarena-benchmark.sh > 840 frames 62.6 seconds 13.4 fps 16.0/74.5/224.0/19.7 ms > Attached are all the patches I used with quilt-series file and kernel-config. - Sedat - -- next part -- A non-text attachment was scrubbed... Name: for-danvet_patches.tar.xz Type: application/octet-stream Size: 39512 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20101116/4cb18f76/attachment-0004.obj> -- next part -- A non-text attachment was scrubbed... Name: for-danvet_patches.tar.xz.sha256sum Type: application/octet-stream Size: 91 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20101116/4cb18f76/attachment-0005.obj> -- next part -- A non-text attachment was scrubbed... Name: bkl-config.tar.xz Type: application/octet-stream Size: 40432 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20101116/4cb18f76/attachment-0006.obj> ------ next part -- A non-text attachment was scrubbed... Name: bkl-config.tar.xz.sha256sum Type: application/octet-stream Size: 83 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20101116/4cb18f76/attachment-0007.obj>
[PATCH] drm/radeon/kms: fix typo in r600 cs checker
Looks like a typo in: drm/radeon/r600: fix tiling issues in CS checker. (f30df2fad0c901e74ac9a52a488a54c69a373a41) Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/r600_cs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 0f90fc3..9bebac1 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -315,7 +315,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { /* the initial DDX does bad things with the CB size occasionally */ /* it rounds up height too far for slice tile max but the BO is smaller */ - tmp = (height - 7) * 8 * bpe; + tmp = (height - 7) * pitch * bpe; if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); return -EINVAL; -- 1.7.1.1
[PATCH v2 0/2] Fix nouveau-related freezes
On Wed, Nov 10, 2010 at 6:04 PM, Andy Lutomirski wrote: > Nouveau takes down my system quite reliably when any hotplug event occurs. > The bug happens because the IRQ handler didn't acknowledge the hotplug > state until the bottom half, so the card generated a new interrupt > immediately, starving the bottom half and permanently starving that CPU > (and hence the bottom half). > > Even with this fix, a lot of the IRQ code looks rather broken. > > This is tested on 2.6.36 (and makes the system stable for me), but it also > applies cleanly to 2.6.37 (untested, but surely also necessary). ?Fedora 14's > 2.6.35 kernels seem to have to same problem for me, so I suspect that 2.6.35 > needs this fix as well. ?(All of my tests are on an NV50 card.) > > Changes from v1: > ?- Ignore unrequested hotplug bits (I accidentally removed that part). > ?- Support newer hardware (untested -- Ben, can you check this?) Just a quick ping: is this making its way to Linus (and stable)? I've been running it for five days through (literally, due to monitor bugs) thousands of plug/unplug cycles with no ill effects. (Can we *please* get rid of, or at least ratelimit, the plugged/unplugged printk? It's taking over my logs, and I'm almost certain that it's not a driver bug.) --Andy
[Bug 28995] [r300g] dri rejects command buffers
https://bugs.freedesktop.org/show_bug.cgi?id=28995 --- Comment #21 from ?lmos 2010-11-16 15:19:40 PST --- I now tried with 2.6.36 and mesa git from nov 12. vdrift 2009 release with large textures on monaco: [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation -12! vdrift 2010 release with the same settings: OK sauerbraten with venice map: OK nexuiz with desertfactory map: [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation -12! doom3: I couldn't test, because since I increased GART from 64MB to 256MB, it segfaults immediately with: WARNING: vertex array range in virtual memory (SLOW) signal caught: Segmentation fault si_code 1 Trying to exit gracefully.. Meanwhile I found out what caused the hardlock: the preemption model was set to preemptible kernel, now with voluntary kernel preemption it seems to be stable. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[PATCH v3] nouveau: Acknowledge HPD irq in handler, not bottom half
The old code generated an interrupt storm bad enough to completely take down my system. Signed-off-by: Andy Lutomirski Cc: stable at kernel.org --- Changes from v2: Don't use (wrong) #define'd register names. drivers/gpu/drm/nouveau/nouveau_drv.h |6 + drivers/gpu/drm/nouveau/nouveau_irq.c |1 + drivers/gpu/drm/nouveau/nv50_display.c | 35 +++ 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index b1be617..c926d88 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -531,6 +531,12 @@ struct drm_nouveau_private { struct work_struct irq_work; struct work_struct hpd_work; + struct { + spinlock_t lock; + uint32_t hpd0_bits; + uint32_t hpd1_bits; + } hpd_state; + struct list_head vbl_waiting; struct { diff --git a/drivers/gpu/drm/nouveau/nouveau_irq.c b/drivers/gpu/drm/nouveau/nouveau_irq.c index 794b0ee..b62a601 100644 --- a/drivers/gpu/drm/nouveau/nouveau_irq.c +++ b/drivers/gpu/drm/nouveau/nouveau_irq.c @@ -52,6 +52,7 @@ nouveau_irq_preinstall(struct drm_device *dev) if (dev_priv->card_type >= NV_50) { INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh); INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh); + spin_lock_init(&dev_priv->hpd_state.lock); INIT_LIST_HEAD(&dev_priv->vbl_waiting); } } diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 612fa6d..d967cb6 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -1012,11 +1012,18 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) struct drm_connector *connector; const uint32_t gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 }; uint32_t unplug_mask, plug_mask, change_mask; - uint32_t hpd0, hpd1 = 0; + uint32_t hpd0, hpd1; - hpd0 = nv_rd32(dev, 0xe054) & nv_rd32(dev, 0xe050); + spin_lock_irq(&dev_priv->hpd_state.lock); + hpd0 = dev_priv->hpd_state.hpd0_bits; + dev_priv->hpd_state.hpd0_bits = 0; + hpd1 = dev_priv->hpd_state.hpd1_bits; + dev_priv->hpd_state.hpd1_bits = 0; + spin_unlock_irq(&dev_priv->hpd_state.lock); + + hpd0 &= nv_rd32(dev, 0xe050); if (dev_priv->chipset >= 0x90) - hpd1 = nv_rd32(dev, 0xe074) & nv_rd32(dev, 0xe070); + hpd1 &= nv_rd32(dev, 0xe070); plug_mask = (hpd0 & 0x) | (hpd1 << 16); unplug_mask = (hpd0 >> 16) | (hpd1 & 0x); @@ -1058,10 +1065,6 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) helper->dpms(connector->encoder, DRM_MODE_DPMS_OFF); } - nv_wr32(dev, 0xe054, nv_rd32(dev, 0xe054)); - if (dev_priv->chipset >= 0x90) - nv_wr32(dev, 0xe074, nv_rd32(dev, 0xe074)); - drm_helper_hpd_irq_event(dev); } @@ -1072,8 +1075,22 @@ nv50_display_irq_handler(struct drm_device *dev) uint32_t delayed = 0; if (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_HOTPLUG) { - if (!work_pending(&dev_priv->hpd_work)) - queue_work(dev_priv->wq, &dev_priv->hpd_work); + uint32_t hpd0_bits, hpd1_bits = 0; + + hpd0_bits = nv_rd32(dev, 0xe054); + nv_wr32(dev, 0xe054, hpd0_bits); + + if (dev_priv->chipset >= 0x90) { + hpd1_bits = nv_rd32(dev, 0xe074); + nv_wr32(dev, 0xe074, hpd1_bits); + } + + spin_lock(&dev_priv->hpd_state.lock); + dev_priv->hpd_state.hpd0_bits |= hpd0_bits; + dev_priv->hpd_state.hpd1_bits |= hpd1_bits; + spin_unlock(&dev_priv->hpd_state.lock); + + queue_work(dev_priv->wq, &dev_priv->hpd_work); } while (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_DISPLAY) { -- 1.7.3.2
[PATCH] drm/radeon/kms: properly power up/down the eDP panel as needed (v2)
The eDP panel must be powered up for aux transactions, so power it up for detect and mode probe functions, otherwise power it up or down based on dpms. v2: - only mess with eDP panel on DCE4+ - only mess with eDP panel on eDP connectors, not all DP connectors Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_connectors.c | 18 +++ drivers/gpu/drm/radeon/radeon_encoders.c | 44 drivers/gpu/drm/radeon/radeon_mode.h |2 + 3 files changed, 64 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe6c747..fd7341b 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1008,9 +1008,21 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector) static int radeon_dp_get_modes(struct drm_connector *connector) { struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; int ret; + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); + } ret = radeon_ddc_get_modes(radeon_connector); + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); + } + return ret; } @@ -1029,8 +1041,14 @@ radeon_dp_detect(struct drm_connector *connector, bool force) if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { /* eDP is always DP */ radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_ON); if (radeon_dp_getdpcd(radeon_connector)) ret = connector_status_connected; + if (!radeon_dig_connector->edp_on) + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANSMITTER_ACTION_POWER_OFF); } else { radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index d55cb58..ccd1cfe 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -978,6 +978,32 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } +void +atombios_set_edp_panel_power(struct radeon_connector *radeon_connector, int action) +{ + struct drm_device *dev = radeon_connector->base.dev; + struct radeon_device *rdev = dev->dev_private; + union dig_transmitter_control args; + int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); + uint8_t frev, crev; + + if (!ASIC_IS_DCE4(rdev)) + return; + + if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || + (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) + return; + + if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) + return; + + memset(&args, 0, sizeof(args)); + + args.v1.ucAction = action; + + atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); +} + static void atombios_yuv_setup(struct drm_encoder *encoder, bool enable) { @@ -1082,6 +1108,14 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = + radeon_connector->con_priv; + atombios_set_edp_panel_power(radeon_connector, + ATOM_TRANS