diff --git a/linux/ps4-kexec-common/firmware.c b/linux/ps4-kexec-common/firmware.c index 0d7066e..4da71e1 100644 --- a/linux/ps4-kexec-common/firmware.c +++ b/linux/ps4-kexec-common/firmware.c @@ -384,8 +384,8 @@ ssize_t firmware_extract(void *dest) cpio_hdr(&p, "lib", DIR, 0); cpio_hdr(&p, "lib/firmware", DIR, 0); - /** We need detect the size of edid first, on some monitor it is 128 on other 256 bytes, so for now remove it **/ - int edid_sz = (((unsigned char*)kern.edid)[126]?256:128); + int ext_blocks = ((unsigned char*)kern.edid)[126]; + int edid_sz = 128 * (1 + ext_blocks); cpio_hdr(&p, "lib/firmware/edid", DIR, 0); cpio_hdr(&p, "lib/firmware/edid/my_edid.bin", FILE, edid_sz); copy_edid(&p, edid_sz); diff --git a/linux/ps4-kexec-common/firmware.h b/linux/ps4-kexec-common/firmware.h index 4835983..39d9b6c 100644 --- a/linux/ps4-kexec-common/firmware.h +++ b/linux/ps4-kexec-common/firmware.h @@ -15,7 +15,7 @@ //sizes eap_hdd_key #define EAP_HDD_KEY_SIZE 0x20 -#define EDID_SIZE 256 +#define EDID_SIZE (128 * 256) // sizes for liverpool #define LVP_FW_CE_SIZE 8576 @@ -54,7 +54,7 @@ #define FW_HEADER_SIZE 256 // Leave space for 16 files (currently 12) -#define FW_CPIO_SIZE (EAP_HDD_KEY_SIZE /* + EDID_SIZE */ + (CPIO_HEADER_SIZE * 16) + FW_CE_SIZE + FW_ME_SIZE + \ +#define FW_CPIO_SIZE (EAP_HDD_KEY_SIZE + EDID_SIZE + (CPIO_HEADER_SIZE * 16) + FW_CE_SIZE + FW_ME_SIZE + \ FW_MEC_SIZE + FW_MEC2_SIZE + FW_PFP_SIZE + \ FW_RLC_SIZE + FW_SDMA_SIZE + FW_SDMA1_SIZE + \ FW_HEADER_SIZE * 8)