Skip to content

Commit

Permalink
Revert "fix: fix shadps4-emu#1457 again by moving av_err2str to a com…
Browse files Browse the repository at this point in the history
…mon header (shadps4-emu#1688)"

This reverts commit dad5953.

Revert "hot-fix: Allow unpriviledged userfaultfd"

This reverts commit 8ee672f.

Revert "shader_recompiler: Fix mistake"

This reverts commit cde84e4.
  • Loading branch information
Xcedf committed Dec 9, 2024
1 parent 9701bc7 commit a39b135
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 27 deletions.
17 changes: 0 additions & 17 deletions src/common/support/avdec.h

This file was deleted.

2 changes: 0 additions & 2 deletions src/core/libraries/ajm/ajm_mp3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ extern "C" {
#include <libswresample/swresample.h>
}

#include "common/support/avdec.h"

namespace Libraries::Ajm {

// Following tables have been reversed from AJM library
Expand Down
11 changes: 10 additions & 1 deletion src/core/libraries/avplayer/avplayer_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ extern "C" {
#include <libswscale/swscale.h>
}

#include "common/support/avdec.h"
// The av_err2str macro in libavutil/error.h does not play nice with C++
#ifdef av_err2str
#undef av_err2str
#include <string>
av_always_inline std::string av_err2string(int errnum) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
return av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum);
}
#define av_err2str(err) av_err2string(err).c_str()
#endif // av_err2str

namespace Libraries::AvPlayer {

Expand Down
11 changes: 10 additions & 1 deletion src/core/libraries/videodec/videodec2_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
#include "common/logging/log.h"
#include "core/libraries/videodec/videodec_error.h"

#include "common/support/avdec.h"
// The av_err2str macro in libavutil/error.h does not play nice with C++
#ifdef av_err2str
#undef av_err2str
#include <string>
av_always_inline std::string av_err2string(int errnum) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
return av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum);
}
#define av_err2str(err) av_err2string(err).c_str()
#endif // av_err2str

namespace Libraries::Vdec2 {

Expand Down
11 changes: 10 additions & 1 deletion src/core/libraries/videodec/videodec_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@
#include "common/logging/log.h"
#include "core/libraries/videodec/videodec_error.h"

#include "common/support/avdec.h"
// The av_err2str macro in libavutil/error.h does not play nice with C++
#ifdef av_err2str
#undef av_err2str
#include <string>
av_always_inline std::string av_err2string(int errnum) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
return av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum);
}
#define av_err2str(err) av_err2string(err).c_str()
#endif // av_err2str

namespace Libraries::Videodec {

Expand Down
6 changes: 3 additions & 3 deletions src/shader_recompiler/frontend/translate/scalar_alu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ void Translator::EmitScalarAlu(const GcnInst& inst) {
return S_BREV_B32(inst);
case Opcode::S_BCNT1_I32_B64:
return S_BCNT1_I32_B64(inst);
case Opcode::S_FF1_I32_B32:
return S_FF1_I32_B32(inst);
case Opcode::S_FF1_I32_B64:
return S_FF1_I32_B64(inst);
case Opcode::S_AND_SAVEEXEC_B64:
return S_SAVEEXEC_B64(NegateMode::None, false, inst);
case Opcode::S_ORN2_SAVEEXEC_B64:
Expand Down Expand Up @@ -575,7 +575,7 @@ void Translator::S_BCNT1_I32_B64(const GcnInst& inst) {
ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
}

void Translator::S_FF1_I32_B32(const GcnInst& inst) {
void Translator::S_FF1_I32_B64(const GcnInst& inst) {
const IR::U32 src0{GetSrc(inst.src[0])};
const IR::U32 result{ir.Select(ir.IEqual(src0, ir.Imm32(0U)), ir.Imm32(-1), ir.FindILsb(src0))};
SetDst(inst.dst[0], result);
Expand Down
2 changes: 1 addition & 1 deletion src/shader_recompiler/frontend/translate/translate.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Translator {
void S_NOT_B64(const GcnInst& inst);
void S_BREV_B32(const GcnInst& inst);
void S_BCNT1_I32_B64(const GcnInst& inst);
void S_FF1_I32_B32(const GcnInst& inst);
void S_FF1_I32_B64(const GcnInst& inst);
void S_GETPC_B64(u32 pc, const GcnInst& inst);
void S_SAVEEXEC_B64(NegateMode negate, bool is_or, const GcnInst& inst);

Expand Down
2 changes: 1 addition & 1 deletion src/video_core/page_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ constexpr size_t PAGEBITS = 12;
#ifdef ENABLE_USERFAULTFD
struct PageManager::Impl {
Impl(Vulkan::Rasterizer* rasterizer_) : rasterizer{rasterizer_} {
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY);
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
ASSERT_MSG(uffd != -1, "{}", Common::GetLastErrorMsg());

// Request uffdio features from kernel.
Expand Down

0 comments on commit a39b135

Please sign in to comment.