提交 40795782 编写于 作者: J Jani Nikula

drm/i915/dsi: skip unknown elements for sequence block v3+

The sequence block has sizes of elements after the operation byte since
sequence block v3. Use it to skip elements we don't support yet.

v2: remove redundant exec_elem[operation_byte] check (Daniel)
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: NJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1452006408-27688-1-git-send-email-jani.nikula@intel.com
上级 2a33d934
...@@ -283,31 +283,35 @@ static void generic_exec_sequence(struct intel_dsi *intel_dsi, const u8 *data) ...@@ -283,31 +283,35 @@ static void generic_exec_sequence(struct intel_dsi *intel_dsi, const u8 *data)
if (dev_priv->vbt.dsi.seq_version >= 3) if (dev_priv->vbt.dsi.seq_version >= 3)
data += 4; data += 4;
/* parse each byte till we reach end of sequence byte - 0x00 */
while (1) { while (1) {
u8 operation_byte = *data++; u8 operation_byte = *data++;
if (operation_byte >= ARRAY_SIZE(exec_elem) || u8 operation_size = 0;
!exec_elem[operation_byte]) {
DRM_ERROR("Unsupported MIPI operation byte %u\n", if (operation_byte == MIPI_SEQ_ELEM_END)
operation_byte); break;
return;
} if (operation_byte < ARRAY_SIZE(exec_elem))
mipi_elem_exec = exec_elem[operation_byte]; mipi_elem_exec = exec_elem[operation_byte];
else
mipi_elem_exec = NULL;
/* Skip Size of Operation. */ /* Size of Operation. */
if (dev_priv->vbt.dsi.seq_version >= 3) if (dev_priv->vbt.dsi.seq_version >= 3)
data++; operation_size = *data++;
/* execute the element specific rotines */ if (mipi_elem_exec) {
data = mipi_elem_exec(intel_dsi, data); data = mipi_elem_exec(intel_dsi, data);
} else if (operation_size) {
/* /* We have size, skip. */
* After processing the element, data should point to DRM_DEBUG_KMS("Unsupported MIPI operation byte %u\n",
* next element or end of sequence operation_byte);
* check if have we reached end of sequence data += operation_size;
*/ } else {
if (*data == 0x00) /* No size, can't skip without parsing. */
break; DRM_ERROR("Unsupported MIPI operation byte %u\n",
operation_byte);
return;
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册