Commit b5e30fca authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Petri Hintukainen

psr_init_3D: bail out if profile 5 or 6 already set

parent b7371622
...@@ -534,10 +534,24 @@ void registers_restore(BD_REGISTERS *p, const uint32_t *psr, const uint32_t *gpr ...@@ -534,10 +534,24 @@ void registers_restore(BD_REGISTERS *p, const uint32_t *psr, const uint32_t *gpr
* *
*/ */
void psr_init_3D(BD_REGISTERS *p, int initial_mode) int psr_init_3D(BD_REGISTERS *p, int initial_mode, int force)
{ {
bd_psr_lock(p); bd_psr_lock(p);
/* make automatic initialization to fail if app has already changed player profile */
if (!force) {
if ((bd_psr_read(p, PSR_PROFILE_VERSION) & BLURAY_PLAYER_PROFILE_VERSION_MASK) >= 0x0300) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "psr_init_3D() failed: profile version already set to >= 0x0300 (profile 6)\n");
bd_psr_unlock(p);
return -1;
}
if (bd_psr_read(p, PSR_PROFILE_VERSION) & BLURAY_PLAYER_PROFILE_3D_FLAG) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "psr_init_3D() failed: 3D already set in profile\n");
bd_psr_unlock(p);
return -1;
}
}
bd_psr_setting_write(p, PSR_OUTPUT_PREFER, bd_psr_setting_write(p, PSR_OUTPUT_PREFER,
BLURAY_OUTPUT_PREFER_3D); BLURAY_OUTPUT_PREFER_3D);
...@@ -558,6 +572,8 @@ void psr_init_3D(BD_REGISTERS *p, int initial_mode) ...@@ -558,6 +572,8 @@ void psr_init_3D(BD_REGISTERS *p, int initial_mode)
!!initial_mode); !!initial_mode);
bd_psr_unlock(p); bd_psr_unlock(p);
return 0;
} }
int psr_init_UHD(BD_REGISTERS *p, int force) int psr_init_UHD(BD_REGISTERS *p, int force)
......
...@@ -267,7 +267,7 @@ void bd_psr_register_cb(BD_REGISTERS *, void (*callback)(void*,BD_PSR_EVENT*), v ...@@ -267,7 +267,7 @@ void bd_psr_register_cb(BD_REGISTERS *, void (*callback)(void*,BD_PSR_EVENT*), v
*/ */
void bd_psr_unregister_cb(BD_REGISTERS *, void (*callback)(void*,BD_PSR_EVENT*), void *cb_handle); void bd_psr_unregister_cb(BD_REGISTERS *, void (*callback)(void*,BD_PSR_EVENT*), void *cb_handle);
BD_PRIVATE void psr_init_3D(BD_REGISTERS *, int initial_mode); BD_PRIVATE int psr_init_3D(BD_REGISTERS *, int initial_mode, int force);
/** /**
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment