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

drm/amd/display: Update dmub header to match DMUB

[WHY]
Last PR missed name of a struct to match in DMUB

[HOW]
Update the logic in dmub_cmh.h header

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Meenakshikumar Somasundaram <Meenakshikumar.Somasundaram@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Mustapha Ghaddar <mghaddar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Mustapha Ghaddar and committed by
Alex Deucher
8af54c61 60b73429

+109 -92
+15 -1
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
··· 131 131 }; 132 132 133 133 /** 134 + * DPIA NOTIFICATION Response Type 135 + */ 136 + enum dpia_notify_bw_alloc_status { 137 + 138 + DPIA_BW_REQ_FAILED = 0, 139 + DPIA_BW_REQ_SUCCESS, 140 + DPIA_EST_BW_CHANGED, 141 + DPIA_BW_ALLOC_CAPS_CHANGED 142 + }; 143 + 144 + /** 134 145 * struct dmub_region - dmub hw memory region 135 146 * @base: base address for region, must be 256 byte aligned 136 147 * @top: top address for region ··· 476 465 struct aux_reply_data aux_reply; 477 466 enum dp_hpd_status hpd_status; 478 467 enum set_config_status sc_status; 479 - struct dpia_notification_reply_data bw_alloc_reply; 468 + /** 469 + * DPIA notification command. 470 + */ 471 + struct dmub_rb_cmd_dpia_notification dpia_notification; 480 472 }; 481 473 }; 482 474
+84 -81
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
··· 770 770 * Command type used for SET_CONFIG Reply notification 771 771 */ 772 772 DMUB_OUT_CMD__SET_CONFIG_REPLY = 3, 773 - DMUB_OUT_CMD__DPIA_NOTIFICATION = 5 773 + /** 774 + * Command type used for USB4 DPIA notification 775 + */ 776 + DMUB_OUT_CMD__DPIA_NOTIFICATION = 5, 774 777 }; 775 778 776 779 /* DMUB_CMD__DPIA command sub-types. */ ··· 781 778 DMUB_CMD__DPIA_DIG1_DPIA_CONTROL = 0, 782 779 DMUB_CMD__DPIA_SET_CONFIG_ACCESS = 1, 783 780 DMUB_CMD__DPIA_MST_ALLOC_SLOTS = 2, 781 + }; 782 + 783 + /* DMUB_OUT_CMD__DPIA_NOTIFICATION command types. */ 784 + enum dmub_cmd_dpia_notification_type { 785 + DPIA_NOTIFY__BW_ALLOCATION = 0, 784 786 }; 785 787 786 788 #pragma pack(push, 1) ··· 1526 1518 }; 1527 1519 1528 1520 /** 1529 - * DPIA NOTIFICATION Response Type 1530 - */ 1531 - enum dpia_notify_bw_alloc_status { 1532 - 1533 - DPIA_BW_REQ_FAILED = 0, 1534 - DPIA_BW_REQ_SUCCESS, 1535 - DPIA_EST_BW_CHANGED, 1536 - DPIA_BW_ALLOC_CAPS_CHANGED 1537 - }; 1538 - 1539 - /* DMUB_OUT_CMD__DPIA_NOTIFY Reply command - OutBox Cmd */ 1540 - /** 1541 - * Data passed to driver from FW in a DMUB_OUT_CMD__DPIA_NOTIFY command. 1542 - */ 1543 - struct dpia_notification_reply_data { 1544 - uint8_t allocated_bw; 1545 - uint8_t estimated_bw; 1546 - }; 1547 - 1548 - struct dpia_notification_common { 1549 - bool shared; 1550 - }; 1551 - 1552 - struct dpia_bw_allocation_notify_data { 1553 - union { 1554 - struct { 1555 - uint16_t cm_bw_alloc_support: 1; /**< USB4 CM BW Allocation mode support */ 1556 - uint16_t bw_request_failed: 1; /**< BW_Request_Failed */ 1557 - uint16_t bw_request_succeeded: 1; /**< BW_Request_Succeeded */ 1558 - uint16_t est_bw_changed: 1; /**< Estimated_BW changed */ 1559 - uint16_t bw_alloc_cap_changed: 1; /**< BW_Allocation_Capabiity_Changed */ 1560 - uint16_t reserved: 11; 1561 - } bits; 1562 - uint16_t flags; 1563 - }; 1564 - uint8_t cm_id; /**< CM ID */ 1565 - uint8_t group_id; /**< Group ID */ 1566 - uint8_t granularity; /**< BW Allocation Granularity */ 1567 - uint8_t estimated_bw; /**< Estimated_BW */ 1568 - uint8_t allocated_bw; /**< Allocated_BW */ 1569 - uint8_t reserved; 1570 - }; 1571 - 1572 - union dpia_notification_data { 1573 - struct dpia_notification_common common_data; 1574 - struct dpia_bw_allocation_notify_data dpia_bw_alloc; /**< Used for DPIA BW Allocation mode notification */ 1575 - }; 1576 - 1577 - enum dmub_cmd_dpia_notification_type { 1578 - DPIA_NOTIFY__BW_ALLOCATION = 0, 1579 - }; 1580 - 1581 - struct dpia_notification_header { 1582 - uint8_t instance; /**< DPIA Instance */ 1583 - uint8_t reserved[3]; 1584 - enum dmub_cmd_dpia_notification_type type; /**< DPIA notification type */ 1585 - }; 1586 - 1587 - struct dpia_notification_payload { 1588 - struct dpia_notification_header header; 1589 - union dpia_notification_data data; /**< DPIA notification data */ 1590 - }; 1591 - 1592 - /** 1593 - * Definition of a DMUB_OUT_CMD__DPIA_NOTIFY command. 1594 - */ 1595 - struct dmub_rb_cmd_dpia_notification { 1596 - /** 1597 - * Command header. 1598 - */ 1599 - struct dmub_cmd_header header; /**< DPIA notification header */ 1600 - /** 1601 - * Data passed to driver from FW in a DMUB_OUT_CMD__DPIA_NOTIFY command. 1602 - */ 1603 - struct dpia_notification_payload payload; /**< DPIA notification payload */ 1604 - }; 1605 - 1606 - /** 1607 1521 * Definition of a DMUB_OUT_CMD__DP_HPD_NOTIFY command. 1608 1522 */ 1609 1523 struct dmub_rb_cmd_dp_hpd_notify { ··· 1564 1634 struct dmub_rb_cmd_dp_set_config_reply { 1565 1635 struct dmub_cmd_header header; 1566 1636 struct set_config_reply_control_data set_config_reply_control; 1637 + }; 1638 + 1639 + /** 1640 + * Definition of a DPIA notification header 1641 + */ 1642 + struct dpia_notification_header { 1643 + uint8_t instance; /**< DPIA Instance */ 1644 + uint8_t reserved[3]; 1645 + enum dmub_cmd_dpia_notification_type type; /**< DPIA notification type */ 1646 + }; 1647 + 1648 + /** 1649 + * Definition of the common data struct of DPIA notification 1650 + */ 1651 + struct dpia_notification_common { 1652 + uint8_t cmd_buffer[DMUB_RB_CMD_SIZE - sizeof(struct dmub_cmd_header) 1653 + - sizeof(struct dpia_notification_header)]; 1654 + }; 1655 + 1656 + /** 1657 + * Definition of a DPIA notification data 1658 + */ 1659 + struct dpia_bw_allocation_notify_data { 1660 + union { 1661 + struct { 1662 + uint16_t cm_bw_alloc_support: 1; /**< USB4 CM BW Allocation mode support */ 1663 + uint16_t bw_request_failed: 1; /**< BW_Request_Failed */ 1664 + uint16_t bw_request_succeeded: 1; /**< BW_Request_Succeeded */ 1665 + uint16_t est_bw_changed: 1; /**< Estimated_BW changed */ 1666 + uint16_t bw_alloc_cap_changed: 1; /**< BW_Allocation_Capabiity_Changed */ 1667 + uint16_t reserved: 11; /**< Reserved */ 1668 + } bits; 1669 + 1670 + uint16_t flags; 1671 + }; 1672 + 1673 + uint8_t cm_id; /**< CM ID */ 1674 + uint8_t group_id; /**< Group ID */ 1675 + uint8_t granularity; /**< BW Allocation Granularity */ 1676 + uint8_t estimated_bw; /**< Estimated_BW */ 1677 + uint8_t allocated_bw; /**< Allocated_BW */ 1678 + uint8_t reserved; 1679 + }; 1680 + 1681 + /** 1682 + * union dpia_notify_data_type - DPIA Notification in Outbox command 1683 + */ 1684 + union dpia_notification_data { 1685 + /** 1686 + * DPIA Notification for common data struct 1687 + */ 1688 + struct dpia_notification_common common_data; 1689 + 1690 + /** 1691 + * DPIA Notification for DP BW Allocation support 1692 + */ 1693 + struct dpia_bw_allocation_notify_data dpia_bw_alloc; 1694 + }; 1695 + 1696 + /** 1697 + * Definition of a DPIA notification payload 1698 + */ 1699 + struct dpia_notification_payload { 1700 + struct dpia_notification_header header; 1701 + union dpia_notification_data data; /**< DPIA notification payload data */ 1702 + }; 1703 + 1704 + /** 1705 + * Definition of a DMUB_OUT_CMD__DPIA_NOTIFICATION command. 1706 + */ 1707 + struct dmub_rb_cmd_dpia_notification { 1708 + struct dmub_cmd_header header; /**< DPIA notification header */ 1709 + struct dpia_notification_payload payload; /**< DPIA notification payload */ 1567 1710 }; 1568 1711 1569 1712 /** ··· 3505 3502 */ 3506 3503 struct dmub_rb_cmd_dp_set_config_reply set_config_reply; 3507 3504 /** 3508 - * BW ALLOCATION notification command. 3505 + * DPIA notification command. 3509 3506 */ 3510 - struct dmub_rb_cmd_dpia_notification dpia_notify; 3507 + struct dmub_rb_cmd_dpia_notification dpia_notification; 3511 3508 }; 3512 3509 #pragma pack(pop) 3513 3510
+10 -10
drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
··· 94 94 break; 95 95 case DMUB_OUT_CMD__DPIA_NOTIFICATION: 96 96 notify->type = DMUB_NOTIFICATION_DPIA_NOTIFICATION; 97 - notify->link_index = cmd.dpia_notify.payload.header.instance; 97 + notify->link_index = cmd.dpia_notification.payload.header.instance; 98 98 99 - if (cmd.dpia_notify.payload.header.type == DPIA_NOTIFY__BW_ALLOCATION) { 99 + if (cmd.dpia_notification.payload.header.type == DPIA_NOTIFY__BW_ALLOCATION) { 100 100 101 - notify->bw_alloc_reply.estimated_bw = 102 - cmd.dpia_notify.payload.data.dpia_bw_alloc.estimated_bw; 103 - notify->bw_alloc_reply.allocated_bw = 104 - cmd.dpia_notify.payload.data.dpia_bw_alloc.allocated_bw; 101 + notify->dpia_notification.payload.data.dpia_bw_alloc.estimated_bw = 102 + cmd.dpia_notification.payload.data.dpia_bw_alloc.estimated_bw; 103 + notify->dpia_notification.payload.data.dpia_bw_alloc.allocated_bw = 104 + cmd.dpia_notification.payload.data.dpia_bw_alloc.allocated_bw; 105 105 106 - if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_request_failed) 106 + if (cmd.dpia_notification.payload.data.dpia_bw_alloc.bits.bw_request_failed) 107 107 notify->result = DPIA_BW_REQ_FAILED; 108 - else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_request_succeeded) 108 + else if (cmd.dpia_notification.payload.data.dpia_bw_alloc.bits.bw_request_succeeded) 109 109 notify->result = DPIA_BW_REQ_SUCCESS; 110 - else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.est_bw_changed) 110 + else if (cmd.dpia_notification.payload.data.dpia_bw_alloc.bits.est_bw_changed) 111 111 notify->result = DPIA_EST_BW_CHANGED; 112 - else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_alloc_cap_changed) 112 + else if (cmd.dpia_notification.payload.data.dpia_bw_alloc.bits.bw_alloc_cap_changed) 113 113 notify->result = DPIA_BW_ALLOC_CAPS_CHANGED; 114 114 } 115 115 break;