+ /* Add a default kernel video mode. */
+
+ if (!cod->kd->args) {
+ altered_args = 1;
+ orig_args = NULL;
+ cod->kd->args = talloc_asprintf(NULL, "video=ps3fb:mode:%u",
+ (unsigned int)ps3->values.video_mode);
+ } else if (!strstr(cod->kd->args, "video=")) {
+ altered_args = 1;
+ orig_args = cod->kd->args;
+ cod->kd->args = talloc_asprintf(NULL, "%s video=ps3fb:mode:%u",
+ orig_args, (unsigned int)ps3->values.video_mode);
+ } else
+ altered_args = 0;
+
+ result = pb_run_kexec(cod->kd);
+
+ if (altered_args) {
+ talloc_free(cod->kd->args);
+ cod->kd->args = orig_args;
+ }
+
+ return result;