面板极性变换方式 可使用的common电极驱动方式
Frame inversion 固定与变动
Row inversion 固定与变动
Column inversion 只能使用固定的common电极电压
Dot inversion 只能使用固定的common电极电压
面板极性变换方式 Flicker的现象 Crosstalk(串扰; 串音)的现象
Frame inversion 明显 垂直与水平方向都易发生
Row inversion 不明显 水平方向容易发生
Columninversion 不明显 垂直方向容易发生
Dot inversion 几乎没有 不易发生
Current Orise IC is supported for Column Inversion and Dot Inversion (0xC0B4h Panel Driving Mode)
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index ae7bb95..3f1a657 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -331,11 +331,121 @@ static int hwc_query(struct hwc_composer_device_1* dev, } +inline void getHalPixelFormatStr(int format, char pixelformatstr[]) +{ + if (!pixelformatstr) + return; + + switch(format) { + case HAL_PIXEL_FORMAT_RGBA_8888: + strcpy(pixelformatstr, "RGBA_8888"); + break; + case HAL_PIXEL_FORMAT_RGBX_8888: + strcpy(pixelformatstr, "RGBX_8888"); + break; + case HAL_PIXEL_FORMAT_RGB_888: + strcpy(pixelformatstr, "RGB_888"); + break; + case HAL_PIXEL_FORMAT_RGB_565: + strcpy(pixelformatstr, "RGB_565"); + break; + case HAL_PIXEL_FORMAT_BGRA_8888: + strcpy(pixelformatstr, "BGRA_8888"); + break; + case HAL_PIXEL_FORMAT_RGBA_5551: + strcpy(pixelformatstr, "RGBA_5551"); + break; + case HAL_PIXEL_FORMAT_RGBA_4444: + strcpy(pixelformatstr, "RGBA_4444"); + break; + case HAL_PIXEL_FORMAT_YV12: + strcpy(pixelformatstr, "YV12"); + break; + case HAL_PIXEL_FORMAT_YCbCr_422_SP: + strcpy(pixelformatstr, "YCbCr_422_SP_NV16"); + break; + case HAL_PIXEL_FORMAT_YCrCb_420_SP: + strcpy(pixelformatstr, "YCrCb_420_SP_NV21"); + break; + case HAL_PIXEL_FORMAT_YCbCr_422_I: + strcpy(pixelformatstr, "YCbCr_422_I_YUY2"); + break; + case HAL_PIXEL_FORMAT_NV12_ENCODEABLE: + strcpy(pixelformatstr, "NV12_ENCODEABLE"); + break; + case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED: + strcpy(pixelformatstr, "YCbCr_420_SP_TILED_TILE_4x2"); + break; + case HAL_PIXEL_FORMAT_YCbCr_420_SP: + strcpy(pixelformatstr, "YCbCr_420_SP"); + break; + case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO: + strcpy(pixelformatstr, "YCrCb_420_SP_ADRENO"); + break; + case HAL_PIXEL_FORMAT_YCrCb_422_SP: + strcpy(pixelformatstr, "YCrCb_422_SP"); + break; + case HAL_PIXEL_FORMAT_R_8: + strcpy(pixelformatstr, "R_8"); + break; + case HAL_PIXEL_FORMAT_RG_88: + strcpy(pixelformatstr, "RG_88"); + break; + case HAL_PIXEL_FORMAT_INTERLACE: + strcpy(pixelformatstr, "INTERLACE"); + break; + default: + sprintf(pixelformatstr, "Unknown0x%X", format); + break; + } +} + +void dump_layers(int layercount, size_t layerIndex, hwc_layer_1_t hwLayers[]) +{ + hwc_layer_1_t *layer = &hwLayers[layerIndex]; + hwc_rect_t sourceCrop = layer->sourceCrop; + hwc_rect_t displayFrame = layer->displayFrame; + private_handle_t *hnd = (private_handle_t *)layer->handle; + char *layer_format=new char[50]; + getHalPixelFormatStr(hnd->format,layer_format); + int composition_type =layer->compositionType; + char sfdumpfile_name[256]; + + sprintf(sfdumpfile_name, "/data/layerdump/dump%03d_layer%d_%dx%d_%s_comp%d.raw", + layercount, layerIndex, hnd->width, hnd->height, + layer_format,composition_type); + FILE* fp = fopen(sfdumpfile_name, "w+"); + if (fp != NULL) { + fwrite((void*)hnd->base, hnd->size, 1, fp); + fclose(fp); + } + +} + static int hwc_set_primary(hwc_context_t *ctx, hwc_display_contents_1_t* list) { ATRACE_CALL(); int ret = 0; const int dpy = HWC_DISPLAY_PRIMARY; if (LIKELY(list) && ctx->dpyAttr[dpy].isActive) { + + char property_fb[PROPERTY_VALUE_MAX]; + static int layer_count =0; + int count_limit=0; + if (property_get("debug.sf.dump", property_fb, NULL) > 0) { + if(atoi(property_fb) > 0) { + count_limit=atoi(property_fb) ; + if (0 == mkdir("/data/layerdump", 0777)) + layer_count=0; + if(layer_count<count_limit) { + for(unsigned int i=0;i<list->numHwLayers;i++) + dump_layers(layer_count, i, list->hwLayers); + layer_count ++ ; + } + } + } + + + uint32_t last = list->numHwLayers - 1; hwc_layer_1_t *fbLayer = &list->hwLayers[last]; int fd = -1; //FenceFD from the Copybit(valid in async mode)
# setprop debug.sf.dump 100
The dump data is in /data/layerdump folder.
# adb pull <remote> <local>
4.1 mdp4_overlay_set (key point)
a. Get pipe from request (struct mdp_overlay ), choose corresponding pipe type;
Where the function checks if the request is valid or not, such as width, height, downscale ratio(1/8), upscale ratio(20(mdp version > 4.1, otherwise 8)) and so on.
b. Return pipe index;
c. Calc mdp clock for current frame and bandwidth;
d. Done.
#define DTYPE_DCS_LWRITE 0x39 /* long write */ #define DTYPE_DCS_WRITE 0x05 /* short write, 0 parameter */ #define DTYPE_DCS_WRITE1 0x15 /* short write, 1 parameter */ #define DTYPE_DCS_READ 0x06 /* read */