Lines Matching refs:raw

199 				       struct drm_dp_sideband_msg_tx *raw)  in drm_dp_encode_sideband_req()  argument
203 u8 *buf = raw->msg; in drm_dp_encode_sideband_req()
296 raw->cur_len = idx; in drm_dp_encode_sideband_req()
307 struct drm_dp_sideband_msg_tx *raw) in drm_dp_encode_sideband_reply() argument
310 u8 *buf = raw->msg; in drm_dp_encode_sideband_reply()
314 raw->cur_len = idx; in drm_dp_encode_sideband_reply()
366 static bool drm_dp_sideband_parse_link_address(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_link_address() argument
371 memcpy(repmsg->u.link_addr.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_link_address()
373 repmsg->u.link_addr.nports = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_link_address()
375 if (idx > raw->curlen) in drm_dp_sideband_parse_link_address()
378 if (raw->msg[idx] & 0x80) in drm_dp_sideband_parse_link_address()
381 repmsg->u.link_addr.ports[i].peer_device_type = (raw->msg[idx] >> 4) & 0x7; in drm_dp_sideband_parse_link_address()
382 repmsg->u.link_addr.ports[i].port_number = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_link_address()
385 if (idx > raw->curlen) in drm_dp_sideband_parse_link_address()
387 repmsg->u.link_addr.ports[i].mcs = (raw->msg[idx] >> 7) & 0x1; in drm_dp_sideband_parse_link_address()
388 repmsg->u.link_addr.ports[i].ddps = (raw->msg[idx] >> 6) & 0x1; in drm_dp_sideband_parse_link_address()
390 repmsg->u.link_addr.ports[i].legacy_device_plug_status = (raw->msg[idx] >> 5) & 0x1; in drm_dp_sideband_parse_link_address()
392 if (idx > raw->curlen) in drm_dp_sideband_parse_link_address()
395 repmsg->u.link_addr.ports[i].dpcd_revision = (raw->msg[idx]); in drm_dp_sideband_parse_link_address()
397 if (idx > raw->curlen) in drm_dp_sideband_parse_link_address()
399 memcpy(repmsg->u.link_addr.ports[i].peer_guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_link_address()
401 if (idx > raw->curlen) in drm_dp_sideband_parse_link_address()
403 repmsg->u.link_addr.ports[i].num_sdp_streams = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_link_address()
404 repmsg->u.link_addr.ports[i].num_sdp_stream_sinks = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_link_address()
408 if (idx > raw->curlen) in drm_dp_sideband_parse_link_address()
414 DRM_DEBUG_KMS("link address reply parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_link_address()
418 static bool drm_dp_sideband_parse_remote_dpcd_read(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_remote_dpcd_read() argument
422 repmsg->u.remote_dpcd_read_ack.port_number = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_remote_dpcd_read()
424 if (idx > raw->curlen) in drm_dp_sideband_parse_remote_dpcd_read()
426 repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; in drm_dp_sideband_parse_remote_dpcd_read()
427 if (idx > raw->curlen) in drm_dp_sideband_parse_remote_dpcd_read()
430 …memcpy(repmsg->u.remote_dpcd_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_dpcd_read_ack.num_by… in drm_dp_sideband_parse_remote_dpcd_read()
433 DRM_DEBUG_KMS("link address reply parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_remote_dpcd_read()
437 static bool drm_dp_sideband_parse_remote_dpcd_write(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_remote_dpcd_write() argument
441 repmsg->u.remote_dpcd_write_ack.port_number = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_remote_dpcd_write()
443 if (idx > raw->curlen) in drm_dp_sideband_parse_remote_dpcd_write()
447 DRM_DEBUG_KMS("parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_remote_dpcd_write()
451 static bool drm_dp_sideband_parse_remote_i2c_read_ack(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_remote_i2c_read_ack() argument
456 repmsg->u.remote_i2c_read_ack.port_number = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_remote_i2c_read_ack()
458 if (idx > raw->curlen) in drm_dp_sideband_parse_remote_i2c_read_ack()
460 repmsg->u.remote_i2c_read_ack.num_bytes = raw->msg[idx]; in drm_dp_sideband_parse_remote_i2c_read_ack()
463 …memcpy(repmsg->u.remote_i2c_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_i2c_read_ack.num_byte… in drm_dp_sideband_parse_remote_i2c_read_ack()
466 DRM_DEBUG_KMS("remote i2c reply parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_remote_i2c_read_ack()
470 static bool drm_dp_sideband_parse_enum_path_resources_ack(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_enum_path_resources_ack() argument
474 repmsg->u.path_resources.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_enum_path_resources_ack()
476 if (idx > raw->curlen) in drm_dp_sideband_parse_enum_path_resources_ack()
478 repmsg->u.path_resources.full_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]); in drm_dp_sideband_parse_enum_path_resources_ack()
480 if (idx > raw->curlen) in drm_dp_sideband_parse_enum_path_resources_ack()
482 repmsg->u.path_resources.avail_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]); in drm_dp_sideband_parse_enum_path_resources_ack()
484 if (idx > raw->curlen) in drm_dp_sideband_parse_enum_path_resources_ack()
488 DRM_DEBUG_KMS("enum resource parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_enum_path_resources_ack()
492 static bool drm_dp_sideband_parse_allocate_payload_ack(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_allocate_payload_ack() argument
496 repmsg->u.allocate_payload.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_allocate_payload_ack()
498 if (idx > raw->curlen) in drm_dp_sideband_parse_allocate_payload_ack()
500 repmsg->u.allocate_payload.vcpi = raw->msg[idx]; in drm_dp_sideband_parse_allocate_payload_ack()
502 if (idx > raw->curlen) in drm_dp_sideband_parse_allocate_payload_ack()
504 repmsg->u.allocate_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx+1]); in drm_dp_sideband_parse_allocate_payload_ack()
506 if (idx > raw->curlen) in drm_dp_sideband_parse_allocate_payload_ack()
510 DRM_DEBUG_KMS("allocate payload parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_allocate_payload_ack()
514 static bool drm_dp_sideband_parse_query_payload_ack(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_query_payload_ack() argument
518 repmsg->u.query_payload.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_query_payload_ack()
520 if (idx > raw->curlen) in drm_dp_sideband_parse_query_payload_ack()
522 repmsg->u.query_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); in drm_dp_sideband_parse_query_payload_ack()
524 if (idx > raw->curlen) in drm_dp_sideband_parse_query_payload_ack()
528 DRM_DEBUG_KMS("query payload parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_query_payload_ack()
532 static bool drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_reply() argument
536 msg->reply_type = (raw->msg[0] & 0x80) >> 7; in drm_dp_sideband_parse_reply()
537 msg->req_type = (raw->msg[0] & 0x7f); in drm_dp_sideband_parse_reply()
540 memcpy(msg->u.nak.guid, &raw->msg[1], 16); in drm_dp_sideband_parse_reply()
541 msg->u.nak.reason = raw->msg[17]; in drm_dp_sideband_parse_reply()
542 msg->u.nak.nak_data = raw->msg[18]; in drm_dp_sideband_parse_reply()
548 return drm_dp_sideband_parse_link_address(raw, msg); in drm_dp_sideband_parse_reply()
550 return drm_dp_sideband_parse_query_payload_ack(raw, msg); in drm_dp_sideband_parse_reply()
552 return drm_dp_sideband_parse_remote_dpcd_read(raw, msg); in drm_dp_sideband_parse_reply()
554 return drm_dp_sideband_parse_remote_dpcd_write(raw, msg); in drm_dp_sideband_parse_reply()
556 return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg); in drm_dp_sideband_parse_reply()
558 return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg); in drm_dp_sideband_parse_reply()
560 return drm_dp_sideband_parse_allocate_payload_ack(raw, msg); in drm_dp_sideband_parse_reply()
567 static bool drm_dp_sideband_parse_connection_status_notify(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_connection_status_notify() argument
572 msg->u.conn_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; in drm_dp_sideband_parse_connection_status_notify()
574 if (idx > raw->curlen) in drm_dp_sideband_parse_connection_status_notify()
577 memcpy(msg->u.conn_stat.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_connection_status_notify()
579 if (idx > raw->curlen) in drm_dp_sideband_parse_connection_status_notify()
582 msg->u.conn_stat.legacy_device_plug_status = (raw->msg[idx] >> 6) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
583 msg->u.conn_stat.displayport_device_plug_status = (raw->msg[idx] >> 5) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
584 msg->u.conn_stat.message_capability_status = (raw->msg[idx] >> 4) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
585 msg->u.conn_stat.input_port = (raw->msg[idx] >> 3) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
586 msg->u.conn_stat.peer_device_type = (raw->msg[idx] & 0x7); in drm_dp_sideband_parse_connection_status_notify()
590 DRM_DEBUG_KMS("connection status reply parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_connection_status_notify()
594 static bool drm_dp_sideband_parse_resource_status_notify(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_resource_status_notify() argument
599 msg->u.resource_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; in drm_dp_sideband_parse_resource_status_notify()
601 if (idx > raw->curlen) in drm_dp_sideband_parse_resource_status_notify()
604 memcpy(msg->u.resource_stat.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_resource_status_notify()
606 if (idx > raw->curlen) in drm_dp_sideband_parse_resource_status_notify()
609 msg->u.resource_stat.available_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); in drm_dp_sideband_parse_resource_status_notify()
613 DRM_DEBUG_KMS("resource status reply parse length fail %d %d\n", idx, raw->curlen); in drm_dp_sideband_parse_resource_status_notify()
617 static bool drm_dp_sideband_parse_req(struct drm_dp_sideband_msg_rx *raw, in drm_dp_sideband_parse_req() argument
621 msg->req_type = (raw->msg[0] & 0x7f); in drm_dp_sideband_parse_req()
625 return drm_dp_sideband_parse_connection_status_notify(raw, msg); in drm_dp_sideband_parse_req()
627 return drm_dp_sideband_parse_resource_status_notify(raw, msg); in drm_dp_sideband_parse_req()