Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/gvt: Swap read and write checks

The function intel_gvt_i2c_handle_aux_ch_write currently does not
support the DP_AUX_I2C_WRITE operation. Notably, we check if
op & 0x1 == DP_AUX_I2C_WRITE (one), and if it does not, assert that
op & 0x1 == DP_AUX_I2C_READ (zero). This is unnecessary because if
op & 0x1 != 1, then op & 0x1 == 0. But beyond that, it probably makes
more sense to check for the condition that is implemented, rather than
check for the condition that is not.

Swap the conditions. We can also get rid of the unnecessary drm_WARN_ON
while we're here.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260204161945.8127-2-jonathan.cavitt@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

authored by

Jonathan Cavitt and committed by
Jani Nikula
1cabff0d 33978364

+8 -10
+8 -10
drivers/gpu/drm/i915/gvt/edid.c
··· 535 535 i2c_edid->edid_available = true; 536 536 } 537 537 } 538 - } else if ((op & 0x1) == DP_AUX_I2C_WRITE) { 539 - /* TODO 540 - * We only support EDID reading from I2C_over_AUX. And 541 - * we do not expect the index mode to be used. Right now 542 - * the WRITE operation is ignored. It is good enough to 543 - * support the gfx driver to do EDID access. 544 - */ 545 - } else { 546 - if (drm_WARN_ON(&i915->drm, (op & 0x1) != DP_AUX_I2C_READ)) 547 - return; 538 + } else if ((op & 0x1) == DP_AUX_I2C_READ) { 548 539 if (drm_WARN_ON(&i915->drm, msg_length != 4)) 549 540 return; 550 541 if (i2c_edid->edid_available && i2c_edid->target_selected) { ··· 544 553 aux_data_for_write = (val << 16); 545 554 } else 546 555 aux_data_for_write = (0xff << 16); 556 + } else { 557 + /* TODO 558 + * We only support EDID reading from I2C_over_AUX. And 559 + * we do not expect the index mode to be used. Right now 560 + * the WRITE operation is ignored. It is good enough to 561 + * support the gfx driver to do EDID access. 562 + */ 547 563 } 548 564 /* write the return value in AUX_CH_DATA reg which includes: 549 565 * ACK of I2C_WRITE