Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39773 )
Change subject: lib/edid: Drop bytes_per_line ......................................................................
lib/edid: Drop bytes_per_line
There where only two users of this field, but in both cases incorrectly implemented, as there was either no producer or no consumer.
Remove it as the same information is now be passed directly to the framebuffer info storage and thus it's no longer needed.
Change-Id: I898a9a36d7fa9b3529661dacd56c1adfacb606cd Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/aspeed/common/ast_mode_corebootfb.c M src/include/edid.h M src/lib/edid.c M src/northbridge/intel/i945/gma.c 4 files changed, 12 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/39773/1
diff --git a/src/drivers/aspeed/common/ast_mode_corebootfb.c b/src/drivers/aspeed/common/ast_mode_corebootfb.c index 8091802..4b57308 100644 --- a/src/drivers/aspeed/common/ast_mode_corebootfb.c +++ b/src/drivers/aspeed/common/ast_mode_corebootfb.c @@ -224,13 +224,12 @@ edid.x_resolution = edid.mode.ha; edid.y_resolution = edid.mode.va; edid.framebuffer_bits_per_pixel = format.cpp[0] * 8; - edid.bytes_per_line = ALIGN_UP(edid.x_resolution * format.cpp[0], 8);
/* Updated framebuffer info for ast_crtc_mode_set */ - fb.pitches[0] = edid.bytes_per_line; + fb.pitches[0] = ALIGN_UP(edid.x_resolution * format.cpp[0], 8);
printk(BIOS_DEBUG, "Using framebuffer %dpx x %dpx pitch %d @ %d BPP\n", - edid.x_resolution, edid.y_resolution, edid.bytes_per_line, + edid.x_resolution, edid.y_resolution, fb.pitches[0], edid.framebuffer_bits_per_pixel);
/* Convert EDID to AST DRM mode */ @@ -250,7 +249,7 @@ fb_add_framebuffer_info_from_edid(&edid, fb.mmio_addr, 8);
/* Clear display */ - memset((void *)fb.mmio_addr, 0, edid.bytes_per_line * edid.y_resolution); + memset((void *)fb.mmio_addr, 0, fb.pitches[0] * edid.y_resolution);
return 0; } diff --git a/src/include/edid.h b/src/include/edid.h index 02afae7..9733b0c 100644 --- a/src/include/edid.h +++ b/src/include/edid.h @@ -83,14 +83,13 @@ struct edid_mode mode; u8 mode_is_supported[NUM_KNOWN_MODES]; unsigned int link_clock; - /* 3 variables needed for coreboot framebuffer. + /* 2 variables needed for coreboot framebuffer. * In most cases, they are the same as the ha * and va variables, but not always, as in the * case of a 1366 wide display. */ u32 x_resolution; u32 y_resolution; - u32 bytes_per_line;
int hdmi_monitor_detected; char ascii_string[EDID_ASCII_STRING_LENGTH + 1]; diff --git a/src/lib/edid.c b/src/lib/edid.c index 048cc6a..473fc1b 100644 --- a/src/lib/edid.c +++ b/src/lib/edid.c @@ -1689,13 +1689,15 @@ void edid_set_framebuffer_bits_per_pixel(struct edid *edid, int fb_bpp, int row_byte_alignment) { + uint32_t bytes_per_line; + /* Caller should pass a supported value, everything else is BUG(). */ assert(fb_bpp == 32 || fb_bpp == 24 || fb_bpp == 16); row_byte_alignment = MAX(row_byte_alignment, 1);
edid->framebuffer_bits_per_pixel = fb_bpp; - edid->bytes_per_line = ALIGN_UP(edid->mode.ha * + bytes_per_line = ALIGN_UP(edid->mode.ha * DIV_ROUND_UP(fb_bpp, 8), row_byte_alignment); - edid->x_resolution = edid->bytes_per_line / (fb_bpp / 8); + edid->x_resolution = bytes_per_line / (fb_bpp / 8); edid->y_resolution = edid->mode.va; } diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c index 1b1a1bf..078ab74 100644 --- a/src/northbridge/intel/i945/gma.c +++ b/src/northbridge/intel/i945/gma.c @@ -108,6 +108,7 @@ unsigned long temp; int hpolarity, vpolarity; u32 smallest_err = 0xffffffff; + u32 bytes_per_line; u32 target_frequency; u32 pixel_p1 = 1; u32 pixel_p2; @@ -314,10 +315,11 @@ write32(mmiobase + DSPSIZE(0), (hactive - 1) | ((vactive - 1) << 16)); write32(mmiobase + DSPPOS(0), 0);
- edid.bytes_per_line = (edid.bytes_per_line + 63) & ~63; + bytes_per_line = DIV_ROUND_UP(hactive * 32 / 8, 64); + write32(mmiobase + DSPADDR(0), 0); write32(mmiobase + DSPSURF(0), 0); - write32(mmiobase + DSPSTRIDE(0), edid.bytes_per_line); + write32(mmiobase + DSPSTRIDE(0), bytes_per_line); write32(mmiobase + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888 | DISPPLANE_SEL_PIPE_B | DISPPLANE_GAMMA_ENABLE); mdelay(1);
Marcello Sylvester Bauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39773 )
Change subject: lib/edid: Drop bytes_per_line ......................................................................
Patch Set 3:
Patchset working on a Lenovo X230 using tianocore payload.
Marcello Sylvester Bauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39773 )
Change subject: lib/edid: Drop bytes_per_line ......................................................................
Patch Set 3: Code-Review+1
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39773 )
Change subject: lib/edid: Drop bytes_per_line ......................................................................
Patch Set 5: Code-Review+2
Christian Walter has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39773 )
Change subject: lib/edid: Drop bytes_per_line ......................................................................
Patch Set 10: Code-Review+2
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/39773?usp=email )
Change subject: lib/edid: Drop bytes_per_line ......................................................................
Abandoned
This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author.