mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
spark: make cVideo::Standby more robust
There are a few glitches in the framebuffer driver we need to work around. For now, let's: * close and reopen the video device when going in / out of standby * only enable HDMI when coming out of standby Additionally, don't call Standby() when shutting down neutrino.
This commit is contained in:
@@ -35,8 +35,9 @@
|
|||||||
#define VIDEO_DEVICE "/dev/dvb/adapter0/video0"
|
#define VIDEO_DEVICE "/dev/dvb/adapter0/video0"
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
|
||||||
#define lt_debug_c(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, NULL, args)
|
|
||||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_VIDEO, this, args)
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_VIDEO, this, args)
|
||||||
|
#define lt_debug_c(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, NULL, args)
|
||||||
|
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_VIDEO, NULL, args)
|
||||||
|
|
||||||
#define fop(cmd, args...) ({ \
|
#define fop(cmd, args...) ({ \
|
||||||
int _r; \
|
int _r; \
|
||||||
@@ -53,6 +54,8 @@
|
|||||||
cVideo * videoDecoder = NULL;
|
cVideo * videoDecoder = NULL;
|
||||||
int system_rev = 0;
|
int system_rev = 0;
|
||||||
|
|
||||||
|
static bool hdmi_enabled = true;
|
||||||
|
|
||||||
#define VIDEO_STREAMTYPE_MPEG2 0
|
#define VIDEO_STREAMTYPE_MPEG2 0
|
||||||
#define VIDEO_STREAMTYPE_MPEG4_H264 1
|
#define VIDEO_STREAMTYPE_MPEG4_H264 1
|
||||||
#define VIDEO_STREAMTYPE_VC1 3
|
#define VIDEO_STREAMTYPE_VC1 3
|
||||||
@@ -102,6 +105,7 @@ static int hdmi_out(bool enable)
|
|||||||
{
|
{
|
||||||
struct stmfbio_output_configuration out;
|
struct stmfbio_output_configuration out;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
lt_info_c("%s(%d)\n", __func__, enable);
|
||||||
int fb = open("/dev/fb0", O_RDWR);
|
int fb = open("/dev/fb0", O_RDWR);
|
||||||
if (fb < 0)
|
if (fb < 0)
|
||||||
{
|
{
|
||||||
@@ -114,6 +118,7 @@ static int hdmi_out(bool enable)
|
|||||||
lt_debug_c("%s: STMFBIO_GET_OUTPUT_CONFIG (%m)\n", __func__);
|
lt_debug_c("%s: STMFBIO_GET_OUTPUT_CONFIG (%m)\n", __func__);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
hdmi_enabled = enable;
|
||||||
out.caps = STMFBIO_OUTPUT_CAPS_HDMI_CONFIG;
|
out.caps = STMFBIO_OUTPUT_CAPS_HDMI_CONFIG;
|
||||||
out.activate = STMFBIO_ACTIVATE_IMMEDIATE;
|
out.activate = STMFBIO_ACTIVATE_IMMEDIATE;
|
||||||
out.analogue_config = 0;
|
out.analogue_config = 0;
|
||||||
@@ -145,8 +150,6 @@ cVideo::cVideo(int, void *, void *)
|
|||||||
|
|
||||||
cVideo::~cVideo(void)
|
cVideo::~cVideo(void)
|
||||||
{
|
{
|
||||||
/* disable DACs and SCART voltage */
|
|
||||||
Standby(true);
|
|
||||||
closeDevice();
|
closeDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,10 +416,18 @@ void cVideo::Standby(unsigned int bOn)
|
|||||||
if (bOn)
|
if (bOn)
|
||||||
{
|
{
|
||||||
Stop(1);
|
Stop(1);
|
||||||
|
closeDevice();
|
||||||
hdmi_out(false);
|
hdmi_out(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
/* only enable HDMI output when coming from standby, not on
|
||||||
|
* start. I have no idea why, but enabling it on startup leads
|
||||||
|
* to strange locking problems of the framebuffer driver :-( */
|
||||||
|
if (!hdmi_enabled)
|
||||||
hdmi_out(true);
|
hdmi_out(true);
|
||||||
|
openDevice();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int cVideo::getBlank(void)
|
int cVideo::getBlank(void)
|
||||||
|
Reference in New Issue
Block a user