Hello community,
here is the log from the commit of package powerpc-utils
checked in at Thu Aug 16 18:21:04 CEST 2007.
--------
--- arch/ppc/powerpc-utils/powerpc-utils.changes 2007-08-14 12:07:09.000000000 +0200
+++ /mounts/work_src_done/STABLE/powerpc-utils/powerpc-utils.changes 2007-08-16 15:59:55.104941000 +0200
@@ -1,0 +2,11 @@
+Wed Aug 15 15:48:47 CEST 2007 - sassmann@suse.de
+
+- added kernel patch for HDMI/DVI autodetection
+- added Samsung226bw to monitor quirk list
+- added ps3-storage-fix-probe-region-loop.diff to fix random
+ misdetection of storage devices
+- added patch to prevent focus disappearing when switching windows
+ petitboot.focus-disappear-on-switch-fix.patch
+- improved petitboot editor to support more keys
+
+-------------------------------------------------------------------
New:
----
petitboot.focus-disappear-on-switch-fix.patch
ps3av-debug.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ powerpc-utils.spec ++++++
--- /var/tmp/diff_new_pack.Y22605/_old 2007-08-16 18:20:42.000000000 +0200
+++ /var/tmp/diff_new_pack.Y22605/_new 2007-08-16 18:20:42.000000000 +0200
@@ -17,7 +17,7 @@
Obsoletes: ppc64-utils
Provides: ppc64-utils
Version: 1.0.0
-Release: 200704280163
+Release: 200704280164
License: IBM Public License
URL: http://powerpc-utils.ozlabs.org/
Group: System/Management
@@ -52,6 +52,8 @@
Patch28: petitboot.boot-game-os.patch
Patch29: petitboot.debug-cleanup.patch
Patch30: petitboot.cmdline-editor.patch
+Patch31: petitboot.focus-disappear-on-switch-fix.patch
+Patch32: ps3av-debug.patch
%define build_kernel 1
%description
@@ -88,6 +90,8 @@
%patch28 -p1
%patch29 -p1
%patch30 -p1
+%patch31 -p1
+#%patch32 -p1
%build
# workaround for using gcc41 to build
@@ -196,6 +200,14 @@
%config %attr (755,root,root) /etc/init.d/ibmvscsis.sh
%changelog
+* Wed Aug 15 2007 - sassmann@suse.de
+- added kernel patch for HDMI/DVI autodetection
+- added Samsung226bw to monitor quirk list
+- added ps3-storage-fix-probe-region-loop.diff to fix random
+ misdetection of storage devices
+- added patch to prevent focus disappearing when switching windows
+ petitboot.focus-disappear-on-switch-fix.patch
+- improved petitboot editor to support more keys
* Tue Aug 14 2007 - sassmann@suse.de
- changed petitboot editor keyboard layout to QWERTY
- removed debug output from petitboot
++++++ petitboot.cmdline-editor.patch ++++++
--- /var/tmp/diff_new_pack.Y22605/_old 2007-08-16 18:20:44.000000000 +0200
+++ /var/tmp/diff_new_pack.Y22605/_new 2007-08-16 18:20:44.000000000 +0200
@@ -40,9 +40,9 @@
+0, 0, '1', '2', '3', '4', '5', '6', '7', '8', /* 0 - 9 */
+'9', '0', 0, 0, 0, 0, 'q', 'w', 'e', 'r', /* 10 - 19 */
+'t', 'y', 'u', 'i', 'o', 'p', 0, 0, 0, 0, /* 20 - 29 */
-+'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0, /* 30 - 39 */
-+0, 0, 0, 0, 'z', 'x', 'c', 'v', 'b', 'n', /* 40 - 49 */
-+'m', 0, 0, '/', 0, 0, 0, ' ', 0, 0, /* 50 - 59 */
++'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ':', /* 30 - 39 */
++'\"', 0, 0, 0, 'z', 'x', 'c', 'v', 'b', 'n', /* 40 - 49 */
++'m', ',', '.', '/', 0, 0, 0, ' ', 0, 0, /* 50 - 59 */
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 69 */
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 70 - 79 */
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 89 */
@@ -297,7 +297,7 @@
int pboot_add_option(int devindex, const char *title, const char *subtitle,
twin_pixmap_t *badge, const char *default_prio,
void *data)
-@@ -816,8 +1025,18 @@ static twin_bool_t pboot_lpane_event (tw
+@@ -813,8 +1024,18 @@ static twin_bool_t pboot_lpane_event (tw
pboot_set_lfocus(pboot_lpane->focus_curindex + 1);
return TWIN_TRUE;
case KEY_RIGHT:
@@ -316,7 +316,7 @@
default:
break;
}
-@@ -828,15 +1047,6 @@ static twin_bool_t pboot_lpane_event (tw
+@@ -825,15 +1046,6 @@ static twin_bool_t pboot_lpane_event (tw
return TWIN_FALSE;
}
@@ -332,7 +332,7 @@
twin_bool_t pboot_event_filter(twin_screen_t *screen,
twin_event_t *event)
-@@ -855,6 +1065,7 @@ twin_bool_t pboot_event_filter(twin_scre
+@@ -852,6 +1064,7 @@ twin_bool_t pboot_event_filter(twin_scre
case TwinEventKeyDown:
switch(event->u.key.key) {
/* Gross hack for video modes, need something better ! */
@@ -340,7 +340,7 @@
case KEY_0:
pboot_vmode_change = 0; /* auto */
pboot_changeres();
-@@ -871,12 +1082,12 @@ twin_bool_t pboot_event_filter(twin_scre
+@@ -868,12 +1081,12 @@ twin_bool_t pboot_event_filter(twin_scre
pboot_vmode_change = 5; /* 1080p */
pboot_changeres();
return TWIN_TRUE;
++++++ petitboot.focus-disappear-on-switch-fix.patch ++++++
Index: powerpc-utils-1.0.0/petitboot-0.0.1/petitboot.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot-0.0.1/petitboot.c
+++ powerpc-utils-1.0.0/petitboot-0.0.1/petitboot.c
@@ -405,8 +405,10 @@ static void pboot_set_rfocus(int index)
pboot_rpane->focus_target = PBOOT_RIGHT_FOCUS_YOFF +
PBOOT_RIGHT_OPTION_STRIDE * index;
- pboot_rpane->focus_curindex = index;
-
+ if (dev->option_count >= index)
+ pboot_rpane->focus_curindex = index;
+ else
+ pboot_rpane->focus_curindex = 0;
option_timer_starttime = 0;
if(!pboot_rfocus_timeout_running) {
pboot_rfocus_timeout_running = 1;
@@ -443,8 +445,11 @@ static void pboot_select_rpane(void)
twin_window_queue_paint(pboot_rpane->window);
/* set focus on default boot entry */
- pboot_set_rfocus(dev->option_default);
-
+ if(dev->option_default != -1)
+ pboot_set_rfocus(dev->option_default);
+ else {
+ pboot_set_rfocus(0);
+ }
}
static void pboot_select_lpane(void)
@@ -913,6 +918,8 @@ static void pboot_create_rpane(void)
}
+static twin_bool_t pboot_lpane_event (twin_window_t *window,
+ twin_event_t *event);
static twin_time_t pboot_lfocus_timeout (twin_time_t now, void *closure)
{
int dir = 1, dist, pos;
@@ -923,6 +930,8 @@ static twin_time_t pboot_lfocus_timeout
pos = pboot_lpane->focus_target - (int)pboot_lpane->focus_box.top;
if (pos == 0) {
pboot_set_device_select(pboot_lpane->focus_curindex, 0);
+ /* re-enable input devices */
+ pboot_lpane->window->event = pboot_lpane_event;
return -1;
}
if (pos < 0) {
@@ -945,8 +954,11 @@ static twin_time_t pboot_lfocus_timeout
static void pboot_set_lfocus(int index)
{
- if (index >= pboot_dev_count)
+ if (index >= pboot_dev_count || index < 0) {
+ /* re-enable input devices */
+ pboot_lpane->window->event = pboot_lpane_event;
return;
+ }
if (default_timeout) {
twin_clear_timeout(default_timeout);
@@ -999,6 +1011,12 @@ static void pboot_lpane_mousetrack(twin_
pboot_lpane->mouse_target = candidate;
}
+static twin_bool_t pboot_dummy_event (twin_window_t *window,
+ twin_event_t *event)
+{
+ return TWIN_TRUE;
+}
+
static twin_bool_t pboot_lpane_event (twin_window_t *window,
twin_event_t *event)
{
@@ -1016,11 +1034,15 @@ static twin_bool_t pboot_lpane_event (tw
case TwinEventKeyDown:
switch(event->u.key.key) {
case KEY_UP:
- if (pboot_lpane->focus_curindex > 0)
+ /* disable input devices to allow uninterrupted transition */
+ pboot_lpane->window->event = pboot_dummy_event;
+ if (pboot_lpane->focus_curindex >= 0)
pboot_set_lfocus(
pboot_lpane->focus_curindex - 1);
return TWIN_TRUE;
case KEY_DOWN:
+ /* disable input devices to allow uninterrupted transition */
+ pboot_lpane->window->event = pboot_dummy_event;
pboot_set_lfocus(pboot_lpane->focus_curindex + 1);
return TWIN_TRUE;
case KEY_RIGHT:
@@ -1266,6 +1288,7 @@ int pboot_add_device(const char *dev_id,
memset(dev, 0, sizeof(*dev));
dev->id = malloc(strlen(dev_id) + 1);
strcpy(dev->id, dev_id);
+ dev->option_default = -1;
dev->badge = pixmap;
dev->box.left = PBOOT_LEFT_ICON_XOFF;
dev->box.right = dev->box.left + PBOOT_LEFT_ICON_WIDTH;
++++++ ps3av-debug.patch ++++++
Index: powerpc-utils-1.0.0/linux-2.6.22/drivers/ps3/ps3av.c
===================================================================
--- powerpc-utils-1.0.0.orig/linux-2.6.22/drivers/ps3/ps3av.c
+++ powerpc-utils-1.0.0/linux-2.6.22/drivers/ps3/ps3av.c
@@ -34,6 +34,7 @@
#define BUFSIZE 4096 /* vuart buf size */
#define PS3AV_BUF_SIZE 512 /* max packet size */
+#define DEBUG
static int timeout = 5000; /* in msec ( 5 sec ) */
module_param(timeout, int, 0644);
++++++ ps3-linux-patches.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3-fix-storage-logic.patch new/ps3-linux-patches/patches.arch/ppc-ps3-fix-storage-logic.patch
--- old/ps3-linux-patches/patches.arch/ppc-ps3-fix-storage-logic.patch 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3-fix-storage-logic.patch 2007-08-15 10:14:09.000000000 +0200
@@ -0,0 +1,141 @@
+commit edd2a9d185799354db255de62c3ed1f2b1c6b0f4
+tree b6f19a73c4584905700c3cfea0cd446f20fda1ce
+parent f5996449e3244524cab0ba709a4bd87047a8175f
+author Geert Uytterhoeven 1186596081 -0700
+committer Paul Mackerras 1186743861 +1000
+
+ [POWERPC] PS3: Fix storage probe logic
+
+ Fix the PS3 storage probe logic to properly find device regions on cold
+ startup.
+
+ o Change the storage probe event mask from notify_device_ready
+ to notify_region_update.
+ o Improve the storage probe error handling.
+ o Change ps3_storage_wait_for_device() to use a temporary variable to hold
+ the buffer address.
+
+ Signed-off-by: Geert Uytterhoeven
+ Signed-off-by: Geoff Levand
+ Signed-off-by: Paul Mackerras
+
+diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
+index 825ebb2..e23a5a8 100644
+--- a/arch/powerpc/platforms/ps3/device-init.c
++++ b/arch/powerpc/platforms/ps3/device-init.c
+@@ -273,55 +273,58 @@ static int ps3stor_wait_for_completion(u
+
+ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
+ {
++ int error = -ENODEV;
+ int result;
+ const u64 notification_dev_id = (u64)-1LL;
+ const unsigned int timeout = HZ;
+ u64 lpar;
+ u64 tag;
++ void *buf;
++ enum ps3_notify_type {
++ notify_device_ready = 0,
++ notify_region_probe = 1,
++ notify_region_update = 2,
++ };
+ struct {
+ u64 operation_code; /* must be zero */
+- u64 event_mask; /* 1 = device ready */
++ u64 event_mask; /* OR of 1UL << enum ps3_notify_type */
+ } *notify_cmd;
+ struct {
+- u64 event_type; /* notify_device_ready */
++ u64 event_type; /* enum ps3_notify_type */
+ u64 bus_id;
+ u64 dev_id;
+ u64 dev_type;
+ u64 dev_port;
+ } *notify_event;
+- enum {
+- notify_device_ready = 1
+- };
+
+ pr_debug(" -> %s:%u: bus_id %u, dev_id %u, dev_type %u\n", __func__,
+ __LINE__, repo->bus_id, repo->dev_id, repo->dev_type);
+
+- notify_cmd = kzalloc(512, GFP_KERNEL);
+- notify_event = (void *)notify_cmd;
+- if (!notify_cmd)
++ buf = kzalloc(512, GFP_KERNEL);
++ if (!buf)
+ return -ENOMEM;
+
+- lpar = ps3_mm_phys_to_lpar(__pa(notify_cmd));
++ lpar = ps3_mm_phys_to_lpar(__pa(buf));
++ notify_cmd = buf;
++ notify_event = buf;
+
+ result = lv1_open_device(repo->bus_id, notification_dev_id, 0);
+ if (result) {
+ printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__,
+ __LINE__, ps3_result(result));
+- result = -ENODEV;
+ goto fail_free;
+ }
+
+ /* Setup and write the request for device notification. */
+
+- notify_cmd->operation_code = 0; /* must be zero */
+- notify_cmd->event_mask = 0x01; /* device ready */
++ notify_cmd->operation_code = 0; /* must be zero */
++ notify_cmd->event_mask = 1UL << notify_region_probe;
+
+ result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,
+ &tag);
+ if (result) {
+ printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__,
+ ps3_result(result));
+- result = -ENODEV;
+ goto fail_close;
+ }
+
+@@ -332,13 +335,11 @@ static int ps3_storage_wait_for_device(c
+ if (result) {
+ printk(KERN_ERR "%s:%u: write not completed %s\n", __func__,
+ __LINE__, ps3_result(result));
+- result = -ENODEV;
+ goto fail_close;
+ }
+
+ /* Loop here processing the requested notification events. */
+
+- result = -ENODEV;
+ while (1) {
+ memset(notify_event, 0, sizeof(*notify_event));
+
+@@ -358,7 +359,7 @@ static int ps3_storage_wait_for_device(c
+ break;
+ }
+
+- if (notify_event->event_type != notify_device_ready ||
++ if (notify_event->event_type != notify_region_probe ||
+ notify_event->bus_id != repo->bus_id) {
+ pr_debug("%s:%u: bad notify_event: event %lu, "
+ "dev_id %lu, dev_type %lu\n",
+@@ -372,7 +372,7 @@ static int ps3_storage_wait_for_device(c
+ notify_event->dev_type == repo->dev_type) {
+ pr_debug("%s:%u: device ready: dev_id %u\n", __func__,
+ __LINE__, repo->dev_id);
+- result = 0;
++ error = 0;
+ break;
+ }
+
+@@ -386,9 +387,9 @@ static int ps3_storage_wait_for_device(c
+ fail_close:
+ lv1_close_device(repo->bus_id, notification_dev_id);
+ fail_free:
+- kfree(notify_cmd);
++ kfree(buf);
+ pr_debug(" <- %s:%u\n", __func__, __LINE__);
+- return result;
++ return error;
+ }
+
+ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-dvi-autodetect.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-dvi-autodetect.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-dvi-autodetect.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-dvi-autodetect.diff 2007-08-16 08:16:39.000000000 +0200
@@ -0,0 +1,74 @@
+Subject: ps3av: treat DVI-D like HDMI in autodetect
+
+ps3av: treat DVI-D monitors like HDMI monitors when autodetecting the best
+video mode
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 24 ++++++++----------------
+ include/asm-powerpc/ps3av.h | 1 -
+ 2 files changed, 8 insertions(+), 17 deletions(-)
+
+--- a/drivers/ps3/ps3av.c
++++ b/drivers/ps3/ps3av.c
+@@ -602,9 +602,6 @@ static int ps3av_hdmi_get_id(struct ps3a
+ u32 res_50, res_60;
+ int id;
+
+- if (info->monitor_type != PS3AV_MONITOR_TYPE_HDMI)
+- return 0;
+-
+ /* check native resolution */
+ res_50 = info->res_50.native & PS3AV_RES_MASK_50;
+ res_60 = info->res_60.native & PS3AV_RES_MASK_60;
+@@ -693,7 +690,7 @@ static int ps3av_auto_videomode(struct p
+ struct ps3av_info_monitor *info;
+
+ /* get mode id for hdmi */
+- for (i = 0; i < av_hw_conf->num_of_hdmi; i++) {
++ for (i = 0; i < av_hw_conf->num_of_hdmi && !id; i++) {
+ res = ps3av_cmd_video_get_monitor_info(&monitor_info,
+ PS3AV_CMD_AVPORT_HDMI_0 +
+ i);
+@@ -701,24 +698,19 @@ static int ps3av_auto_videomode(struct p
+ return -1;
+
+ ps3av_monitor_info_dump(&monitor_info);
++
+ info = &monitor_info.info;
+- /* check DVI */
+- if (info->monitor_type == PS3AV_MONITOR_TYPE_DVI) {
++ switch (info->monitor_type) {
++ case PS3AV_MONITOR_TYPE_DVI:
+ dvi = PS3AV_MODE_DVI;
+- break;
+- }
+- /* check HDMI */
+- id = ps3av_hdmi_get_id(info);
+- if (id) {
+- /* got valid mode id */
++ /* fall through */
++ case PS3AV_MONITOR_TYPE_HDMI:
++ id = ps3av_hdmi_get_id(info);
+ break;
+ }
+ }
+
+- if (dvi) {
+- /* DVI mode */
+- id = PS3AV_DEFAULT_DVI_MODE_ID;
+- } else if (!id) {
++ if (!id) {
+ /* no HDMI interface or HDMI is off */
+ if (ps3av->region & PS3AV_REGION_60)
+ id = PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60;
+--- a/include/asm-powerpc/ps3av.h
++++ b/include/asm-powerpc/ps3av.h
+@@ -305,7 +305,6 @@
+ #define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60 1 /* 480i */
+ #define PS3AV_DEFAULT_HDMI_MODE_ID_REG_50 7 /* 576p */
+ #define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50 6 /* 576i */
+-#define PS3AV_DEFAULT_DVI_MODE_ID 2 /* 480p */
+
+ #define PS3AV_REGION_60 0x01
+ #define PS3AV_REGION_50 0x02
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-boot-parameter.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-boot-parameter.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-boot-parameter.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-boot-parameter.diff 2007-08-16 08:16:39.000000000 +0200
@@ -0,0 +1,137 @@
+Subject: ps3av: don't distinguish between `boot' and `non-boot' autodetection
+
+ps3av: don't distinguish between `boot' and `non-boot' autodetection now the
+autodetection code has been improved
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 35 ++++++-----------------------------
+ drivers/video/ps3fb.c | 6 ++----
+ include/asm-powerpc/ps3av.h | 4 ++--
+ 3 files changed, 10 insertions(+), 35 deletions(-)
+
+--- a/drivers/ps3/ps3av.c
++++ b/drivers/ps3/ps3av.c
+@@ -738,8 +738,7 @@ static void ps3av_fixup_monitor_info(str
+ }
+ }
+
+-static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
+- int boot)
++static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf)
+ {
+ int i, res, id = 0, dvi = 0, rgb = 0;
+ struct ps3av_pkt_av_get_monitor_info monitor_info;
+@@ -777,28 +776,6 @@ static int ps3av_auto_videomode(struct p
+ if (ps3av->region & PS3AV_REGION_RGB)
+ rgb = PS3AV_MODE_RGB;
+ pr_info("%s: Using avmulti mode %d\n", __func__, id);
+- } else if (boot) {
+- /* HDMI: using DEFAULT HDMI_MODE_ID while booting up */
+- info = &monitor_info.info;
+- if (ps3av->region & PS3AV_REGION_60) {
+- if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
+- id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+- else if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
+- id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
+- else {
+- /* default */
+- id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+- }
+- } else {
+- if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
+- id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
+- else if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
+- id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+- else {
+- /* default */
+- id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
+- }
+- }
+ }
+
+ return id | dvi | rgb;
+@@ -840,7 +817,7 @@ static int ps3av_get_hw_conf(struct ps3a
+ }
+
+ /* set mode using id */
+-int ps3av_set_video_mode(u32 id, int boot)
++int ps3av_set_video_mode(u32 id)
+ {
+ int size;
+ u32 option;
+@@ -854,7 +831,7 @@ int ps3av_set_video_mode(u32 id, int boo
+ /* auto mode */
+ option = id & ~PS3AV_MODE_MASK;
+ if ((id & PS3AV_MODE_MASK) == 0) {
+- id = ps3av_auto_videomode(&ps3av->av_hw_conf, boot);
++ id = ps3av_auto_videomode(&ps3av->av_hw_conf);
+ if (id < 1) {
+ printk(KERN_ERR "%s: invalid id :%d\n", __func__, id);
+ return -EINVAL;
+@@ -874,9 +851,9 @@ int ps3av_set_video_mode(u32 id, int boo
+
+ EXPORT_SYMBOL_GPL(ps3av_set_video_mode);
+
+-int ps3av_get_auto_mode(int boot)
++int ps3av_get_auto_mode(void)
+ {
+- return ps3av_auto_videomode(&ps3av->av_hw_conf, boot);
++ return ps3av_auto_videomode(&ps3av->av_hw_conf);
+ }
+
+ EXPORT_SYMBOL_GPL(ps3av_get_auto_mode);
+@@ -1022,7 +999,7 @@ static int ps3av_probe(struct ps3_system
+ res);
+
+ ps3av_get_hw_conf(ps3av);
+- id = ps3av_auto_videomode(&ps3av->av_hw_conf, 1);
++ id = ps3av_auto_videomode(&ps3av->av_hw_conf);
+ mutex_lock(&ps3av->mutex);
+ ps3av->ps3av_mode = id;
+ mutex_unlock(&ps3av->mutex);
+--- a/drivers/video/ps3fb.c
++++ b/drivers/video/ps3fb.c
+@@ -545,7 +545,6 @@ static int ps3fb_set_par(struct fb_info
+ unsigned int mode;
+ int i;
+ unsigned long offset;
+- static int first = 1;
+
+ dev_dbg(info->device, "xres:%d xv:%d yres:%d yv:%d clock:%d\n",
+ info->var.xres, info->var.xres_virtual,
+@@ -568,10 +567,9 @@ static int ps3fb_set_par(struct fb_info
+ /* Keep the special bits we cannot set using fb_var_screeninfo */
+ ps3fb_mode = (ps3fb_mode & ~PS3AV_MODE_MASK) | mode;
+
+- if (ps3av_set_video_mode(ps3fb_mode, first))
++ if (ps3av_set_video_mode(ps3fb_mode))
+ return -EINVAL;
+
+- first = 0;
+ return 0;
+ }
+
+@@ -733,7 +731,7 @@ static int ps3fb_ioctl(struct fb_info *i
+ break;
+
+ if (!(val & PS3AV_MODE_MASK)) {
+- u32 id = ps3av_get_auto_mode(0);
++ u32 id = ps3av_get_auto_mode();
+ if (id > 0)
+ val = (val & ~PS3AV_MODE_MASK) | id;
+ }
+--- a/include/asm-powerpc/ps3av.h
++++ b/include/asm-powerpc/ps3av.h
+@@ -710,9 +710,9 @@ extern int ps3av_cmd_av_get_hw_conf(stru
+ extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
+ u32);
+
+-extern int ps3av_set_video_mode(u32, int);
++extern int ps3av_set_video_mode(u32);
+ extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
+-extern int ps3av_get_auto_mode(int);
++extern int ps3av_get_auto_mode(void);
+ extern int ps3av_get_mode(void);
+ extern int ps3av_get_scanmode(int);
+ extern int ps3av_get_refresh_rate(int);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-PS3AV_DEBUG.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-PS3AV_DEBUG.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-PS3AV_DEBUG.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-PS3AV_DEBUG.diff 2007-08-16 08:16:39.000000000 +0200
@@ -0,0 +1,213 @@
+Subject: ps3av: eliminate PS3AV_DEBUG
+
+ps3av: eliminate PS3AV_DEBUG
+ - Move ps3av_cmd_av_monitor_info_dump from ps3av_cmd.c to ps3av.c, as it's
+ used there only
+ - Integrate ps3av_cmd_av_hw_conf_dump() into its sole user
+ - Use pr_debug() for printing debug info
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 71 ++++++++++++++++++++++++++++++++++++++++----
+ drivers/ps3/ps3av_cmd.c | 66 ----------------------------------------
+ include/asm-powerpc/ps3av.h | 7 ----
+ 3 files changed, 66 insertions(+), 78 deletions(-)
+
+--- a/drivers/ps3/ps3av.c
++++ b/drivers/ps3/ps3av.c
+@@ -638,6 +638,63 @@ static int ps3av_hdmi_get_vid(struct ps3
+ return vid;
+ }
+
++static void ps3av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info)
++{
++ const struct ps3av_info_monitor *info = &monitor_info->info;
++ const struct ps3av_info_audio *audio = info->audio;
++ char id[sizeof(info->monitor_id)*3+1];
++ int i;
++
++ pr_info("Monitor Info: size %u\n", monitor_info->send_hdr.size);
++
++ pr_info("avport: %02x\n", info->avport);
++ for (i = 0; i < sizeof(info->monitor_id); i++)
++ sprintf(&id[i*3], " %02x", info->monitor_id[i]);
++ pr_info("monitor_id: %s\n", id);
++ pr_info("monitor_type: %02x\n", info->monitor_type);
++ pr_info("monitor_name: %.*s\n", (int)sizeof(info->monitor_name),
++ info->monitor_name);
++
++ /* resolution */
++ pr_info("resolution_60: bits: %08x native: %08x\n",
++ info->res_60.res_bits, info->res_60.native);
++ pr_info("resolution_50: bits: %08x native: %08x\n",
++ info->res_50.res_bits, info->res_50.native);
++ pr_info("resolution_other: bits: %08x native: %08x\n",
++ info->res_other.res_bits, info->res_other.native);
++ pr_info("resolution_vesa: bits: %08x native: %08x\n",
++ info->res_vesa.res_bits, info->res_vesa.native);
++
++ /* color space */
++ pr_info("color space rgb: %02x\n", info->cs.rgb);
++ pr_info("color space yuv444: %02x\n", info->cs.yuv444);
++ pr_info("color space yuv422: %02x\n", info->cs.yuv422);
++
++ /* color info */
++ pr_info("color info red: X %04x Y %04x\n", info->color.red_x,
++ info->color.red_y);
++ pr_info("color info green: X %04x Y %04x\n", info->color.green_x,
++ info->color.green_y);
++ pr_info("color info blue: X %04x Y %04x\n", info->color.blue_x,
++ info->color.blue_y);
++ pr_info("color info white: X %04x Y %04x\n", info->color.white_x,
++ info->color.white_y);
++ pr_info("color info gamma: %08x\n", info->color.gamma);
++
++ /* other info */
++ pr_info("supported_AI: %02x\n", info->supported_ai);
++ pr_info("speaker_info: %02x\n", info->speaker_info);
++ pr_info("num of audio: %02x\n", info->num_of_audio_block);
++
++ /* audio block */
++ for (i = 0; i < info->num_of_audio_block; i++) {
++ pr_info("audio[%d] type: %02x max_ch: %02x fs: %02x sbit: %02x\n",
++ i, audio->type, audio->max_num_of_ch, audio->fs,
++ audio->sbit);
++ audio++;
++ }
++}
++
+ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
+ int boot)
+ {
+@@ -653,7 +710,7 @@ static int ps3av_auto_videomode(struct p
+ if (res < 0)
+ return -1;
+
+- ps3av_cmd_av_monitor_info_dump(&monitor_info);
++ ps3av_monitor_info_dump(&monitor_info);
+ info = &monitor_info.info;
+ /* check DVI */
+ if (info->monitor_type == PS3AV_MONITOR_TYPE_DVI) {
+@@ -709,23 +766,27 @@ static int ps3av_auto_videomode(struct p
+ static int ps3av_get_hw_conf(struct ps3av *ps3av)
+ {
+ int i, j, k, res;
++ const struct ps3av_pkt_av_get_hw_conf *hw_conf;
+
+ /* get av_hw_conf */
+ res = ps3av_cmd_av_get_hw_conf(&ps3av->av_hw_conf);
+ if (res < 0)
+ return -1;
+
+- ps3av_cmd_av_hw_conf_dump(&ps3av->av_hw_conf);
++ hw_conf = &ps3av->av_hw_conf;
++ pr_debug("av_h_conf: num of hdmi: %u\n", hw_conf->num_of_hdmi);
++ pr_debug("av_h_conf: num of avmulti: %u\n", hw_conf->num_of_avmulti);
++ pr_debug("av_h_conf: num of spdif: %u\n", hw_conf->num_of_spdif);
+
+ for (i = 0; i < PS3AV_HEAD_MAX; i++)
+ ps3av->head[i] = PS3AV_CMD_VIDEO_HEAD_A + i;
+ for (i = 0; i < PS3AV_OPT_PORT_MAX; i++)
+ ps3av->opt_port[i] = PS3AV_CMD_AVPORT_SPDIF_0 + i;
+- for (i = 0; i < ps3av->av_hw_conf.num_of_hdmi; i++)
++ for (i = 0; i < hw_conf->num_of_hdmi; i++)
+ ps3av->av_port[i] = PS3AV_CMD_AVPORT_HDMI_0 + i;
+- for (j = 0; j < ps3av->av_hw_conf.num_of_avmulti; j++)
++ for (j = 0; j < hw_conf->num_of_avmulti; j++)
+ ps3av->av_port[i + j] = PS3AV_CMD_AVPORT_AVMULTI_0 + j;
+- for (k = 0; k < ps3av->av_hw_conf.num_of_spdif; k++)
++ for (k = 0; k < hw_conf->num_of_spdif; k++)
+ ps3av->av_port[i + j + k] = PS3AV_CMD_AVPORT_SPDIF_0 + k;
+
+ /* set all audio port */
+--- a/drivers/ps3/ps3av_cmd.c
++++ b/drivers/ps3/ps3av_cmd.c
+@@ -922,72 +922,6 @@ int ps3av_cmd_video_get_monitor_info(str
+ return res;
+ }
+
+-#ifdef PS3AV_DEBUG
+-void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf)
+-{
+- printk("av_h_conf:num of hdmi:%d\n", hw_conf->num_of_hdmi);
+- printk("av_h_conf:num of avmulti:%d\n", hw_conf->num_of_avmulti);
+- printk("av_h_conf:num of spdif:%d\n", hw_conf->num_of_spdif);
+-}
+-
+-void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info)
+-{
+- const struct ps3av_info_monitor *info = &monitor_info->info;
+- const struct ps3av_info_audio *audio = info->audio;
+- int i;
+-
+- printk("Monitor Info: size%d\n", monitor_info->send_hdr.size);
+-
+- printk("avport:%02x\n", info->avport);
+- printk("monitor_id:");
+- for (i = 0; i < 10; i++)
+- printk("%02x ", info->monitor_id[i]);
+- printk("\nmonitor_type:%02x\n", info->monitor_type);
+- printk("monitor_name:");
+- for (i = 0; i < 16; i++)
+- printk("%c", info->monitor_name[i]);
+-
+- /* resolution */
+- printk("\nresolution_60: bits:%08x native:%08x\n",
+- info->res_60.res_bits, info->res_60.native);
+- printk("resolution_50: bits:%08x native:%08x\n",
+- info->res_50.res_bits, info->res_50.native);
+- printk("resolution_other: bits:%08x native:%08x\n",
+- info->res_other.res_bits, info->res_other.native);
+- printk("resolution_vesa: bits:%08x native:%08x\n",
+- info->res_vesa.res_bits, info->res_vesa.native);
+-
+- /* color space */
+- printk("color space rgb:%02x\n", info->cs.rgb);
+- printk("color space yuv444:%02x\n", info->cs.yuv444);
+- printk("color space yuv422:%02x\n", info->cs.yuv422);
+-
+- /* color info */
+- printk("color info red:X %04x Y %04x\n",
+- info->color.red_x, info->color.red_y);
+- printk("color info green:X %04x Y %04x\n",
+- info->color.green_x, info->color.green_y);
+- printk("color info blue:X %04x Y %04x\n",
+- info->color.blue_x, info->color.blue_y);
+- printk("color info white:X %04x Y %04x\n",
+- info->color.white_x, info->color.white_y);
+- printk("color info gamma: %08x\n", info->color.gamma);
+-
+- /* other info */
+- printk("supported_AI:%02x\n", info->supported_ai);
+- printk("speaker_info:%02x\n", info->speaker_info);
+- printk("num of audio:%02x\n", info->num_of_audio_block);
+-
+- /* audio block */
+- for (i = 0; i < info->num_of_audio_block; i++) {
+- printk("audio[%d] type:%02x max_ch:%02x fs:%02x sbit:%02x\n",
+- i, audio->type, audio->max_num_of_ch, audio->fs,
+- audio->sbit);
+- audio++;
+- }
+-}
+-#endif /* PS3AV_DEBUG */
+-
+ #define PS3AV_AV_LAYOUT_0 (PS3AV_CMD_AV_LAYOUT_32 \
+ | PS3AV_CMD_AV_LAYOUT_44 \
+ | PS3AV_CMD_AV_LAYOUT_48)
+--- a/include/asm-powerpc/ps3av.h
++++ b/include/asm-powerpc/ps3av.h
+@@ -698,13 +698,6 @@ extern int ps3av_cmd_audio_mute(int, u32
+ extern int ps3av_cmd_audio_active(int, u32);
+ extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32);
+ extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *);
+-#ifdef PS3AV_DEBUG
+-extern void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *);
+-extern void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *);
+-#else
+-static inline void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) {}
+-static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) {}
+-#endif
+ extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
+ u32);
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-temporaries.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-temporaries.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-temporaries.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-temporaries.diff 2007-08-16 08:16:39.000000000 +0200
@@ -0,0 +1,64 @@
+Subject: ps3av: eliminate unneeded temporary variables
+
+ps3av: eliminate unneeded temporary variables
+
+From: Geert Uytterhoeven
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av_cmd.c | 17 ++++++-----------
+ 1 files changed, 6 insertions(+), 11 deletions(-)
+
+--- a/drivers/ps3/ps3av_cmd.c
++++ b/drivers/ps3/ps3av_cmd.c
+@@ -512,7 +512,6 @@ static const u32 ps3av_ns_table[][5] = {
+ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid)
+ {
+ u32 av_vid, ns_val;
+- u8 *p = ns;
+ int d;
+
+ d = ns_val = 0;
+@@ -551,24 +550,22 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs,
+ else
+ ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d];
+
+- *p++ = ns_val & 0x000000FF;
+- *p++ = (ns_val & 0x0000FF00) >> 8;
+- *p = (ns_val & 0x00FF0000) >> 16;
++ *ns++ = ns_val & 0x000000FF;
++ *ns++ = (ns_val & 0x0000FF00) >> 8;
++ *ns = (ns_val & 0x00FF0000) >> 16;
+ }
+
+ #undef BASE
+
+ static u8 ps3av_cnv_enable(u32 source, const u8 *enable)
+ {
+- const u8 *p;
+ u8 ret = 0;
+
+ if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) {
+ ret = 0x03;
+ } else if (source == PS3AV_CMD_AUDIO_SOURCE_SERIAL) {
+- p = enable;
+- ret = ((p[0] << 4) + (p[1] << 5) + (p[2] << 6) + (p[3] << 7)) |
+- 0x01;
++ ret = ((enable[0] << 4) + (enable[1] << 5) + (enable[2] << 6) +
++ (enable[3] << 7)) | 0x01;
+ } else
+ printk(KERN_ERR "%s failed, source:%x\n", __func__, source);
+ return ret;
+@@ -576,11 +573,9 @@ static u8 ps3av_cnv_enable(u32 source, c
+
+ static u8 ps3av_cnv_fifomap(const u8 *map)
+ {
+- const u8 *p;
+ u8 ret = 0;
+
+- p = map;
+- ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6);
++ ret = map[0] + (map[1] << 2) + (map[2] << 4) + (map[3] << 6);
+ return ret;
+ }
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-unused-ps3av_set_mode.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-unused-ps3av_set_mode.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-unused-ps3av_set_mode.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-unused-ps3av_set_mode.diff 2007-08-16 08:16:39.000000000 +0200
@@ -0,0 +1,50 @@
+Subject: ps3av: remove unused ps3av_set_mode()
+
+ps3av: remove unused ps3av_set_mode()
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 21 ---------------------
+ include/asm-powerpc/ps3av.h | 1 -
+ 2 files changed, 22 deletions(-)
+
+--- a/drivers/ps3/ps3av.c
++++ b/drivers/ps3/ps3av.c
+@@ -881,27 +881,6 @@ int ps3av_get_auto_mode(int boot)
+
+ EXPORT_SYMBOL_GPL(ps3av_get_auto_mode);
+
+-int ps3av_set_mode(u32 id, int boot)
+-{
+- int res;
+-
+- res = ps3av_set_video_mode(id, boot);
+- if (res)
+- return res;
+-
+- res = ps3av_set_audio_mode(PS3AV_CMD_AUDIO_NUM_OF_CH_2,
+- PS3AV_CMD_AUDIO_FS_48K,
+- PS3AV_CMD_AUDIO_WORD_BITS_16,
+- PS3AV_CMD_AUDIO_FORMAT_PCM,
+- PS3AV_CMD_AUDIO_SOURCE_SERIAL);
+- if (res)
+- return res;
+-
+- return 0;
+-}
+-
+-EXPORT_SYMBOL_GPL(ps3av_set_mode);
+-
+ int ps3av_get_mode(void)
+ {
+ return ps3av ? ps3av->ps3av_mode : 0;
+--- a/include/asm-powerpc/ps3av.h
++++ b/include/asm-powerpc/ps3av.h
+@@ -713,7 +713,6 @@ extern int ps3av_cmd_video_get_monitor_i
+ extern int ps3av_set_video_mode(u32, int);
+ extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
+ extern int ps3av_get_auto_mode(int);
+-extern int ps3av_set_mode(u32, int);
+ extern int ps3av_get_mode(void);
+ extern int ps3av_get_scanmode(int);
+ extern int ps3av_get_refresh_rate(int);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff 2007-08-16 09:30:50.000000000 +0200
@@ -0,0 +1,70 @@
+Subject: ps3av: add quirk database for broken monitors
+
+ps3av: add a quirk database for broken monitors where the `best' advertised
+video mode doesn't work
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 38 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 38 insertions(+)
+
+Index: linux/drivers/ps3/ps3av.c
+===================================================================
+--- linux.orig/drivers/ps3/ps3av.c
++++ linux/drivers/ps3/ps3av.c
+@@ -702,6 +702,46 @@ static void ps3av_monitor_info_dump(cons
+ }
+ }
+
++static const struct ps3av_monitor_quirk {
++ const char *monitor_name;
++ u32 clear_60, clear_50, clear_vesa;
++} ps3av_monitor_quirks[] = {
++ {
++ .monitor_name = "DELL 2007WFP",
++ .clear_60 = PS3AV_RESBIT_1920x1080I
++ }, {
++ .monitor_name = "L226WTQ",
++ .clear_60 = PS3AV_RESBIT_1920x1080I |
++ PS3AV_RESBIT_1920x1080P
++ }, {
++ .monitor_name = "SyncMaster",
++ .clear_60 = PS3AV_RESBIT_1920x1080I |
++ PS3AV_RESBIT_1920x1080P
++ }
++};
++
++static void ps3av_fixup_monitor_info(struct ps3av_info_monitor *info)
++{
++ unsigned int i;
++ const struct ps3av_monitor_quirk *quirk;
++
++ for (i = 0; i < ARRAY_SIZE(ps3av_monitor_quirks); i++) {
++ quirk = &ps3av_monitor_quirks[i];
++ if (!strncmp(info->monitor_name, quirk->monitor_name,
++ sizeof(info->monitor_name))) {
++ pr_info("%s: Applying quirk for %s\n", __func__,
++ quirk->monitor_name);
++ info->res_60.res_bits &= ~quirk->clear_60;
++ info->res_60.native &= ~quirk->clear_60;
++ info->res_50.res_bits &= ~quirk->clear_50;
++ info->res_50.native &= ~quirk->clear_50;
++ info->res_vesa.res_bits &= ~quirk->clear_vesa;
++ info->res_vesa.native &= ~quirk->clear_vesa;
++ break;
++ }
++ }
++}
++
+ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
+ int boot)
+ {
+@@ -720,6 +760,8 @@ static int ps3av_auto_videomode(struct p
+ ps3av_monitor_info_dump(&monitor_info);
+
+ info = &monitor_info.info;
++ ps3av_fixup_monitor_info(info);
++
+ switch (info->monitor_type) {
+ case PS3AV_MONITOR_TYPE_DVI:
+ dvi = PS3AV_MODE_DVI;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff.orig new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff.orig
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff.orig 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff.orig 2007-08-16 09:23:01.000000000 +0200
@@ -0,0 +1,70 @@
+Subject: ps3av: add quirk database for broken monitors
+
+ps3av: add a quirk database for broken monitors where the `best' advertised
+video mode doesn't work
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 38 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 38 insertions(+)
+
+Index: linux/drivers/ps3/ps3av.c
+===================================================================
+--- linux.orig/drivers/ps3/ps3av.c
++++ linux/drivers/ps3/ps3av.c
+@@ -702,6 +702,46 @@ static void ps3av_monitor_info_dump(cons
+ }
+ }
+
++static const struct ps3av_monitor_quirk {
++ const char *monitor_name;
++ u32 clear_60, clear_50, clear_vesa;
++} ps3av_monitor_quirks[] = {
++ {
++ .monitor_name = "DELL 2007WFP",
++ .clear_60 = PS3AV_RESBIT_1920x1080I
++ }, {
++ .monitor_name = "L226WTQ",
++ .clear_60 = PS3AV_RESBIT_1920x1080I |
++ PS3AV_RESBIT_1920x1080P
++ }, {
++ .monitor_name = "SyncMaster"
++ .clear_60 = PS3AV_RESBIT_1920x1080I |
++ PS3AV_RESBIT_1920x1080P
++ }
++};
++
++static void ps3av_fixup_monitor_info(struct ps3av_info_monitor *info)
++{
++ unsigned int i;
++ const struct ps3av_monitor_quirk *quirk;
++
++ for (i = 0; i < ARRAY_SIZE(ps3av_monitor_quirks); i++) {
++ quirk = &ps3av_monitor_quirks[i];
++ if (!strncmp(info->monitor_name, quirk->monitor_name,
++ sizeof(info->monitor_name))) {
++ pr_info("%s: Applying quirk for %s\n", __func__,
++ quirk->monitor_name);
++ info->res_60.res_bits &= ~quirk->clear_60;
++ info->res_60.native &= ~quirk->clear_60;
++ info->res_50.res_bits &= ~quirk->clear_50;
++ info->res_50.native &= ~quirk->clear_50;
++ info->res_vesa.res_bits &= ~quirk->clear_vesa;
++ info->res_vesa.native &= ~quirk->clear_vesa;
++ break;
++ }
++ }
++}
++
+ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
+ int boot)
+ {
+@@ -720,6 +760,8 @@ static int ps3av_auto_videomode(struct p
+ ps3av_monitor_info_dump(&monitor_info);
+
+ info = &monitor_info.info;
++ ps3av_fixup_monitor_info(info);
++
+ switch (info->monitor_type) {
+ case PS3AV_MONITOR_TYPE_DVI:
+ dvi = PS3AV_MODE_DVI;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-use-mode-id-in-autodetect.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-use-mode-id-in-autodetect.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-use-mode-id-in-autodetect.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-use-mode-id-in-autodetect.diff 2007-08-16 08:16:39.000000000 +0200
@@ -0,0 +1,213 @@
+Subject: ps3av: use PS3 video mode ids in autodetect code
+
+ps3av: use PS3 video mode ids in autodetect code
+
+It doesn't make much sense to use the PS3AV_CMD_VIDEO_VID_* values in the
+autodetection code, just to convert them to PS3 video mode ids afterwards.
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 90 +++++++++++++++++++-------------------------
+ include/asm-powerpc/ps3av.h | 11 ++---
+ 2 files changed, 46 insertions(+), 55 deletions(-)
+
+--- a/drivers/ps3/ps3av.c
++++ b/drivers/ps3/ps3av.c
+@@ -567,75 +567,65 @@ static void ps3avd(struct work_struct *w
+ complete(&ps3av->done);
+ }
+
+-static int ps3av_vid2table_id(int vid)
++static int ps3av_resbit2id(u32 res_50, u32 res_60)
+ {
+- int i;
+-
+- for (i = 1; i < ARRAY_SIZE(video_mode_table); i++)
+- if (video_mode_table[i].vid == vid)
+- return i;
+- return -1;
+-}
+-
+-static int ps3av_resbit2vid(u32 res_50, u32 res_60)
+-{
+- int vid = -1;
++ int id = 0;
+
+ if (res_50 > res_60) { /* if res_50 == res_60, res_60 will be used */
+ if (res_50 & PS3AV_RESBIT_1920x1080P)
+- vid = PS3AV_CMD_VIDEO_VID_1080P_50HZ;
++ id = 10;
+ else if (res_50 & PS3AV_RESBIT_1920x1080I)
+- vid = PS3AV_CMD_VIDEO_VID_1080I_50HZ;
++ id = 9;
+ else if (res_50 & PS3AV_RESBIT_1280x720P)
+- vid = PS3AV_CMD_VIDEO_VID_720P_50HZ;
++ id = 8;
+ else if (res_50 & PS3AV_RESBIT_720x576P)
+- vid = PS3AV_CMD_VIDEO_VID_576P;
++ id = 7;
+ else
+- vid = -1;
++ id = 0;
+ } else {
+ if (res_60 & PS3AV_RESBIT_1920x1080P)
+- vid = PS3AV_CMD_VIDEO_VID_1080P_60HZ;
++ id = 5;
+ else if (res_60 & PS3AV_RESBIT_1920x1080I)
+- vid = PS3AV_CMD_VIDEO_VID_1080I_60HZ;
++ id = 4;
+ else if (res_60 & PS3AV_RESBIT_1280x720P)
+- vid = PS3AV_CMD_VIDEO_VID_720P_60HZ;
++ id = 3;
+ else if (res_60 & PS3AV_RESBIT_720x480P)
+- vid = PS3AV_CMD_VIDEO_VID_480P;
++ id = 2;
+ else
+- vid = -1;
++ id = 0;
+ }
+- return vid;
++ return id;
+ }
+
+-static int ps3av_hdmi_get_vid(struct ps3av_info_monitor *info)
++static int ps3av_hdmi_get_id(struct ps3av_info_monitor *info)
+ {
+ u32 res_50, res_60;
+- int vid = -1;
++ int id;
+
+ if (info->monitor_type != PS3AV_MONITOR_TYPE_HDMI)
+- return -1;
++ return 0;
+
+ /* check native resolution */
+ res_50 = info->res_50.native & PS3AV_RES_MASK_50;
+ res_60 = info->res_60.native & PS3AV_RES_MASK_60;
+ if (res_50 || res_60) {
+- vid = ps3av_resbit2vid(res_50, res_60);
+- return vid;
++ id = ps3av_resbit2id(res_50, res_60);
++ return id;
+ }
+
+ /* check resolution */
+ res_50 = info->res_50.res_bits & PS3AV_RES_MASK_50;
+ res_60 = info->res_60.res_bits & PS3AV_RES_MASK_60;
+ if (res_50 || res_60) {
+- vid = ps3av_resbit2vid(res_50, res_60);
+- return vid;
++ id = ps3av_resbit2id(res_50, res_60);
++ return id;
+ }
+
+ if (ps3av->region & PS3AV_REGION_60)
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_60;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+ else
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_50;
+- return vid;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
++ return id;
+ }
+
+ static void ps3av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info)
+@@ -698,11 +688,11 @@ static void ps3av_monitor_info_dump(cons
+ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
+ int boot)
+ {
+- int i, res, vid = -1, dvi = 0, rgb = 0;
++ int i, res, id = 0, dvi = 0, rgb = 0;
+ struct ps3av_pkt_av_get_monitor_info monitor_info;
+ struct ps3av_info_monitor *info;
+
+- /* get vid for hdmi */
++ /* get mode id for hdmi */
+ for (i = 0; i < av_hw_conf->num_of_hdmi; i++) {
+ res = ps3av_cmd_video_get_monitor_info(&monitor_info,
+ PS3AV_CMD_AVPORT_HDMI_0 +
+@@ -718,49 +708,49 @@ static int ps3av_auto_videomode(struct p
+ break;
+ }
+ /* check HDMI */
+- vid = ps3av_hdmi_get_vid(info);
+- if (vid != -1) {
+- /* got valid vid */
++ id = ps3av_hdmi_get_id(info);
++ if (id) {
++ /* got valid mode id */
+ break;
+ }
+ }
+
+ if (dvi) {
+ /* DVI mode */
+- vid = PS3AV_DEFAULT_DVI_VID;
+- } else if (vid == -1) {
++ id = PS3AV_DEFAULT_DVI_MODE_ID;
++ } else if (!id) {
+ /* no HDMI interface or HDMI is off */
+ if (ps3av->region & PS3AV_REGION_60)
+- vid = PS3AV_DEFAULT_AVMULTI_VID_REG_60;
++ id = PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60;
+ else
+- vid = PS3AV_DEFAULT_AVMULTI_VID_REG_50;
++ id = PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50;
+ if (ps3av->region & PS3AV_REGION_RGB)
+ rgb = PS3AV_MODE_RGB;
+ } else if (boot) {
+- /* HDMI: using DEFAULT HDMI_VID while booting up */
++ /* HDMI: using DEFAULT HDMI_MODE_ID while booting up */
+ info = &monitor_info.info;
+ if (ps3av->region & PS3AV_REGION_60) {
+ if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_60;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+ else if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_50;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
+ else {
+ /* default */
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_60;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+ }
+ } else {
+ if (info->res_50.res_bits & PS3AV_RESBIT_720x576P)
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_50;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
+ else if (info->res_60.res_bits & PS3AV_RESBIT_720x480P)
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_60;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+ else {
+ /* default */
+- vid = PS3AV_DEFAULT_HDMI_VID_REG_50;
++ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
+ }
+ }
+ }
+
+- return (ps3av_vid2table_id(vid) | dvi | rgb);
++ return id | dvi | rgb;
+ }
+
+ static int ps3av_get_hw_conf(struct ps3av *ps3av)
+--- a/include/asm-powerpc/ps3av.h
++++ b/include/asm-powerpc/ps3av.h
+@@ -300,11 +300,12 @@
+
+ #define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */
+ #define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */
+-#define PS3AV_DEFAULT_HDMI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480P
+-#define PS3AV_DEFAULT_AVMULTI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480I
+-#define PS3AV_DEFAULT_HDMI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576P
+-#define PS3AV_DEFAULT_AVMULTI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576I
+-#define PS3AV_DEFAULT_DVI_VID PS3AV_CMD_VIDEO_VID_480P
++
++#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_60 2 /* 480p */
++#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60 1 /* 480i */
++#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_50 7 /* 576p */
++#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50 6 /* 576i */
++#define PS3AV_DEFAULT_DVI_MODE_ID 2 /* 480p */
+
+ #define PS3AV_REGION_60 0x01
+ #define PS3AV_REGION_50 0x02
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-vesa-autodetect.diff new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-vesa-autodetect.diff
--- old/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-vesa-autodetect.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ppc-ps3video-ps3-wip_ps3av-vesa-autodetect.diff 2007-08-16 08:16:39.000000000 +0200
@@ -0,0 +1,165 @@
+Subject: ps3av: add autodetection for VESA modes
+
+ps3av: add autodetection for VESA modes
+
+Signed-off-by: Geert Uytterhoeven
+---
+ drivers/ps3/ps3av.c | 93 ++++++++++++++++++++++++++------------------
+ include/asm-powerpc/ps3av.h | 11 ++++-
+ 2 files changed, 67 insertions(+), 37 deletions(-)
+
+--- a/drivers/ps3/ps3av.c
++++ b/drivers/ps3/ps3av.c
+@@ -567,54 +567,73 @@ static void ps3avd(struct work_struct *w
+ complete(&ps3av->done);
+ }
+
+-static int ps3av_resbit2id(u32 res_50, u32 res_60)
++#define SHIFT_50 0
++#define SHIFT_60 4
++#define SHIFT_VESA 8
++
++static const struct {
++ unsigned mask : 19;
++ unsigned id : 4;
++} ps3av_preferred_modes[] = {
++ { .mask = PS3AV_RESBIT_WUXGA << SHIFT_VESA, .id = 13 },
++ { .mask = PS3AV_RESBIT_1920x1080P << SHIFT_60, .id = 5 },
++ { .mask = PS3AV_RESBIT_1920x1080P << SHIFT_50, .id = 10 },
++ { .mask = PS3AV_RESBIT_1920x1080I << SHIFT_60, .id = 4 },
++ { .mask = PS3AV_RESBIT_1920x1080I << SHIFT_50, .id = 9 },
++ { .mask = PS3AV_RESBIT_SXGA << SHIFT_VESA, .id = 12 },
++ { .mask = PS3AV_RESBIT_WXGA << SHIFT_VESA, .id = 11 },
++ { .mask = PS3AV_RESBIT_1280x720P << SHIFT_60, .id = 3 },
++ { .mask = PS3AV_RESBIT_1280x720P << SHIFT_50, .id = 8 },
++ { .mask = PS3AV_RESBIT_720x480P << SHIFT_60, .id = 2 },
++ { .mask = PS3AV_RESBIT_720x576P << SHIFT_50, .id = 7 },
++};
++
++static int ps3av_resbit2id(u32 res_50, u32 res_60, u32 res_vesa)
+ {
+- int id = 0;
++ unsigned int i;
++ u32 res_all;
+
+- if (res_50 > res_60) { /* if res_50 == res_60, res_60 will be used */
+- if (res_50 & PS3AV_RESBIT_1920x1080P)
+- id = 10;
+- else if (res_50 & PS3AV_RESBIT_1920x1080I)
+- id = 9;
+- else if (res_50 & PS3AV_RESBIT_1280x720P)
+- id = 8;
+- else if (res_50 & PS3AV_RESBIT_720x576P)
+- id = 7;
+- else
+- id = 0;
+- } else {
+- if (res_60 & PS3AV_RESBIT_1920x1080P)
+- id = 5;
+- else if (res_60 & PS3AV_RESBIT_1920x1080I)
+- id = 4;
+- else if (res_60 & PS3AV_RESBIT_1280x720P)
+- id = 3;
+- else if (res_60 & PS3AV_RESBIT_720x480P)
+- id = 2;
+- else
+- id = 0;
+- }
+- return id;
++ /*
++ * We mask off the resolution bits we care about and combine the
++ * results in one bitfield, so make sure there's no overlap
++ */
++ BUILD_BUG_ON(PS3AV_RES_MASK_50 << SHIFT_50 &
++ PS3AV_RES_MASK_60 << SHIFT_60);
++ BUILD_BUG_ON(PS3AV_RES_MASK_50 << SHIFT_50 &
++ PS3AV_RES_MASK_VESA << SHIFT_VESA);
++ BUILD_BUG_ON(PS3AV_RES_MASK_60 << SHIFT_60 &
++ PS3AV_RES_MASK_VESA << SHIFT_VESA);
++ res_all = (res_50 & PS3AV_RES_MASK_50) << SHIFT_50 |
++ (res_60 & PS3AV_RES_MASK_60) << SHIFT_60 |
++ (res_vesa & PS3AV_RES_MASK_VESA) << SHIFT_VESA;
++
++ if (!res_all)
++ return 0;
++
++ for (i = 0; i < ARRAY_SIZE(ps3av_preferred_modes); i++)
++ if (res_all & ps3av_preferred_modes[i].mask)
++ return ps3av_preferred_modes[i].id;
++
++ return 0;
+ }
+
+ static int ps3av_hdmi_get_id(struct ps3av_info_monitor *info)
+ {
+- u32 res_50, res_60;
+ int id;
+
+ /* check native resolution */
+- res_50 = info->res_50.native & PS3AV_RES_MASK_50;
+- res_60 = info->res_60.native & PS3AV_RES_MASK_60;
+- if (res_50 || res_60) {
+- id = ps3av_resbit2id(res_50, res_60);
++ id = ps3av_resbit2id(info->res_50.native, info->res_60.native,
++ info->res_vesa.native);
++ if (id) {
++ pr_info("%s: Using native mode %d\n", __func__, id);
+ return id;
+ }
+
+- /* check resolution */
+- res_50 = info->res_50.res_bits & PS3AV_RES_MASK_50;
+- res_60 = info->res_60.res_bits & PS3AV_RES_MASK_60;
+- if (res_50 || res_60) {
+- id = ps3av_resbit2id(res_50, res_60);
++ /* check supported resolutions */
++ id = ps3av_resbit2id(info->res_50.res_bits, info->res_60.res_bits,
++ info->res_vesa.res_bits);
++ if (id) {
++ pr_info("%s: Using supported mode %d\n", __func__, id);
+ return id;
+ }
+
+@@ -622,6 +641,7 @@ static int ps3av_hdmi_get_id(struct ps3a
+ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_60;
+ else
+ id = PS3AV_DEFAULT_HDMI_MODE_ID_REG_50;
++ pr_info("%s: Using default mode %d\n", __func__, id);
+ return id;
+ }
+
+@@ -718,6 +738,7 @@ static int ps3av_auto_videomode(struct p
+ id = PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50;
+ if (ps3av->region & PS3AV_REGION_RGB)
+ rgb = PS3AV_MODE_RGB;
++ pr_info("%s: Using avmulti mode %d\n", __func__, id);
+ } else if (boot) {
+ /* HDMI: using DEFAULT HDMI_MODE_ID while booting up */
+ info = &monitor_info.info;
+--- a/include/asm-powerpc/ps3av.h
++++ b/include/asm-powerpc/ps3av.h
+@@ -283,7 +283,7 @@
+ #define PS3AV_CMD_VIDEO_CS_YUV422 0x0002
+ #define PS3AV_CMD_VIDEO_CS_YUV444 0x0003
+
+-/* for automode */
++/* for broadcast automode */
+ #define PS3AV_RESBIT_720x480P 0x0003 /* 0x0001 | 0x0002 */
+ #define PS3AV_RESBIT_720x576P 0x0003 /* 0x0001 | 0x0002 */
+ #define PS3AV_RESBIT_1280x720P 0x0004
+@@ -298,6 +298,15 @@
+ | PS3AV_RESBIT_1920x1080I \
+ | PS3AV_RESBIT_1920x1080P)
+
++/* for VESA automode */
++#define PS3AV_RESBIT_VGA 0x0001
++#define PS3AV_RESBIT_WXGA 0x0002
++#define PS3AV_RESBIT_SXGA 0x0004
++#define PS3AV_RESBIT_WUXGA 0x0008
++#define PS3AV_RES_MASK_VESA (PS3AV_RESBIT_WXGA |\
++ PS3AV_RESBIT_SXGA |\
++ PS3AV_RESBIT_WUXGA)
++
+ #define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */
+ #define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/patches.arch/ps3-storage-fix-probe-region-loop.diff new/ps3-linux-patches/patches.arch/ps3-storage-fix-probe-region-loop.diff
--- old/ps3-linux-patches/patches.arch/ps3-storage-fix-probe-region-loop.diff 1970-01-01 01:00:00.000000000 +0100
+++ new/ps3-linux-patches/patches.arch/ps3-storage-fix-probe-region-loop.diff 2007-08-16 10:44:14.000000000 +0200
@@ -0,0 +1,105 @@
+Subject: PS3: Fix storage probe logic
+
+With the current PS3 storage probe logic there is a chance that device
+regions may appear in the repository some time after the device appears.
+Add a check to return -EAGAIN when a device is found in the repository
+with no regions.
+
+To make this more robust, the probe could cycle through the bus devices
+until no changes are found. The current logic waits on each device until
+it finds some regions, then goes to the next device. This will loop
+endlessly on the device if no regions ever appear for that device, and
+also will only register the regions found at the time the first region
+is found. Seems to work OK though.
+
+CC: Geert Uytterhoeven
+Signed-off-by: Geoff Levand
+---
+ arch/powerpc/platforms/ps3/device-init.c | 36 +++++++++++++++++++------------
+ 1 files changed, 23 insertions(+), 13 deletions(-)
+
+Index: linux/arch/powerpc/platforms/ps3/device-init.c
+===================================================================
+--- linux.orig/arch/powerpc/platforms/ps3/device-init.c
++++ linux/arch/powerpc/platforms/ps3/device-init.c
+@@ -416,6 +416,9 @@ static int ps3_setup_storage_dev(const s
+ "num_regions %u\n", __func__, __LINE__, repo->bus_index,
+ repo->dev_index, port, blk_size, num_blocks, num_regions);
+
++ if (!num_regions)
++ return -EAGAIN;
++
+ p = kzalloc(sizeof(struct ps3_storage_device) +
+ num_regions * sizeof(struct ps3_storage_region),
+ GFP_KERNEL);
+@@ -617,32 +620,28 @@ static int ps3_register_repository_devic
+ case PS3_DEV_TYPE_STOR_DISK:
+ result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK);
+
+- /* Some devices are not accessable from the Other OS lpar. */
+- if (result == -ENODEV) {
+- result = 0;
+- pr_debug("%s:%u: not accessable\n", __func__,
++ if (result == -EAGAIN)
++ pr_debug("%s:%u: device not ready\n", __func__,
+ __LINE__);
+- }
+-
+- if (result)
++ else if (result)
+ pr_debug("%s:%u ps3_setup_storage_dev failed\n",
+ __func__, __LINE__);
+ break;
+-
+ case PS3_DEV_TYPE_STOR_ROM:
+ result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_ROM);
+- if (result)
++ if (result == -EAGAIN)
++ pr_debug("%s:%u: device not ready\n", __func__,
++ __LINE__);
++ else if (result)
+ pr_debug("%s:%u ps3_setup_storage_dev failed\n",
+ __func__, __LINE__);
+ break;
+-
+ case PS3_DEV_TYPE_STOR_FLASH:
+ result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_FLASH);
+ if (result)
+ pr_debug("%s:%u ps3_setup_storage_dev failed\n",
+ __func__, __LINE__);
+ break;
+-
+ default:
+ result = 0;
+ pr_debug("%s:%u: unsupported dev_type %u\n", __func__, __LINE__,
+@@ -656,6 +655,13 @@ static int ps3_register_repository_devic
+ * ps3_probe_thread - Background repository probing at system startup.
+ *
+ * This implementation only supports background probing on a single bus.
++ *
++ * To make this more robust, the probe could cycle through the bus devices
++ * until no changes are found. The current logic waits on each device until
++ * it finds some regions, then goes to the next device. This will loop
++ * endlessly on the device if no regions ever appear for that device, and
++ * also will only register the regions found at the time the first region
++ * is found. Seems to work OK though.
+ */
+
+ static int ps3_probe_thread(void *data)
+@@ -683,9 +689,14 @@ static int ps3_probe_thread(void *data)
+ else {
+ pr_debug("%s:%u: found device\n", __func__,
+ __LINE__);
+- ps3_register_repository_device(repo);
+- ps3_repository_bump_device(repo);
++ result = ps3_register_repository_device(repo);
++
+ ms = 250;
++ if (result == -EAGAIN)
++ break;
++
++ ps3_repository_bump_device(repo);
++
+ }
+ } while (!result);
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/series new/ps3-linux-patches/series
--- old/ps3-linux-patches/series 2007-07-23 10:25:00.000000000 +0200
+++ new/ps3-linux-patches/series 2007-08-16 10:27:09.000000000 +0200
@@ -65,5 +65,14 @@
patches.arch/ppc-ps3tree-ps3-wip_ps3-wip-defconfig-updates.patch
patches.arch/ppc-ps3tree-ps3-wip_ps3fb_dev_dbg.diff
patches.arch/ppc-ps3-storage-2623.patch
-# PS3 git snapshot
-
+ patches.arch/ppc-ps3-fix-storage-logic.patch
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-temporaries.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-PS3AV_DEBUG.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-use-mode-id-in-autodetect.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-dvi-autodetect.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-vesa-autodetect.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-unused-ps3av_set_mode.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-boot-parameter.diff
+
+ patches.arch/ps3-storage-fix-probe-region-loop.diff
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/series~ new/ps3-linux-patches/series~
--- old/ps3-linux-patches/series~ 2007-07-23 10:24:35.000000000 +0200
+++ new/ps3-linux-patches/series~ 2007-08-16 08:33:01.000000000 +0200
@@ -1,4 +1,4 @@
- # PS3 git snapshot: ffc742be975446e7520980f77d144b6d5cc412cc
+ # PS3 git snapshot
patches.arch/ppc-ps3tree-ps3-stable_cell-add-spu-shutdown-method.diff
patches.arch/ppc-ps3tree-ps3-stable_ps3-rename-ipi-symbols.diff
patches.arch/ppc-ps3tree-ps3-stable_ps3-maybe-unused.diff
@@ -65,5 +65,13 @@
patches.arch/ppc-ps3tree-ps3-wip_ps3-wip-defconfig-updates.patch
patches.arch/ppc-ps3tree-ps3-wip_ps3fb_dev_dbg.diff
patches.arch/ppc-ps3-storage-2623.patch
-# PS3 git snapshot endpatches.arch/ppc-ps3-device-init.patch
-
+ patches.arch/ppc-ps3-fix-storage-logic.patch
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-temporaries.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-PS3AV_DEBUG.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-use-mode-id-in-autodetect.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-dvi-autodetect.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-vesa-autodetect.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-monitor-quirks.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-unused-ps3av_set_mode.diff
+ patches.arch/ppc-ps3video-ps3-wip_ps3av-kill-boot-parameter.diff
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ps3-linux-patches/series.orig new/ps3-linux-patches/series.orig
--- old/ps3-linux-patches/series.orig 2007-07-17 16:06:06.000000000 +0200
+++ new/ps3-linux-patches/series.orig 2007-08-15 10:16:07.000000000 +0200
@@ -1,65 +1,70 @@
-ppc-ps3tree-other_console_unregistration.diff
-ppc-ps3tree-other_Documentation-block-barrier.txt-update.diff
-ppc-ps3tree-other_scsi-shost_priv.diff
-ppc-ps3tree-ps3-hacks_ps3-legacy-bootloader-hack.diff
-ppc-ps3tree-ps3-stable_cell-add-spu-shutdown-method.diff
-ppc-ps3tree-ps3-stable_powerpc-correct-secondary_hold-comment.diff
-ppc-ps3tree-ps3-stable_powerpc-localize-mmu-off.diff
-ppc-ps3tree-ps3-stable_powerpc-print-params-value.diff
-ppc-ps3tree-ps3-stable_powerpc-zimage-const-args.diff
-ppc-ps3tree-ps3-stable_powerpc-zimage-global-kernel_entry_t.diff
-ppc-ps3tree-ps3-stable_powerpc-zimage-signed-types.diff
-ppc-ps3tree-ps3-stable_powerpc-zimage-u64-printf.diff
-ppc-ps3tree-ps3-stable_ps3av-hdmi-rgb-range.diff
-ppc-ps3tree-ps3-stable_ps3av-include.diff
-ppc-ps3tree-ps3-stable_ps3-compare-firmware-version.diff
-ppc-ps3tree-ps3-stable_ps3-device-init.diff
-ppc-ps3tree-ps3-stable_ps3-dts.patch
-ppc-ps3tree-ps3-stable_ps3-gelic.diff
-ppc-ps3tree-ps3-stable_ps3-inline-DBG.diff
-ppc-ps3tree-ps3-stable_ps3-kexec-fixes.diff
-ppc-ps3tree-ps3-stable_ps3-maybe-unused.diff
-ppc-ps3tree-ps3-stable_ps3-move-chip-routines-up.diff
-ppc-ps3tree-ps3-stable_ps3-rename-ipi-symbols.diff
-ppc-ps3tree-ps3-stable_ps3-rename-processor-id-symbols.diff
-ppc-ps3tree-ps3-stable_ps3-repository-probe-cleanups.diff
-ppc-ps3tree-ps3-stable_ps3-select-mem-hotplug.diff
-ppc-ps3tree-ps3-stable_ps3-sparse-warnings2.diff
-ppc-ps3tree-ps3-stable_ps3-sparse-warnings.diff
-ppc-ps3tree-ps3-stable_ps3stor_bus.diff
-ppc-ps3tree-ps3-stable_ps3stor_disk.diff
-ppc-ps3tree-ps3-stable_ps3stor_flash_bootmem.diff
-ppc-ps3tree-ps3-stable_ps3stor_flash.diff
-ppc-ps3tree-ps3-stable_ps3stor_probe.diff
-ppc-ps3tree-ps3-stable_ps3stor_rom.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-add-modinfo-attribute.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-rework.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-rework-ps3av.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-rework-ps3fb.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-rework-sys-manager.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-rework-usb.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-rework-vuart.diff
-ppc-ps3tree-ps3-stable_ps3-system-bus-uevent.diff
-ppc-ps3tree-ps3-stable_ps3-update-defconfigs.diff
-ppc-ps3tree-ps3-stable_ps3-usb-fix-return.diff
-ppc-ps3tree-ps3-stable_ps3-use-clear_bit.diff
-ppc-ps3tree-ps3-stable_ps3-use-ioremap-flags.diff
-ppc-ps3tree-ps3-stable_ps3-zimage-zerocopy.diff
-ppc-ps3tree-ps3-wip_cell-usb-workaround-ehci-iso.diff
-ppc-ps3tree-ps3-wip_ps3-bt-event-filter.diff
-ppc-ps3tree-ps3-wip_ps3fb_dev_dbg.diff
-ppc-ps3tree-ps3-wip_ps3fb-unregister.diff
-ppc-ps3tree-ps3-wip_ps3-gelic-wireless.diff
-ppc-ps3tree-ps3-wip_ps3-quick-fix-boot-game-os.diff
-ppc-ps3tree-ps3-wip_ps3-sound.diff
-ppc-ps3tree-ps3-wip_ps3-system-bus-status.diff
-ppc-ps3tree-ps3-wip_ps3-wip-defconfig-updates.patch
-ppc-ps3tree-ps3-wip_ps3-zimage-debug.diff
-ppc-ps3tree-ps3-wip_ps3-zimage-verbose.diff
-ppc-ps3tree-ps3-wip_spufs-clear-class-0-interrupt.diff
-ppc-ps3tree-ps3-wip_spufs-wrap-master-run-bit.diff
-ppc-ps3tree-spe-logo_fb_append_extra_logo.diff
-ppc-ps3tree-spe-logo_fb_show_logo_line.diff
-ppc-ps3tree-spe-logo_logo-extern-in-header.diff
-ppc-ps3tree-spe-logo_logo-extra-spe-glue-2.6.21.diff
-ppc-ps3tree-spe-logo_logo_spe_clut224.diff
+ # PS3 git snapshot
+ patches.arch/ppc-ps3tree-ps3-stable_cell-add-spu-shutdown-method.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-rename-ipi-symbols.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-maybe-unused.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-compare-firmware-version.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-use-ioremap-flags.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-sparse-warnings.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3av-hdmi-rgb-range.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-move-chip-routines-up.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-inline-DBG.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-kexec-fixes.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-rework.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-uevent.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-add-modinfo-attribute.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-repository-probe-cleanups.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-rework-vuart.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-rework-sys-manager.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-rework-ps3av.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-rework-ps3fb.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-device-init.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-rename-processor-id-symbols.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-use-clear_bit.diff
+ patches.arch/ppc-ps3tree-ps3-stable_powerpc-print-params-value.diff
+ patches.arch/ppc-ps3tree-ps3-stable_powerpc-localize-mmu-off.diff
+ patches.arch/ppc-ps3tree-ps3-stable_powerpc-correct-secondary_hold-comment.diff
+ patches.arch/ppc-ps3tree-ps3-stable_powerpc-zimage-signed-types.diff
+ patches.arch/ppc-ps3tree-ps3-stable_powerpc-zimage-u64-printf.diff
+ patches.arch/ppc-ps3tree-ps3-stable_powerpc-zimage-const-args.diff
+ patches.arch/ppc-ps3tree-ps3-stable_powerpc-zimage-global-kernel_entry_t.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-dts.patch
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-zimage-zerocopy.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-select-mem-hotplug.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-sparse-warnings2.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-system-bus-rework-usb.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-usb-fix-return.diff
+ patches.arch/ppc-ps3tree-other_scsi-shost_priv.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3stor_flash_bootmem.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3stor_bus.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3stor_probe.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3stor_disk.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3stor_rom.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3stor_flash.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-gelic.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3-update-defconfigs.diff
+ patches.arch/ppc-ps3tree-ps3-stable_ps3av-include.diff
+ patches.arch/ppc-ps3tree-other_Documentation-block-barrier.txt-update.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-gelic-wireless.diff
+ patches.arch/ppc-ps3tree-spe-logo_fb_show_logo_line.diff
+ patches.arch/ppc-ps3tree-spe-logo_logo-extern-in-header.diff
+ patches.arch/ppc-ps3tree-spe-logo_fb_append_extra_logo.diff
+ patches.arch/ppc-ps3tree-spe-logo_logo_spe_clut224.diff
+ patches.arch/ppc-ps3tree-spe-logo_logo-extra-spe-glue-2.6.21.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-sound.diff
+ patches.arch/ppc-ps3tree-ps3-wip_spufs-clear-class-0-interrupt.diff
+ patches.arch/ppc-ps3tree-ps3-wip_spufs-wrap-master-run-bit.diff
+ patches.arch/ppc-ps3tree-ps3-wip_cell-usb-workaround-ehci-iso.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-bt-event-filter.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-zimage-verbose.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-quick-fix-boot-game-os.diff
+ patches.arch/ppc-ps3tree-other_console_unregistration.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3fb-unregister.diff
+ patches.arch/ppc-ps3tree-ps3-hacks_ps3-legacy-bootloader-hack.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-system-bus-status.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-zimage-debug.diff
+ patches.arch/ppc-ps3tree-ps3-wip_ps3-wip-defconfig-updates.patch
+ patches.arch/ppc-ps3tree-ps3-wip_ps3fb_dev_dbg.diff
+ patches.arch/ppc-ps3-storage-2623.patch
+ patches.arch/ppc-ps3-fix-storage-logic.patch
+# PS3 git snapshot
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org