Skip to content

Commit dc23fba

Browse files
Masashi Kimotopaulusmack
authored andcommitted
[POWERPC] PS3: Add support for HDMI RGB Full Range mode
Add support for HDMI RGB Full Range mode, which is available on system software 1.80 or newer. CC: Masashi Kimoto <Masashi_Kimoto@hq.scei.sony.co.jp> Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 670ad35 commit dc23fba

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

‎drivers/ps3/ps3av_cmd.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ static u32 ps3av_vid_video2av(int vid)
143143
return PS3AV_CMD_AV_VID_480P;
144144
}
145145

146+
static int ps3av_hdmi_range(void)
147+
{
148+
if (ps3_compare_firmware_version(1, 8, 0) < 0)
149+
return 0;
150+
else
151+
return 1; /* supported */
152+
}
153+
146154
int ps3av_cmd_init(void)
147155
{
148156
int res;
@@ -350,6 +358,10 @@ u32 ps3av_cmd_set_av_video_cs(void *p, u32 avport, int video_vid, int cs_out,
350358
/* should be same as video_mode.video_cs_out */
351359
av_video_cs->av_cs_in = ps3av_cs_video2av(PS3AV_CMD_VIDEO_CS_RGB_8);
352360
av_video_cs->bitlen_out = ps3av_cs_video2av_bitlen(cs_out);
361+
if ((id & PS3AV_MODE_WHITE) && ps3av_hdmi_range())
362+
av_video_cs->super_white = PS3AV_CMD_AV_SUPER_WHITE_ON;
363+
else /* default off */
364+
av_video_cs->super_white = PS3AV_CMD_AV_SUPER_WHITE_OFF;
353365
av_video_cs->aspect = aspect;
354366
if (id & PS3AV_MODE_DITHER) {
355367
av_video_cs->dither = PS3AV_CMD_AV_DITHER_ON
@@ -392,6 +404,10 @@ u32 ps3av_cmd_set_video_mode(void *p, u32 head, int video_vid, int video_fmt,
392404
video_mode->pitch = video_mode->width * 4; /* line_length */
393405
video_mode->video_out_format = PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT;
394406
video_mode->video_format = ps3av_video_fmt_table[video_fmt].format;
407+
if ((id & PS3AV_MODE_COLOR) && ps3av_hdmi_range())
408+
video_mode->video_cl_cnv = PS3AV_CMD_VIDEO_CL_CNV_DISABLE_LUT;
409+
else /* default enable */
410+
video_mode->video_cl_cnv = PS3AV_CMD_VIDEO_CL_CNV_ENABLE_LUT;
395411
video_mode->video_order = ps3av_video_fmt_table[video_fmt].order;
396412

397413
pr_debug("%s: video_mode:vid:%x width:%d height:%d pitch:%d out_format:%d format:%x order:%x\n",

‎include/asm-powerpc/ps3av.h‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@
159159
#define PS3AV_CMD_VIDEO_FMT_X8R8G8B8 0x0000
160160
/* video_out_format */
161161
#define PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT 0x0000
162+
/* video_cl_cnv */
163+
#define PS3AV_CMD_VIDEO_CL_CNV_ENABLE_LUT 0x0000
164+
#define PS3AV_CMD_VIDEO_CL_CNV_DISABLE_LUT 0x0010
162165
/* video_sync */
163166
#define PS3AV_CMD_VIDEO_SYNC_VSYNC 0x0001
164167
#define PS3AV_CMD_VIDEO_SYNC_CSYNC 0x0004
@@ -311,6 +314,8 @@
311314
#define PS3AV_MODE_MASK 0x000F
312315
#define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */
313316
#define PS3AV_MODE_DITHER 0x0800
317+
#define PS3AV_MODE_COLOR 0x0400
318+
#define PS3AV_MODE_WHITE 0x0200
314319
#define PS3AV_MODE_FULL 0x0080
315320
#define PS3AV_MODE_DVI 0x0040
316321
#define PS3AV_MODE_RGB 0x0020
@@ -529,17 +534,18 @@ struct ps3av_pkt_video_mode {
529534
u32 video_out_format; /* in: out format */
530535
u32 video_format; /* in: input frame buffer format */
531536
u8 reserved3;
532-
u8 reserved4;
537+
u8 video_cl_cnv; /* in: color conversion */
533538
u16 video_order; /* in: input RGB order */
534-
u32 reserved5;
539+
u32 reserved4;
535540
};
536541

537542
/* video: format */
538543
struct ps3av_pkt_video_format {
539544
struct ps3av_send_hdr send_hdr;
540545
u32 video_head; /* in: head */
541546
u32 video_format; /* in: frame buffer format */
542-
u16 reserved;
547+
u8 reserved;
548+
u8 video_cl_cnv; /* in: color conversion */
543549
u16 video_order; /* in: input RGB order */
544550
};
545551

0 commit comments

Comments
 (0)