mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 14:33:38 +00:00
ACRN:DM:VGPU: Fix the incorrect offset for EDID detailed_timing_block
The EDID uses the bytes of 54-125 to define the four detailed_timing_blocks. But the static offset is used to update the DTB. This will cause that the incorrect offset is used for DTB if the edid_generate is called several times. Tracked-On: #7376 Acked-by: Wang Yu <yu1.wang@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
parent
9aa373aa3a
commit
4972d29c2d
@ -353,22 +353,17 @@ vdpy_edid_set_dtd(uint8_t *dtd, const frame_param *frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vdpy_edid_set_descripter(uint8_t *edid, uint8_t is_dtd,
|
vdpy_edid_set_descripter(uint8_t *desc, uint8_t is_dtd,
|
||||||
uint8_t tag, const base_param *b_param)
|
uint8_t tag, const base_param *b_param)
|
||||||
{
|
{
|
||||||
static uint8_t offset;
|
|
||||||
uint8_t *desc;
|
|
||||||
frame_param frame;
|
frame_param frame;
|
||||||
const char* text;
|
const char* text;
|
||||||
uint16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
offset = 54;
|
|
||||||
desc = edid + offset;
|
|
||||||
|
|
||||||
if (is_dtd) {
|
if (is_dtd) {
|
||||||
vdpy_edid_set_frame(&frame, b_param);
|
vdpy_edid_set_frame(&frame, b_param);
|
||||||
vdpy_edid_set_dtd(desc, &frame);
|
vdpy_edid_set_dtd(desc, &frame);
|
||||||
offset += 18;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
desc[3] = tag;
|
desc[3] = tag;
|
||||||
@ -408,7 +403,6 @@ vdpy_edid_set_descripter(uint8_t *edid, uint8_t is_dtd,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
offset += 18;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t
|
static uint8_t
|
||||||
@ -431,6 +425,7 @@ vdpy_edid_generate(uint8_t *edid, size_t size, struct edid_info *info)
|
|||||||
uint16_t id_manuf;
|
uint16_t id_manuf;
|
||||||
uint16_t id_product;
|
uint16_t id_product;
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
|
uint8_t *desc;
|
||||||
base_param b_param, c_param;
|
base_param b_param, c_param;
|
||||||
|
|
||||||
vdpy_edid_set_baseparam(&b_param, info->prefx, info->prefy);
|
vdpy_edid_set_baseparam(&b_param, info->prefx, info->prefy);
|
||||||
@ -496,15 +491,19 @@ vdpy_edid_generate(uint8_t *edid, size_t size, struct edid_info *info)
|
|||||||
|
|
||||||
/* edid[125:54], Detailed Timing Descriptor - 18 bytes x 4 */
|
/* edid[125:54], Detailed Timing Descriptor - 18 bytes x 4 */
|
||||||
// Detailed Timing Descriptor 1
|
// Detailed Timing Descriptor 1
|
||||||
|
desc = edid + 54;
|
||||||
vdpy_edid_set_baseparam(&c_param, VDPY_MAX_WIDTH, VDPY_MAX_HEIGHT);
|
vdpy_edid_set_baseparam(&c_param, VDPY_MAX_WIDTH, VDPY_MAX_HEIGHT);
|
||||||
vdpy_edid_set_descripter(edid, 0x1, 0, &c_param);
|
vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
|
||||||
// Detailed Timing Descriptor 2
|
// Detailed Timing Descriptor 2
|
||||||
|
desc += 18;
|
||||||
vdpy_edid_set_baseparam(&c_param, VDPY_DEFAULT_WIDTH, VDPY_DEFAULT_HEIGHT);
|
vdpy_edid_set_baseparam(&c_param, VDPY_DEFAULT_WIDTH, VDPY_DEFAULT_HEIGHT);
|
||||||
vdpy_edid_set_descripter(edid, 0x1, 0, &c_param);
|
vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
|
||||||
// Display Product Name (ASCII) String Descriptor (tag #FCh)
|
// Display Product Name (ASCII) String Descriptor (tag #FCh)
|
||||||
vdpy_edid_set_descripter(edid, 0, 0xfc, &b_param);
|
desc += 18;
|
||||||
|
vdpy_edid_set_descripter(desc, 0, 0xfc, &b_param);
|
||||||
// Display Product Serial Number Descriptor (tag #FFh)
|
// Display Product Serial Number Descriptor (tag #FFh)
|
||||||
vdpy_edid_set_descripter(edid, 0, 0xff, &b_param);
|
desc += 18;
|
||||||
|
vdpy_edid_set_descripter(desc, 0, 0xff, &b_param);
|
||||||
|
|
||||||
/* EDID[126], Extension Block Count */
|
/* EDID[126], Extension Block Count */
|
||||||
edid[126] = 0; // no Extension Block
|
edid[126] = 0; // no Extension Block
|
||||||
|
Loading…
Reference in New Issue
Block a user