From 5b93b4477e61e42e4f5cc9a938bf8b1f06145d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 22 Mar 2012 01:20:06 +0100 Subject: [PATCH 1/3] ffmpeg: updated gcc2 package and fixed crashes on exit. * replaced calls to free() with calls to av_free(). * updated gcc2 package to disable SSE and a few options like we had before with 0.6. --- build/jam/OptionalBuildFeatures | 2 +- src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp | 6 +++--- src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index 8c6a5ad65a..40727bc37a 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -222,7 +222,7 @@ if $(TARGET_ARCH) = x86 { HAIKU_LIBOGG_FILE = libogg-1.3.0-x86-gcc4-2012-03-12.zip ; HAIKU_LIBVPX_FILE = libvpx-1.0.0-x86-gcc4-2012-03-14.zip ; } else { - HAIKU_FFMPEG_FILE = ffmpeg-0.10-x86-gcc2-2012-03-19.zip ; + HAIKU_FFMPEG_FILE = ffmpeg-0.10-x86-gcc2-2012-03-22.zip ; HAIKU_SPEEX_FILE = speex-1.2rc1-x86-gcc2-2012-03-11.zip ; HAIKU_LIBTHEORA_FILE = libtheora-1.1.1-x86-gcc2-2012-03-11.zip ; HAIKU_LIBVORBIS_FILE = libvorbis-1.3.2-x86-gcc2-2012-03-11.zip ; diff --git a/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp b/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp index eebc583b82..9a1e0d3b9e 100644 --- a/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp +++ b/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp @@ -127,9 +127,9 @@ AVCodecDecoder::~AVCodecDecoder() if (fCodecInitDone) avcodec_close(fContext); - free(fOutputPicture); - free(fInputPicture); - free(fContext); + av_free(fOutputPicture); + av_free(fInputPicture); + av_free(fContext); #if USE_SWS_FOR_COLOR_SPACE_CONVERSION if (fSwsContext != NULL) diff --git a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp index 42804be611..58b26cc946 100644 --- a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp +++ b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp @@ -106,10 +106,10 @@ AVCodecEncoder::~AVCodecEncoder() fFrame->linesize[1] = 0; fFrame->linesize[2] = 0; fFrame->linesize[3] = 0; - free(fFrame); + av_free(fFrame); } - free(fOwnContext); + av_free(fOwnContext); delete[] fChunkBuffer; } From bc83207890507317e98cc18b61e075fc78d9379f Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 22 Mar 2012 08:37:00 -0500 Subject: [PATCH 2/3] radeon_hd: Add new VCE encoder defines * Internal encoder introduced for HD 7xxx * si_tn [PATCH 02/48] --- src/add-ons/accelerants/radeon_hd/atombios/ObjectID.h | 5 +++++ src/add-ons/accelerants/radeon_hd/encoder.cpp | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/add-ons/accelerants/radeon_hd/atombios/ObjectID.h b/src/add-ons/accelerants/radeon_hd/atombios/ObjectID.h index c61c3fe9fb..8ec594ced7 100644 --- a/src/add-ons/accelerants/radeon_hd/atombios/ObjectID.h +++ b/src/add-ons/accelerants/radeon_hd/atombios/ObjectID.h @@ -85,6 +85,7 @@ #define ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA 0x1F #define ENCODER_OBJECT_ID_INTERNAL_UNIPHY1 0x20 #define ENCODER_OBJECT_ID_INTERNAL_UNIPHY2 0x21 +#define ENCODER_OBJECT_ID_INTERNAL_VCE 0x24 #define ENCODER_OBJECT_ID_GENERAL_EXTERNAL_DVO 0xFF @@ -387,6 +388,10 @@ GRAPH_OBJECT_ENUM_ID1 << ENUM_ID_SHIFT |\ ENCODER_OBJECT_ID_NUTMEG << OBJECT_ID_SHIFT) +#define ENCODER_VCE_ENUM_ID1 ( GRAPH_OBHECT_TYPE_ENCODER << OBJECT_TYPE_SHIFT |\ + GRAPH_OBJECT_ENUM_ID1 << ENUM_ID_SHIFT |\ + ENCODER_OBJECT_ID_INTERNAL_VCE << OBJECT_ID_SHIFT) + /****************************************************/ /* Connector Object ID definition - Shared with BIOS */ /****************************************************/ diff --git a/src/add-ons/accelerants/radeon_hd/encoder.cpp b/src/add-ons/accelerants/radeon_hd/encoder.cpp index f5215a60d1..fc2496107c 100644 --- a/src/add-ons/accelerants/radeon_hd/encoder.cpp +++ b/src/add-ons/accelerants/radeon_hd/encoder.cpp @@ -1773,7 +1773,7 @@ encoder_output_lock(bool lock) } -static const char* encoder_name_matrix[36] = { +static const char* encoder_name_matrix[37] = { "NONE", "Internal Radeon LVDS", "Internal Radeon TMDS1", @@ -1809,7 +1809,8 @@ static const char* encoder_name_matrix[36] = { "Internal Kaleidoscope UNIPHY1", "Internal Kaleidoscope UNIPHY2", "External Travis Bridge", - "External Nutmeg Bridge" + "External Nutmeg Bridge", + "Internal Kaleidoscope VCE" }; From 41cf61d1c97e9a7cb626ec447df029db00c87690 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 22 Mar 2012 11:48:51 -0500 Subject: [PATCH 3/3] radeon_hd: Don't call TV encoder control improperly * TV encoder was dropped on DCE5+ * (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT) will improperly match DFP4 (0x2 | 0x8) = 0xA * Bug reported to linux kernel driver --- src/add-ons/accelerants/radeon_hd/connector.cpp | 4 ++-- src/add-ons/accelerants/radeon_hd/encoder.cpp | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/add-ons/accelerants/radeon_hd/connector.cpp b/src/add-ons/accelerants/radeon_hd/connector.cpp index d5b307e44d..829bbf83ff 100644 --- a/src/add-ons/accelerants/radeon_hd/connector.cpp +++ b/src/add-ons/accelerants/radeon_hd/connector.cpp @@ -674,8 +674,8 @@ connector_probe() } // Set up information buses such as ddc - if ((connectorFlags - & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) == 0) { + if (((connectorFlags & ATOM_DEVICE_TV_SUPPORT) == 0) + && (connectorFlags & ATOM_DEVICE_CV_SUPPORT) == 0) { for (j = 0; j < connectorObject->ucNumberOfObjects; j++) { if (B_LENDIAN_TO_HOST_INT16(path->usConnObjectId) == B_LENDIAN_TO_HOST_INT16( diff --git a/src/add-ons/accelerants/radeon_hd/encoder.cpp b/src/add-ons/accelerants/radeon_hd/encoder.cpp index fc2496107c..e4ccc02eb0 100644 --- a/src/add-ons/accelerants/radeon_hd/encoder.cpp +++ b/src/add-ons/accelerants/radeon_hd/encoder.cpp @@ -295,11 +295,14 @@ encoder_mode_set(uint8 id, uint32 pixelClock) case ENCODER_OBJECT_ID_INTERNAL_DAC2: case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: encoder_analog_setup(connectorIndex, pixelClock, ATOM_ENABLE); - if ((encoderFlags - & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) != 0) { - encoder_tv_setup(connectorIndex, pixelClock, ATOM_ENABLE); - } else { - encoder_tv_setup(connectorIndex, pixelClock, ATOM_DISABLE); + if (info.dceMajor < 5) { + // TV encoder was dropped in DCE 5 + if ((encoderFlags & ATOM_DEVICE_TV_SUPPORT != 0) + || (encoderFlags & ATOM_DEVICE_CV_SUPPORT) != 0) { + encoder_tv_setup(connectorIndex, pixelClock, ATOM_ENABLE); + } else { + encoder_tv_setup(connectorIndex, pixelClock, ATOM_DISABLE); + } } break; case ENCODER_OBJECT_ID_INTERNAL_TMDS1: