diff --git a/packages/linux/package.mk b/packages/linux/package.mk index c78f3ee10b..ecbc0ba91c 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -21,6 +21,7 @@ case "$LINUX" in PKG_SHA256="a2760fe89a15aa7be142fd25fb08ebd357c5d855c41f1612cf47c6e89de39bb3" PKG_URL="https://github.com/rockchip-linux/kernel/archive/$PKG_VERSION.tar.gz" PKG_SOURCE_NAME="linux-$LINUX-$PKG_VERSION.tar.gz" + PKG_BUILD_PERF="no" ;; raspberrypi) PKG_VERSION="1eb8d4d37ec7330414020773806497ccd23e0203" # 5.2.13 diff --git a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1005-rkmppdec-Kodi-need-more-buffers.patch b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1005-rkmppdec-Kodi-need-more-buffers.patch index 7ceafc1b73..6cb8ac9304 100644 --- a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1005-rkmppdec-Kodi-need-more-buffers.patch +++ b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1005-rkmppdec-Kodi-need-more-buffers.patch @@ -1,4 +1,4 @@ -From 9d00331a2ef4a06b9bdc84de78623384f2e2111e Mon Sep 17 00:00:00 2001 +From 39f9392e40cc6fb1492f51d2f2b4c87d1503ca39 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Fri, 31 Aug 2018 21:17:27 +0200 Subject: [PATCH] rkmppdec: Kodi need more buffers diff --git a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1006-rkmppdec-continue-on-errinfo-frame.patch b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1006-rkmppdec-continue-on-errinfo-frame.patch index 6ec8d84bd2..334b3a411d 100644 --- a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1006-rkmppdec-continue-on-errinfo-frame.patch +++ b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1006-rkmppdec-continue-on-errinfo-frame.patch @@ -1,4 +1,4 @@ -From 35e9805c3dfc636d1a3130411c5c210c091776ee Mon Sep 17 00:00:00 2001 +From ca3c0a0b70373da243949b7b72bbbf8bb47f01d5 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Sun, 9 Sep 2018 12:37:29 +0200 Subject: [PATCH] rkmppdec: continue on errinfo frame diff --git a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1007-rkmppdec-enable-mpeg2.patch b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1007-rkmppdec-enable-mpeg2.patch index eac963281d..81811bd5fd 100644 --- a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1007-rkmppdec-enable-mpeg2.patch +++ b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1007-rkmppdec-enable-mpeg2.patch @@ -1,4 +1,4 @@ -From 7ddf0485e54d624d11aaa0234e7bf4b9b8393ae3 Mon Sep 17 00:00:00 2001 +From 5062ff7504a92a144b32e20b6b4d5627240f81c8 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Wed, 12 Sep 2018 22:29:22 +0200 Subject: [PATCH] rkmppdec: enable mpeg2 @@ -11,10 +11,10 @@ Subject: [PATCH] rkmppdec: enable mpeg2 4 files changed, 11 insertions(+) diff --git a/configure b/configure -index 827abfe694..38492d3b33 100755 +index 15e6c321b1..c17252f883 100755 --- a/configure +++ b/configure -@@ -2932,6 +2932,7 @@ mpeg2_crystalhd_decoder_select="crystalhd" +@@ -2954,6 +2954,7 @@ mpeg2_crystalhd_decoder_select="crystalhd" mpeg2_cuvid_decoder_deps="cuvid" mpeg2_mmal_decoder_deps="mmal" mpeg2_mediacodec_decoder_deps="mediacodec" diff --git a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1010-rkmppdec-set-mastering-display-and-content-light-sid.patch b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1010-rkmppdec-set-mastering-display-and-content-light-sid.patch index 48b45b7fa8..db03683940 100644 --- a/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1010-rkmppdec-set-mastering-display-and-content-light-sid.patch +++ b/packages/multimedia/ffmpeg/patches/rkmpp/ffmpeg-99.1010-rkmppdec-set-mastering-display-and-content-light-sid.patch @@ -1,14 +1,14 @@ -From 1a02e726f50ae2ce007854ee473a9f69617e2947 Mon Sep 17 00:00:00 2001 +From 6d97fb902d7e69a9b706664223bf53ab3b2f9054 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Sat, 22 Jun 2019 16:08:25 +0000 Subject: [PATCH] rkmppdec: set mastering display and content light side data --- - libavcodec/rkmppdec.c | 62 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 62 insertions(+) + libavcodec/rkmppdec.c | 64 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 64 insertions(+) diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c -index 48016bc681..74938443df 100644 +index 48016bc681..faae23c064 100644 --- a/libavcodec/rkmppdec.c +++ b/libavcodec/rkmppdec.c @@ -35,6 +35,7 @@ @@ -19,11 +19,11 @@ index 48016bc681..74938443df 100644 #include "libavutil/imgutils.h" #include "libavutil/log.h" -@@ -319,6 +320,59 @@ static void rkmpp_release_frame(void *opaque, uint8_t *data) +@@ -319,6 +320,61 @@ static void rkmpp_release_frame(void *opaque, uint8_t *data) av_free(desc); } -+static void rkmpp_hevc_mastering_display(AVFrame *frame, MppFrameMasteringDisplayMetadata mastering_display) ++static int rkmpp_hevc_mastering_display(AVFrame *frame, MppFrameMasteringDisplayMetadata mastering_display) +{ + // HEVC uses a g,b,r ordering, which we convert to a more natural r,g,b + AVMasteringDisplayMetadata *metadata; @@ -58,9 +58,10 @@ index 48016bc681..74938443df 100644 + metadata->min_luminance.den = luma_den; + metadata->has_luminance = 1; + metadata->has_primaries = 1; ++ return 0; +} + -+static void rkmpp_hevc_content_light(AVFrame *frame, MppFrameContentLightMetadata content_light) ++static int rkmpp_hevc_content_light(AVFrame *frame, MppFrameContentLightMetadata content_light) +{ + AVContentLightMetadata *metadata; + @@ -74,12 +75,13 @@ index 48016bc681..74938443df 100644 + + metadata->MaxCLL = content_light.MaxCLL; + metadata->MaxFALL = content_light.MaxFALL; ++ return 0; +} + static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame) { RKMPPDecodeContext *rk_context = avctx->priv_data; -@@ -352,6 +406,11 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame) +@@ -352,6 +408,11 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame) avctx->width = mpp_frame_get_width(mppframe); avctx->height = mpp_frame_get_height(mppframe); @@ -91,7 +93,7 @@ index 48016bc681..74938443df 100644 decoder->mpi->control(decoder->ctx, MPP_DEC_SET_INFO_CHANGE_READY, NULL); av_buffer_unref(&decoder->frames_ref); -@@ -410,6 +469,9 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame) +@@ -410,6 +471,9 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame) MppFrameRational dar = mpp_frame_get_sar(mppframe); frame->sample_aspect_ratio = av_div_q((AVRational) { dar.num, dar.den }, (AVRational) { frame->width, frame->height }); diff --git a/packages/multimedia/rkmpp/package.mk b/packages/multimedia/rkmpp/package.mk index 6ea4459ec2..34f2c1dea6 100644 --- a/packages/multimedia/rkmpp/package.mk +++ b/packages/multimedia/rkmpp/package.mk @@ -2,8 +2,8 @@ # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) PKG_NAME="rkmpp" -PKG_VERSION="66b140eed828391994c04b8c53b1c1864c386576" -PKG_SHA256="ff1d31aa5cae7a694aee9711d2be4c8f73cc50734734c2131fc822223c29ad7e" +PKG_VERSION="451ae59386bbb8093a25defdca7a95f588c28706" +PKG_SHA256="b2f6478783caa8ffb9698b4207bae3a684fe861ba09cd371414fe26d41a3433e" PKG_ARCH="arm aarch64" PKG_LICENSE="APL" PKG_SITE="https://github.com/rockchip-linux/mpp" diff --git a/packages/multimedia/rkmpp/patches/rkmpp-0002-disable-unit-tests-by-default.patch b/packages/multimedia/rkmpp/patches/rkmpp-0001-disable-unit-tests-by-default.patch similarity index 94% rename from packages/multimedia/rkmpp/patches/rkmpp-0002-disable-unit-tests-by-default.patch rename to packages/multimedia/rkmpp/patches/rkmpp-0001-disable-unit-tests-by-default.patch index bbb26a9e92..e36acf7c1a 100644 --- a/packages/multimedia/rkmpp/patches/rkmpp-0002-disable-unit-tests-by-default.patch +++ b/packages/multimedia/rkmpp/patches/rkmpp-0001-disable-unit-tests-by-default.patch @@ -1,4 +1,4 @@ -From 9e8b370b826e662879fcec9193956ec59a7db331 Mon Sep 17 00:00:00 2001 +From ef687eaf87efff3efcb1897ca02be97e09bf292e Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Sun, 24 Jun 2018 11:07:44 +0200 Subject: [PATCH] disable unit tests by default diff --git a/packages/multimedia/rkmpp/patches/rkmpp-0004-m2vd-use-ctx-pts.patch b/packages/multimedia/rkmpp/patches/rkmpp-0002-m2vd-use-ctx-pts.patch similarity index 84% rename from packages/multimedia/rkmpp/patches/rkmpp-0004-m2vd-use-ctx-pts.patch rename to packages/multimedia/rkmpp/patches/rkmpp-0002-m2vd-use-ctx-pts.patch index 9ee09016d6..8fb413e45e 100644 --- a/packages/multimedia/rkmpp/patches/rkmpp-0004-m2vd-use-ctx-pts.patch +++ b/packages/multimedia/rkmpp/patches/rkmpp-0002-m2vd-use-ctx-pts.patch @@ -1,4 +1,4 @@ -From 087282d7d3fb5b5216acf7d10864ab2a42dd8473 Mon Sep 17 00:00:00 2001 +From 8f9bd9b08f67beded2a8498754e59deb5e4eeae1 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Thu, 1 Mar 2018 22:31:47 +0100 Subject: [PATCH] [m2vd]: use ctx pts @@ -8,10 +8,10 @@ Subject: [PATCH] [m2vd]: use ctx pts 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c -index 6a720d56..24372f85 100755 +index 903712c6..ce97cd9b 100755 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c -@@ -1151,7 +1151,7 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx) +@@ -1172,7 +1172,7 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx) mpp_frame_set_hor_stride(ctx->frame_cur->f, ctx->display_width); mpp_frame_set_ver_stride(ctx->frame_cur->f, ctx->display_height); mpp_frame_set_errinfo(ctx->frame_cur->f, 0); diff --git a/packages/multimedia/rkmpp/patches/rkmpp-0003-h264d-fix-mpp_buf_slot_get_prop-crash.patch b/packages/multimedia/rkmpp/patches/rkmpp-0003-h264d-fix-mpp_buf_slot_get_prop-crash.patch deleted file mode 100644 index c58e86188f..0000000000 --- a/packages/multimedia/rkmpp/patches/rkmpp-0003-h264d-fix-mpp_buf_slot_get_prop-crash.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 57a996a3c2ebf8991216c9084b476254e205c28c Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Fri, 7 Sep 2018 19:53:10 +0200 -Subject: [PATCH] [h264d]: fix mpp_buf_slot_get_prop crash - ---- - mpp/codec/dec/h264/h264d_init.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/mpp/codec/dec/h264/h264d_init.c b/mpp/codec/dec/h264/h264d_init.c -index cd17776c..acad2ea7 100644 ---- a/mpp/codec/dec/h264/h264d_init.c -+++ b/mpp/codec/dec/h264/h264d_init.c -@@ -1401,7 +1401,11 @@ static RK_U32 check_ref_dbp_err(H264_DecCtx_t *p_Dec, H264_RefPicInfo_t *pref, R - for (i = 0; i < MAX_REF_SIZE; i++) { - if (pref[i].valid) { - MppFrame mframe = NULL; -- RK_U32 slot_idx = p_Dec->dpb_info[pref[i].dpb_idx].slot_index; -+ RK_S32 slot_idx = p_Dec->dpb_info[pref[i].dpb_idx].slot_index; -+ if (slot_idx < 0) { -+ dpb_error_flag |= 1; -+ break; -+ } - mpp_buf_slot_get_prop(p_Dec->frame_slots, slot_idx, SLOT_FRAME_PTR, &mframe); - if (mframe) { - if (i < active_refs) { diff --git a/packages/multimedia/rkmpp/patches/rkmpp-0005-m2vd-export-aspect-ratio-information.patch b/packages/multimedia/rkmpp/patches/rkmpp-0005-m2vd-export-aspect-ratio-information.patch deleted file mode 100644 index d62d8f2a38..0000000000 --- a/packages/multimedia/rkmpp/patches/rkmpp-0005-m2vd-export-aspect-ratio-information.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 30476f13ad6fee7392993e848f2b89519521df39 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 15 Sep 2018 11:24:28 +0200 -Subject: [PATCH] [m2vd]: export aspect ratio information - ---- - inc/mpp_frame.h | 10 ++++++++++ - mpp/base/inc/mpp_frame_impl.h | 2 ++ - mpp/base/mpp_frame.cpp | 1 + - mpp/codec/dec/m2v/m2vd_parser.c | 22 ++++++++++++++++++++++ - 4 files changed, 35 insertions(+) - -diff --git a/inc/mpp_frame.h b/inc/mpp_frame.h -index 39763f37..fd1358d3 100644 ---- a/inc/mpp_frame.h -+++ b/inc/mpp_frame.h -@@ -189,6 +189,14 @@ typedef enum { - MPP_FMT_BUTT = MPP_FMT_COMPLEX_BUTT, - } MppFrameFormat; - -+/** -+ * Rational number (pair of numerator and denominator). -+ */ -+typedef struct MppFrameRational { -+ RK_S32 num; ///< Numerator -+ RK_S32 den; ///< Denominator -+} MppFrameRational; -+ - typedef enum { - MPP_FRAME_ERR_UNKNOW = 0x0001, - MPP_FRAME_ERR_UNSUPPORT = 0x0002, -@@ -266,6 +274,8 @@ MppFrameChromaLocation mpp_frame_get_chroma_location(const MppFrame frame); - void mpp_frame_set_chroma_location(MppFrame frame, MppFrameChromaLocation chroma_location); - MppFrameFormat mpp_frame_get_fmt(MppFrame frame); - void mpp_frame_set_fmt(MppFrame frame, MppFrameFormat fmt); -+MppFrameRational mpp_frame_get_sar(const MppFrame frame); -+void mpp_frame_set_sar(MppFrame frame, MppFrameRational sar); - - /* - * HDR parameter -diff --git a/mpp/base/inc/mpp_frame_impl.h b/mpp/base/inc/mpp_frame_impl.h -index 2b512fcb..30898a1a 100644 ---- a/mpp/base/inc/mpp_frame_impl.h -+++ b/mpp/base/inc/mpp_frame_impl.h -@@ -88,6 +88,8 @@ struct MppFrameImpl_t { - - MppFrameFormat fmt; - -+ MppFrameRational sar; -+ - /* - * buffer information - * NOTE: buf_size only access internally -diff --git a/mpp/base/mpp_frame.cpp b/mpp/base/mpp_frame.cpp -index 1452604a..b94d1622 100644 ---- a/mpp/base/mpp_frame.cpp -+++ b/mpp/base/mpp_frame.cpp -@@ -199,5 +199,6 @@ MPP_FRAME_ACCESSORS(MppFrameColorTransferCharacteristic, color_trc) - MPP_FRAME_ACCESSORS(MppFrameColorSpace, colorspace) - MPP_FRAME_ACCESSORS(MppFrameChromaLocation, chroma_location) - MPP_FRAME_ACCESSORS(MppFrameFormat, fmt) -+MPP_FRAME_ACCESSORS(MppFrameRational, sar) - MPP_FRAME_ACCESSORS(size_t, buf_size) - MPP_FRAME_ACCESSORS(RK_U32, errinfo) -diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c -index 619e4fb2..561c4acf 100755 ---- a/mpp/codec/dec/m2v/m2vd_parser.c -+++ b/mpp/codec/dec/m2v/m2vd_parser.c -@@ -82,6 +82,25 @@ static int frame_period_Table[16] = { - 1 - }; - -+static const MppFrameRational mpeg2_aspect[16] = { -+ {0,1}, -+ {1,1}, -+ {4,3}, -+ {16,9}, -+ {221,100}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+ {0,1}, -+}; -+ - static inline RK_S32 m2vd_get_readbits(BitReadCtx_t *bx) - { - return bx->used_bits; -@@ -1164,6 +1183,9 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx) - } - mpp_frame_set_mode(ctx->frame_cur->f, frametype); - -+ if (ctx->seq_head.aspect_ratio_information >= 0 && ctx->seq_head.aspect_ratio_information < 16) -+ mpp_frame_set_sar(ctx->frame_cur->f, mpeg2_aspect[ctx->seq_head.aspect_ratio_information]); -+ - mpp_buf_slot_get_unused(ctx->frame_slots, &ctx->frame_cur->slot_index); - mpp_buf_slot_set_prop(ctx->frame_slots, ctx->frame_cur->slot_index, SLOT_FRAME, ctx->frame_cur->f); - mpp_buf_slot_set_flag(ctx->frame_slots, ctx->frame_cur->slot_index, SLOT_CODEC_USE); diff --git a/packages/multimedia/rkmpp/patches/rkmpp-0006-h265d-fix-color-range-and-colorspace-metadata.patch b/packages/multimedia/rkmpp/patches/rkmpp-0006-h265d-fix-color-range-and-colorspace-metadata.patch deleted file mode 100644 index 9ef69cad12..0000000000 --- a/packages/multimedia/rkmpp/patches/rkmpp-0006-h265d-fix-color-range-and-colorspace-metadata.patch +++ /dev/null @@ -1,52 +0,0 @@ -From f85d62a7d99f3da1d86ac57f94fa58c885ee5476 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 22 Jun 2019 13:42:08 +0000 -Subject: [PATCH] [h265d]: fix color range and colorspace metadata - ---- - inc/mpp_frame.h | 2 ++ - mpp/codec/dec/h265/h265d_codec.h | 2 ++ - mpp/codec/dec/h265/h265d_refs.c | 2 ++ - 3 files changed, 6 insertions(+) - -diff --git a/inc/mpp_frame.h b/inc/mpp_frame.h -index fd1358d3..33a6e644 100644 ---- a/inc/mpp_frame.h -+++ b/inc/mpp_frame.h -@@ -68,6 +68,8 @@ typedef enum { - MPP_FRAME_PRI_FILM = 8, ///< colour filters using Illuminant C - MPP_FRAME_PRI_BT2020 = 9, ///< ITU-R BT2020 - MPP_FRAME_PRI_SMPTEST428_1 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ) -+ MPP_FRAME_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) / DCI P3 -+ MPP_FRAME_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3 - MPP_FRAME_PRI_NB, ///< Not part of ABI - } MppFrameColorPrimaries; - -diff --git a/mpp/codec/dec/h265/h265d_codec.h b/mpp/codec/dec/h265/h265d_codec.h -index 49804f7c..3fdddbfc 100644 ---- a/mpp/codec/dec/h265/h265d_codec.h -+++ b/mpp/codec/dec/h265/h265d_codec.h -@@ -39,6 +39,8 @@ enum MppColorSpace { - MPPCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - MPPCOL_SPC_SMPTE240M = 7, - MPPCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 -+ MPPCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system -+ MPPCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - MPPCOL_SPC_NB , ///< Not part of ABI - }; - -diff --git a/mpp/codec/dec/h265/h265d_refs.c b/mpp/codec/dec/h265/h265d_refs.c -index 504a90c4..80905d98 100644 ---- a/mpp/codec/dec/h265/h265d_refs.c -+++ b/mpp/codec/dec/h265/h265d_refs.c -@@ -91,8 +91,10 @@ static HEVCFrame *alloc_frame(HEVCContext *s) - mpp_frame_set_errinfo(frame->frame, 0); - mpp_frame_set_pts(frame->frame, s->pts); - mpp_frame_set_poc(frame->frame, s->poc); -+ mpp_frame_set_color_range(frame->frame, s->h265dctx->color_range); - mpp_frame_set_color_primaries(frame->frame, s->sps->vui.colour_primaries); - mpp_frame_set_color_trc(frame->frame, s->sps->vui.transfer_characteristic); -+ mpp_frame_set_colorspace(frame->frame, s->h265dctx->colorspace); - h265d_dbg(H265D_DBG_GLOBAL, "w_stride %d h_stride %d\n", s->h265dctx->coded_width, s->h265dctx->coded_height); - ret = mpp_buf_slot_get_unused(s->slots, &frame->slot_index); - mpp_assert(ret == MPP_OK); diff --git a/packages/multimedia/rkmpp/patches/rkmpp-0007-h265d-export-mastering-display-and-content-light-met.patch b/packages/multimedia/rkmpp/patches/rkmpp-0007-h265d-export-mastering-display-and-content-light-met.patch deleted file mode 100644 index f8f0eb096d..0000000000 --- a/packages/multimedia/rkmpp/patches/rkmpp-0007-h265d-export-mastering-display-and-content-light-met.patch +++ /dev/null @@ -1,152 +0,0 @@ -From 30ac9fb8b0568f549229e3f8b907b49ef2ce29fe Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 22 Jun 2019 13:44:05 +0000 -Subject: [PATCH] [h265d]: export mastering display and content light metadata - ---- - inc/mpp_frame.h | 16 ++++++++++++++++ - mpp/base/inc/mpp_frame_impl.h | 2 ++ - mpp/base/mpp_frame.cpp | 2 ++ - mpp/codec/dec/h265/h265d_parser.h | 3 +++ - mpp/codec/dec/h265/h265d_refs.c | 2 ++ - mpp/codec/dec/h265/h265d_sei.c | 21 +++++++++++++++++++++ - 6 files changed, 46 insertions(+) - -diff --git a/inc/mpp_frame.h b/inc/mpp_frame.h -index 33a6e644..a2a4cf81 100644 ---- a/inc/mpp_frame.h -+++ b/inc/mpp_frame.h -@@ -199,6 +199,18 @@ typedef struct MppFrameRational { - RK_S32 den; ///< Denominator - } MppFrameRational; - -+typedef struct MppFrameMasteringDisplayMetadata { -+ RK_U16 display_primaries[3][2]; -+ RK_U16 white_point[2]; -+ RK_U32 max_luminance; -+ RK_U32 min_luminance; -+} MppFrameMasteringDisplayMetadata; -+ -+typedef struct MppFrameContentLightMetadata { -+ RK_U16 MaxCLL; -+ RK_U16 MaxFALL; -+} MppFrameContentLightMetadata; -+ - typedef enum { - MPP_FRAME_ERR_UNKNOW = 0x0001, - MPP_FRAME_ERR_UNSUPPORT = 0x0002, -@@ -278,6 +290,10 @@ MppFrameFormat mpp_frame_get_fmt(MppFrame frame); - void mpp_frame_set_fmt(MppFrame frame, MppFrameFormat fmt); - MppFrameRational mpp_frame_get_sar(const MppFrame frame); - void mpp_frame_set_sar(MppFrame frame, MppFrameRational sar); -+MppFrameMasteringDisplayMetadata mpp_frame_get_mastering_display(const MppFrame frame); -+void mpp_frame_set_mastering_display(MppFrame frame, MppFrameMasteringDisplayMetadata mastering_display); -+MppFrameContentLightMetadata mpp_frame_get_content_light(const MppFrame frame); -+void mpp_frame_set_content_light(MppFrame frame, MppFrameContentLightMetadata content_light); - - /* - * HDR parameter -diff --git a/mpp/base/inc/mpp_frame_impl.h b/mpp/base/inc/mpp_frame_impl.h -index 30898a1a..a5433888 100644 ---- a/mpp/base/inc/mpp_frame_impl.h -+++ b/mpp/base/inc/mpp_frame_impl.h -@@ -89,6 +89,8 @@ struct MppFrameImpl_t { - MppFrameFormat fmt; - - MppFrameRational sar; -+ MppFrameMasteringDisplayMetadata mastering_display; -+ MppFrameContentLightMetadata content_light; - - /* - * buffer information -diff --git a/mpp/base/mpp_frame.cpp b/mpp/base/mpp_frame.cpp -index b94d1622..d58786c9 100644 ---- a/mpp/base/mpp_frame.cpp -+++ b/mpp/base/mpp_frame.cpp -@@ -200,5 +200,7 @@ MPP_FRAME_ACCESSORS(MppFrameColorSpace, colorspace) - MPP_FRAME_ACCESSORS(MppFrameChromaLocation, chroma_location) - MPP_FRAME_ACCESSORS(MppFrameFormat, fmt) - MPP_FRAME_ACCESSORS(MppFrameRational, sar) -+MPP_FRAME_ACCESSORS(MppFrameMasteringDisplayMetadata, mastering_display) -+MPP_FRAME_ACCESSORS(MppFrameContentLightMetadata, content_light) - MPP_FRAME_ACCESSORS(size_t, buf_size) - MPP_FRAME_ACCESSORS(RK_U32, errinfo) -diff --git a/mpp/codec/dec/h265/h265d_parser.h b/mpp/codec/dec/h265/h265d_parser.h -index bf42eb97..3b1264fa 100644 ---- a/mpp/codec/dec/h265/h265d_parser.h -+++ b/mpp/codec/dec/h265/h265d_parser.h -@@ -678,6 +678,9 @@ typedef struct HEVCContext { - RK_U32 got_frame; - RK_U32 extra_has_frame; - -+ MppFrameMasteringDisplayMetadata mastering_display; -+ MppFrameContentLightMetadata content_light; -+ - MppBufSlots slots; - - MppBufSlots packet_slots; -diff --git a/mpp/codec/dec/h265/h265d_refs.c b/mpp/codec/dec/h265/h265d_refs.c -index 80905d98..8d5092a5 100644 ---- a/mpp/codec/dec/h265/h265d_refs.c -+++ b/mpp/codec/dec/h265/h265d_refs.c -@@ -95,6 +95,8 @@ static HEVCFrame *alloc_frame(HEVCContext *s) - mpp_frame_set_color_primaries(frame->frame, s->sps->vui.colour_primaries); - mpp_frame_set_color_trc(frame->frame, s->sps->vui.transfer_characteristic); - mpp_frame_set_colorspace(frame->frame, s->h265dctx->colorspace); -+ mpp_frame_set_mastering_display(frame->frame, s->mastering_display); -+ mpp_frame_set_content_light(frame->frame, s->content_light); - h265d_dbg(H265D_DBG_GLOBAL, "w_stride %d h_stride %d\n", s->h265dctx->coded_width, s->h265dctx->coded_height); - ret = mpp_buf_slot_get_unused(s->slots, &frame->slot_index); - mpp_assert(ret == MPP_OK); -diff --git a/mpp/codec/dec/h265/h265d_sei.c b/mpp/codec/dec/h265/h265d_sei.c -index 4706b922..86beb428 100644 ---- a/mpp/codec/dec/h265/h265d_sei.c -+++ b/mpp/codec/dec/h265/h265d_sei.c -@@ -154,12 +154,18 @@ static RK_S32 mastering_display_colour_volume(HEVCContext *s) - BitReadCtx_t *gb = &s->HEVClc->gb; - for (i = 0; i < 3; i++) { - READ_BITS(gb, 16, &value); -+ s->mastering_display.display_primaries[i][0] = value; - READ_BITS(gb, 16, &value); -+ s->mastering_display.display_primaries[i][1] = value; - } - READ_BITS(gb, 16, &value); -+ s->mastering_display.white_point[0] = value; - READ_BITS(gb, 16, &value); -+ s->mastering_display.white_point[1] = value; - mpp_read_longbits(gb, 32, &lum); -+ s->mastering_display.max_luminance = lum; - mpp_read_longbits(gb, 32, &lum); -+ s->mastering_display.min_luminance = lum; - - return 0; - -@@ -167,6 +173,17 @@ __BITREAD_ERR: - return MPP_ERR_STREAM; - } - -+static RK_S32 content_light_info(HEVCContext *s) -+{ -+ RK_U32 value = 0; -+ BitReadCtx_t *gb = &s->HEVClc->gb; -+ mpp_read_longbits(gb, 16, &value); -+ s->content_light.MaxCLL = value; -+ mpp_read_longbits(gb, 16, &value); -+ s->content_light.MaxFALL = value; -+ return 0; -+} -+ - static RK_S32 colour_remapping_info(HEVCContext *s) - { - RK_U32 i = 0, j = 0; -@@ -344,6 +361,10 @@ static RK_S32 decode_nal_sei_message(HEVCContext *s) - h265d_dbg(H265D_DBG_SEI, "mastering_display_colour_volume in\n"); - mastering_display_colour_volume(s); - return 1; -+ } else if (payload_type == 144) { -+ h265d_dbg(H265D_DBG_SEI, "content_light_info in\n"); -+ content_light_info(s); -+ return 1; - } else if (payload_type == 143) { - h265d_dbg(H265D_DBG_SEI, "colour_remapping_info in\n"); - colour_remapping_info(s); diff --git a/packages/tools/u-boot/patches/rockchip/u-boot-0012-Revert-Makefile-enable-Werror-option.patch b/packages/tools/u-boot/patches/rockchip/u-boot-0012-Revert-Makefile-enable-Werror-option.patch new file mode 100644 index 0000000000..e0d40ea793 --- /dev/null +++ b/packages/tools/u-boot/patches/rockchip/u-boot-0012-Revert-Makefile-enable-Werror-option.patch @@ -0,0 +1,23 @@ +From 45be7edd81e458ca90985a0c687e769aa9ebaf5b Mon Sep 17 00:00:00 2001 +From: Jonas Karlman +Date: Mon, 9 Sep 2019 05:59:12 +0000 +Subject: [PATCH] Revert "Makefile: enable -Werror option" + +This reverts commit 76ba1d8a713bc964fc8e0a639f90344c4c60f026. +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index f81ac1f9f9..fe2a57fa58 100644 +--- a/Makefile ++++ b/Makefile +@@ -360,7 +360,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__ + KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ + -Wno-format-security \ + -fno-builtin -ffreestanding +-KBUILD_CFLAGS += -fshort-wchar -Werror ++KBUILD_CFLAGS += -fshort-wchar + KBUILD_AFLAGS := -D__ASSEMBLY__ + + # Read UBOOTRELEASE from include/config/uboot.release (if it exists) diff --git a/packages/tools/u-boot/patches/rockchip/u-boot-0013-Makefile-adopt-std-gnu11-for-HOSTCFLAGS-on-Linux.patch b/packages/tools/u-boot/patches/rockchip/u-boot-0013-Makefile-adopt-std-gnu11-for-HOSTCFLAGS-on-Linux.patch new file mode 100644 index 0000000000..3adb58eacb --- /dev/null +++ b/packages/tools/u-boot/patches/rockchip/u-boot-0013-Makefile-adopt-std-gnu11-for-HOSTCFLAGS-on-Linux.patch @@ -0,0 +1,48 @@ +From 4270dca0656b872ac44dc860151bba76c257cfe2 Mon Sep 17 00:00:00 2001 +From: Philipp Tomsich +Date: Mon, 14 May 2018 15:22:06 +0200 +Subject: [PATCH] Makefile: adopt --std=gnu11 for HOSTCFLAGS on Linux + +Following the conversion of the SPDX license tags, a number of files +compiled with -pedantic now generate warnings similar to the following +for using C99-style '//' comments in ISO C90 code: + + tools/gen_eth_addr.c:1:1: warning: C++ style comments are not allowed in ISO C90 + // SPDX-License-Identifier: GPL-2.0+ + ^ + +The SPDX comment-style change means that these files have adopted C99, +so need to change the language-standard to --std=gnu99 or --std=gnu11 +to let the compiler know this. + +As we now require GCC 6 or newer for the cross-compiler, the project has +implicitly moved the project to GNU11: let older GCC versions on various +Linux distros know to treat our host tools as GNU11 as well. + +References: commit 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style") +Signed-off-by: Philipp Tomsich +Reviewed-by: Tom Rini +--- + Makefile | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/Makefile b/Makefile +index fe2a57fa58..484a1eb01d 100644 +--- a/Makefile ++++ b/Makefile +@@ -260,6 +260,15 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ + $(if $(CONFIG_TOOLS_DEBUG),-g) + HOSTCXXFLAGS = -O2 + ++# With the move to GCC 6, we have implicitly upgraded our language ++# standard to GNU11 (see https://gcc.gnu.org/gcc-5/porting_to.html). ++# Some Linux distributions (including RHEL7, SLES13, Debian 8) still ++# have older compilers as their default, so we make it explicit for ++# these that our host tools are GNU11 (i.e. C11 w/ GNU extensions). ++ifeq ($(HOSTOS),linux) ++HOSTCFLAGS += --std=gnu11 ++endif ++ + ifeq ($(HOSTOS),cygwin) + HOSTCFLAGS += -ansi + endif diff --git a/packages/tools/u-boot/patches/rockchip/u-boot-0014-Makefile-Ensure-we-build-with-std-gnu11.patch b/packages/tools/u-boot/patches/rockchip/u-boot-0014-Makefile-Ensure-we-build-with-std-gnu11.patch new file mode 100644 index 0000000000..54f082bb62 --- /dev/null +++ b/packages/tools/u-boot/patches/rockchip/u-boot-0014-Makefile-Ensure-we-build-with-std-gnu11.patch @@ -0,0 +1,41 @@ +From 7fcf14b5dafa574cb9f565afebc8428c50f0be02 Mon Sep 17 00:00:00 2001 +From: Tom Rini +Date: Tue, 19 Jun 2018 23:53:54 -0400 +Subject: [PATCH] Makefile: Ensure we build with -std=gnu11 + +As many targets are now commonly built with gcc-6 or later (which +defaults to a newer C standard than older compilers), certain C +constructs are now being used as they produce more readable code. And +while all compilers that we support building with support the C11 +standard (and GNU11) they do not default to that standard. Ensure that +we pass along -std=gnu11 when building. + +Signed-off-by: Tom Rini +--- + Makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 484a1eb01d..752bff499e 100644 +--- a/Makefile ++++ b/Makefile +@@ -265,8 +265,9 @@ HOSTCXXFLAGS = -O2 + # Some Linux distributions (including RHEL7, SLES13, Debian 8) still + # have older compilers as their default, so we make it explicit for + # these that our host tools are GNU11 (i.e. C11 w/ GNU extensions). ++CSTD_FLAG := -std=gnu11 + ifeq ($(HOSTOS),linux) +-HOSTCFLAGS += --std=gnu11 ++HOSTCFLAGS += $(CSTD_FLAG) + endif + + ifeq ($(HOSTOS),cygwin) +@@ -368,7 +369,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__ + + KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ + -Wno-format-security \ +- -fno-builtin -ffreestanding ++ -fno-builtin -ffreestanding $(CSTD_FLAG) + KBUILD_CFLAGS += -fshort-wchar + KBUILD_AFLAGS := -D__ASSEMBLY__ + diff --git a/packages/tools/u-boot/patches/rockchip/u-boot-0015-Makefile-Use-fno-strict-aliasing-globally.patch b/packages/tools/u-boot/patches/rockchip/u-boot-0015-Makefile-Use-fno-strict-aliasing-globally.patch new file mode 100644 index 0000000000..e4b8243db1 --- /dev/null +++ b/packages/tools/u-boot/patches/rockchip/u-boot-0015-Makefile-Use-fno-strict-aliasing-globally.patch @@ -0,0 +1,45 @@ +From dcee38742d6376e3fec6e5997077c681d28d1656 Mon Sep 17 00:00:00 2001 +From: Bin Meng +Date: Sun, 16 Sep 2018 22:35:28 -0700 +Subject: [PATCH] Makefile: Use -fno-strict-aliasing globally + +The -fstrict-aliasing option is implicitly enabled at levels -O2, +-O3, -Os by GCC. This option allows the compiler to assume the +strictest aliasing rules applicable to the language being compiled. +For example, the practice of reading from a different union member +than the one most recently written to (called "type-punning") is +common. In this case, "type-punning" only works if the memory is +accessed through the union type, but might not work by taking the +address, casting the resulting pointer and dereferencing the result, +which is an undefined behavior per the "strict aliasing rules". + +GCC's -Wstrict-aliasing (included in -Wall) option does not catch +all cases, but does attempt to catch the more common pitfalls. So +there are cases that GCC does not report but the codes are violating +the "strict aliasing rules". + +Given lots of codes that may be written to rely on "type-punning", +and Linux kernel disables it by -fno-strict-aliasing globally, since +U-Boot currently does this on nds32/riscv/x86 builds only, extend +this for all architecture builds. + +Signed-off-by: Bin Meng +Reviewed-by: Tom Rini +Reviewed-by: Simon Glass +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 752bff499e..14cf1fae33 100644 +--- a/Makefile ++++ b/Makefile +@@ -370,7 +370,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__ + KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ + -Wno-format-security \ + -fno-builtin -ffreestanding $(CSTD_FLAG) +-KBUILD_CFLAGS += -fshort-wchar ++KBUILD_CFLAGS += -fshort-wchar -fno-strict-aliasing + KBUILD_AFLAGS := -D__ASSEMBLY__ + + # Read UBOOTRELEASE from include/config/uboot.release (if it exists) diff --git a/projects/Rockchip/options b/projects/Rockchip/options index 0fb8ed360e..4fae6a94fc 100644 --- a/projects/Rockchip/options +++ b/projects/Rockchip/options @@ -20,7 +20,7 @@ PROJECT_CFLAGS="" # SquashFS compression method (gzip / lzo / xz / zstd) - SQUASHFS_COMPRESSION="zstd" + SQUASHFS_COMPRESSION="lzo" ################################################################################ # setup project defaults