msm: mdp: Fix reserved field usage
An earlier commit(ec5b2f)increased the number of reserved fields in the kernel standard fb.h header changing the struct size. This caused issues with userland applications using the corresponding bionic header. This patch revert the earlier increas in size and makes corresponding adjustments to the reserved field usage. A follow up patch will remove usage of reserved fields entirely.
This commit is contained in:
committed by
Iliyan Malchev
parent
220d113e4c
commit
8b1bd63cfb
@@ -1980,15 +1980,18 @@ bool hdmi_common_get_video_format_from_drv_data(struct msm_fb_data_type *mfd)
|
||||
uint32 format = HDMI_VFRMT_1920x1080p60_16_9;
|
||||
struct fb_var_screeninfo *var = &mfd->fbi->var;
|
||||
bool changed = TRUE;
|
||||
uint32_t userformat = 0;
|
||||
userformat = var->reserved[3] >> 16;
|
||||
|
||||
if (var->reserved[3]) {
|
||||
format = var->reserved[3]-1;
|
||||
if (userformat) {
|
||||
format = userformat-1;
|
||||
DEV_DBG("reserved format is %d\n", format);
|
||||
} else if (hdmi_prim_resolution) {
|
||||
format = hdmi_prim_resolution - 1;
|
||||
} else {
|
||||
DEV_DBG("detecting resolution from %dx%d use var->reserved[3]"
|
||||
" to specify mode", mfd->var_xres, mfd->var_yres);
|
||||
DEV_DBG("detecting resolution from %dx%d use top 2 bytes of"
|
||||
" var->reserved[3] to specify mode", mfd->var_xres,
|
||||
mfd->var_yres);
|
||||
switch (mfd->var_xres) {
|
||||
default:
|
||||
case 640:
|
||||
|
||||
@@ -380,6 +380,7 @@ static int mdp4_dtv_start(struct msm_fb_data_type *mfd)
|
||||
int data_en_polarity;
|
||||
int hsync_start_x;
|
||||
int hsync_end_x;
|
||||
uint32_t userformat;
|
||||
struct fb_info *fbi;
|
||||
struct fb_var_screeninfo *var;
|
||||
|
||||
@@ -413,9 +414,10 @@ static int mdp4_dtv_start(struct msm_fb_data_type *mfd)
|
||||
dtv_border_clr = mfd->panel_info.lcdc.border_clr;
|
||||
dtv_underflow_clr = mfd->panel_info.lcdc.underflow_clr;
|
||||
dtv_hsync_skew = mfd->panel_info.lcdc.hsync_skew;
|
||||
userformat = var->reserved[3] >> 16;
|
||||
|
||||
pr_info("%s: <ID=%d %dx%d (%d,%d,%d), (%d,%d,%d) %dMHz>\n", __func__,
|
||||
var->reserved[3], var->xres, var->yres,
|
||||
userformat, var->xres, var->yres,
|
||||
var->right_margin, var->hsync_len, var->left_margin,
|
||||
var->lower_margin, var->vsync_len, var->upper_margin,
|
||||
var->pixclock/1000/1000);
|
||||
|
||||
@@ -1334,14 +1334,14 @@ static int msm_fb_register(struct msm_fb_data_type *mfd)
|
||||
var->bits_per_pixel = bpp * 8; /* FrameBuffer color depth */
|
||||
if (mfd->dest == DISPLAY_LCD) {
|
||||
if (panel_info->type == MDDI_PANEL && panel_info->mddi.is_type1)
|
||||
var->reserved[4] = panel_info->lcd.refx100 / (100 * 2);
|
||||
var->reserved[3] = panel_info->lcd.refx100 / (100 * 2);
|
||||
else
|
||||
var->reserved[4] = panel_info->lcd.refx100 / 100;
|
||||
var->reserved[3] = panel_info->lcd.refx100 / 100;
|
||||
} else {
|
||||
if (panel_info->type == MIPI_VIDEO_PANEL) {
|
||||
var->reserved[4] = panel_info->mipi.frame_rate;
|
||||
var->reserved[3] = panel_info->mipi.frame_rate;
|
||||
} else {
|
||||
var->reserved[4] = panel_info->clk_rate /
|
||||
var->reserved[3] = panel_info->clk_rate /
|
||||
((panel_info->lcdc.h_back_porch +
|
||||
panel_info->lcdc.h_front_porch +
|
||||
panel_info->lcdc.h_pulse_width +
|
||||
@@ -1352,7 +1352,7 @@ static int msm_fb_register(struct msm_fb_data_type *mfd)
|
||||
panel_info->yres));
|
||||
}
|
||||
}
|
||||
pr_debug("reserved[4] %u\n", var->reserved[4]);
|
||||
pr_debug("reserved[3] %u\n", var->reserved[3]);
|
||||
|
||||
/*
|
||||
* id field for fb app
|
||||
|
||||
@@ -232,6 +232,7 @@ static void tvout_msm_hpd_work_timer(unsigned long data)
|
||||
static int tvout_on(struct platform_device *pdev)
|
||||
{
|
||||
uint32 reg = 0;
|
||||
uint32 userformat = 0;
|
||||
struct fb_var_screeninfo *var;
|
||||
struct msm_fb_data_type *mfd = platform_get_drvdata(pdev);
|
||||
|
||||
@@ -252,8 +253,9 @@ static int tvout_on(struct platform_device *pdev)
|
||||
#endif
|
||||
|
||||
var = &mfd->fbi->var;
|
||||
if (var->reserved[3] >= NTSC_M && var->reserved[3] <= PAL_N)
|
||||
external_common_state->video_resolution = var->reserved[3];
|
||||
userformat = var->reserved[3] >> 16;
|
||||
if (var->reserved[3] >= NTSC_M && userformat <= PAL_N)
|
||||
external_common_state->video_resolution = userformat;
|
||||
|
||||
tvout_msm_state->pdev = pdev;
|
||||
if (del_timer(&tvout_msm_state->hpd_work_timer))
|
||||
|
||||
@@ -279,7 +279,7 @@ struct fb_var_screeninfo {
|
||||
__u32 vmode; /* see FB_VMODE_* */
|
||||
__u32 rotate; /* angle we rotate counter clockwise */
|
||||
__u32 colorspace; /* colorspace for FOURCC-based modes */
|
||||
__u32 reserved[5]; /* Reserved for future compatibility */
|
||||
__u32 reserved[4]; /* Reserved for future compatibility */
|
||||
};
|
||||
|
||||
struct fb_cmap {
|
||||
|
||||
Reference in New Issue
Block a user