ODROID-COMMON: osd: Update osd for portrait modes

Change-Id: Ibc0ba560d9db8875e9d676dee8511fc29cd09a51
This commit is contained in:
Joy Cho
2021-03-02 16:49:38 +09:00
parent 20d79ab6a5
commit 999a027ee1
3 changed files with 13 additions and 11 deletions

View File

@@ -665,7 +665,8 @@ static int osd_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
var->transp.length, var->transp.offset);
fix->visual = color_format_pt->color_type;
/* adjust memory length. */
fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
fix->line_length =
CANVAS_ALIGNED(var->xres_virtual * var->bits_per_pixel / 8);
osd_log_dbg(MODULE_BASE, "xvirtual=%d, bpp:%d, line_length=%d\n",
var->xres_virtual, var->bits_per_pixel, fix->line_length);
@@ -4473,7 +4474,7 @@ static int osd_probe(struct platform_device *pdev)
(fbdev->color->color_index > 16 ?
(fbdev->color->color_index > 24 ?
4 : 3) : 2) : 1);
fix->line_length = var->xres_virtual * bpp;
fix->line_length = CANVAS_ALIGNED(var->xres_virtual * bpp);
fix->smem_start = fbdev->fb_mem_paddr;
fix->smem_len = fbdev->fb_len;
if (fb_alloc_cmap(&fbi->cmap, 16, 0) != 0) {

View File

@@ -585,7 +585,6 @@ static int pxp_mode;
s64 timestamp[VIU_COUNT];
static unsigned int osd_h_filter_mode = 1;
#define CANVAS_ALIGNED(x) (((x) + 31) & ~31)
#define BYTE_32_ALIGNED(x) (((x) + 31) & ~31)
#define BYTE_16_ALIGNED(x) (((x) + 15) & ~15)
#define BYTE_8_ALIGNED(x) (((x) + 7) & ~7)
@@ -2892,7 +2891,7 @@ void osd_setup_hw(u32 index,
else {
canvas_config(osd_hw.fb_gem[index].canvas_idx,
osd_hw.fb_gem[index].addr,
osd_hw.fb_gem[index].width,
CANVAS_ALIGNED(osd_hw.fb_gem[index].width),
osd_hw.fb_gem[index].height,
CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
}
@@ -4330,7 +4329,7 @@ static bool osd_direct_compose_pan_display(struct osd_fence_map_s *fence_map)
if (!osd_hw.osd_afbcd[index].enable) {
canvas_config(osd_hw.fb_gem[index].canvas_idx,
ext_addr,
fence_map->byte_stride,
CANVAS_ALIGNED(fence_map->byte_stride),
fence_map->height,
CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
osd_hw.screen_base[index] = ext_addr;
@@ -4683,7 +4682,8 @@ static void osd_pan_display_single_fence(struct osd_fence_map_s *fence_map)
canvas_config(osd_hw.fb_gem[index].canvas_idx,
osd_hw.fb_gem[index].addr,
osd_hw.fb_gem[index].width,
CANVAS_ALIGNED(
osd_hw.fb_gem[index].width),
osd_hw.fb_gem[index].height,
CANVAS_ADDR_NOWRAP,
CANVAS_BLKMODE_LINEAR);
@@ -8796,7 +8796,7 @@ static void osd_setting_old_hwc(void)
if (!osd_hw.osd_afbcd[index].enable)
canvas_config(osd_hw.fb_gem[index].canvas_idx,
osd_hw.fb_gem[index].addr,
osd_hw.fb_gem[index].width,
CANVAS_ALIGNED(osd_hw.fb_gem[index].width),
osd_hw.fb_gem[index].height,
CANVAS_ADDR_NOWRAP,
CANVAS_BLKMODE_LINEAR);
@@ -8838,7 +8838,7 @@ static void osd_setting_viu2(void)
if (!osd_hw.osd_afbcd[index].enable)
canvas_config(osd_hw.fb_gem[index].canvas_idx,
osd_hw.fb_gem[index].addr,
osd_hw.fb_gem[index].width,
CANVAS_ALIGNED(osd_hw.fb_gem[index].width),
osd_hw.fb_gem[index].height,
CANVAS_ADDR_NOWRAP,
CANVAS_BLKMODE_LINEAR);
@@ -10323,7 +10323,7 @@ void osd_restore_hw(void)
for (i = 0; i < osd_hw.osd_meson_dev.osd_count; i++)
canvas_config(osd_hw.fb_gem[i].canvas_idx,
osd_hw.fb_gem[i].addr,
osd_hw.fb_gem[i].width,
CANVAS_ALIGNED(osd_hw.fb_gem[i].width),
osd_hw.fb_gem[i].height,
CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
}
@@ -10665,7 +10665,7 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
} else {
canvas_config(osd_hw.fb_gem[index].canvas_idx,
phy_addr,
plane_map->byte_stride,
CANVAS_ALIGNED(plane_map->byte_stride),
plane_map->src_h,
CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
}
@@ -10914,7 +10914,7 @@ static void osd_cursor_move(struct osd_plane_map_s *plane_map)
plane_map->byte_stride * plane_map->src_h;
canvas_config(osd_hw.fb_gem[index].canvas_idx,
phy_addr,
plane_map->byte_stride,
CANVAS_ALIGNED(plane_map->byte_stride),
plane_map->src_h,
CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);

View File

@@ -23,6 +23,7 @@
#include "osd_sync.h"
#include "osd_drm.h"
#define CANVAS_ALIGNED(x) (((x) + 63) & ~63)
#define MAX_HOLD_LINE 0x1f
#define MIN_HOLD_LINE 0x04
#define VIU1_DEFAULT_HOLD_LINE 0x08