Hi Sean,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip robh/for-next linus/master
v5.15-rc1 next-20210916]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Sean-Paul/drm-hdcp-Pull-HDCP-auth-exchange-check-into-helpers/20210916-044145
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-m001-20210916 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
smatch warnings:
drivers/gpu/drm/drm_hdcp.c:509 drm_hdcp_atomic_check() warn: inconsistent
indenting
vim +509 drivers/gpu/drm/drm_hdcp.c
a46c52c65fdbf76 Sean Paul 2021-09-15 425
a46c52c65fdbf76 Sean Paul 2021-09-15 426 /**
a46c52c65fdbf76 Sean Paul 2021-09-15 427 * drm_hdcp_atomic_check - Helper
for drivers to call during connector->atomic_check
a46c52c65fdbf76 Sean Paul 2021-09-15 428 *
a46c52c65fdbf76 Sean Paul 2021-09-15 429 * @state: pointer to the atomic
state being checked
a46c52c65fdbf76 Sean Paul 2021-09-15 430 * @connector: drm_connector on
which content protection state needs an update
a46c52c65fdbf76 Sean Paul 2021-09-15 431 *
a46c52c65fdbf76 Sean Paul 2021-09-15 432 * This function can be used by
display drivers to perform an atomic check on the
d0cdceca77739a6 Sean Paul 2021-09-15 433 * hdcp state elements. If hdcp
state has changed in a manner which requires the
d0cdceca77739a6 Sean Paul 2021-09-15 434 * driver to enable or disable
content protection, this function will return
d0cdceca77739a6 Sean Paul 2021-09-15 435 * true.
d0cdceca77739a6 Sean Paul 2021-09-15 436 *
d0cdceca77739a6 Sean Paul 2021-09-15 437 * Returns:
d0cdceca77739a6 Sean Paul 2021-09-15 438 * true if the driver must
enable/disable hdcp, false otherwise
a46c52c65fdbf76 Sean Paul 2021-09-15 439 */
d0cdceca77739a6 Sean Paul 2021-09-15 440 bool drm_hdcp_atomic_check(struct
drm_connector *connector,
a46c52c65fdbf76 Sean Paul 2021-09-15 441 struct
drm_atomic_state *state)
a46c52c65fdbf76 Sean Paul 2021-09-15 442 {
a46c52c65fdbf76 Sean Paul 2021-09-15 443 struct drm_connector_state
*new_conn_state, *old_conn_state;
a46c52c65fdbf76 Sean Paul 2021-09-15 444 struct drm_crtc_state
*new_crtc_state;
a46c52c65fdbf76 Sean Paul 2021-09-15 445 u64 old_hdcp, new_hdcp;
a46c52c65fdbf76 Sean Paul 2021-09-15 446
a46c52c65fdbf76 Sean Paul 2021-09-15 447 old_conn_state =
drm_atomic_get_old_connector_state(state, connector);
a46c52c65fdbf76 Sean Paul 2021-09-15 448 old_hdcp =
old_conn_state->content_protection;
a46c52c65fdbf76 Sean Paul 2021-09-15 449
a46c52c65fdbf76 Sean Paul 2021-09-15 450 new_conn_state =
drm_atomic_get_new_connector_state(state, connector);
a46c52c65fdbf76 Sean Paul 2021-09-15 451 new_hdcp =
new_conn_state->content_protection;
a46c52c65fdbf76 Sean Paul 2021-09-15 452
a46c52c65fdbf76 Sean Paul 2021-09-15 453 if (!new_conn_state->crtc) {
a46c52c65fdbf76 Sean Paul 2021-09-15 454 /*
a46c52c65fdbf76 Sean Paul 2021-09-15 455* If the connector is
being disabled with CP enabled, mark it
a46c52c65fdbf76 Sean Paul 2021-09-15 456* desired so it's
re-enabled when the connector is brought back
a46c52c65fdbf76 Sean Paul 2021-09-15 457*/
d0cdceca77739a6 Sean Paul 2021-09-15 458 if (old_hdcp ==
DRM_MODE_CONTENT_PROTECTION_ENABLED) {
a46c52c65fdbf76 Sean Paul 2021-09-15 459
new_conn_state->content_protection =
a46c52c65fdbf76 Sean Paul 2021-09-15 460
DRM_MODE_CONTENT_PROTECTION_DESIRED;
d0cdceca77739a6 Sean Paul 2021-09-15 461 return true;
d0cdceca77739a6 Sean Paul 2021-09-15 462 }
d0cdceca77739a6 Sean Paul 2021-09-15 463 return false;
a46c52c65fdbf76 Sean Paul 2021-09-15 464 }
a46c52c65fdbf76 Sean Paul 2021-09-15 465
a46c52c65fdbf76 Sean Paul 2021-09-15 466 new_crtc_state =
drm_atomic_get_new_crtc_state(state,
a46c52c65fdbf76 Sean Paul 2021-09-15 467
new_conn_state->crtc);
a46c52c65fdbf76 Sean Paul 2021-09-15 468 /*
a46c52c65fdbf76 Sean Paul 2021-09-15 469 * Fix the HDCP uapi content
protection state in case of modeset.
a46c52c65fdbf76 Sean Paul 2021-09-15 470 * FIXME: As per HDCP content
protection property uapi doc, an uevent()
a46c52c65fdbf76 Sean Paul 2021-09-15 471 * need to be sent if there is
transition from ENABLED->DESIRED.
a46c52c65fdbf76 Sean Paul 2021-09-15 472 */
a46c52c65fdbf76 Sean Paul 2021-09-15 473