Lines Matching refs:dp_panel

14 	struct dp_panel dp_panel;  member
22 static int dp_panel_read_dpcd(struct dp_panel *dp_panel) in dp_panel_read_dpcd() argument
32 dpcd = dp_panel->dpcd; in dp_panel_read_dpcd()
34 panel = container_of(dp_panel, struct dp_panel_private, dp_panel); in dp_panel_read_dpcd()
35 link_info = &dp_panel->link_info; in dp_panel_read_dpcd()
76 if (link_info->num_lanes > dp_panel->max_dp_lanes) in dp_panel_read_dpcd()
77 link_info->num_lanes = dp_panel->max_dp_lanes; in dp_panel_read_dpcd()
90 dp_panel->dfp_present = dpcd[DP_DOWNSTREAMPORT_PRESENT]; in dp_panel_read_dpcd()
91 dp_panel->dfp_present &= DP_DWN_STRM_PORT_PRESENT; in dp_panel_read_dpcd()
93 if (dp_panel->dfp_present && (dpcd[DP_DPCD_REV] > 0x10)) { in dp_panel_read_dpcd()
94 dp_panel->ds_port_cnt = dpcd[DP_DOWN_STREAM_PORT_COUNT]; in dp_panel_read_dpcd()
95 dp_panel->ds_port_cnt &= DP_PORT_COUNT_MASK; in dp_panel_read_dpcd()
99 DP_DOWNSTREAM_PORT_0, dp_panel->ds_cap_info, len); in dp_panel_read_dpcd()
111 static u32 dp_panel_get_supported_bpp(struct dp_panel *dp_panel, in dp_panel_get_supported_bpp() argument
120 link_info = &dp_panel->link_info; in dp_panel_get_supported_bpp()
155 int dp_panel_read_sink_caps(struct dp_panel *dp_panel, in dp_panel_read_sink_caps() argument
162 if (!dp_panel || !connector) { in dp_panel_read_sink_caps()
167 panel = container_of(dp_panel, struct dp_panel_private, dp_panel); in dp_panel_read_sink_caps()
169 rc = dp_panel_read_dpcd(dp_panel); in dp_panel_read_sink_caps()
170 bw_code = drm_dp_link_rate_to_bw_code(dp_panel->link_info.rate); in dp_panel_read_sink_caps()
172 !is_lane_count_valid(dp_panel->link_info.num_lanes) || in dp_panel_read_sink_caps()
173 (bw_code > dp_panel->max_bw_code)) { in dp_panel_read_sink_caps()
178 if (dp_panel->dfp_present) { in dp_panel_read_sink_caps()
192 kfree(dp_panel->edid); in dp_panel_read_sink_caps()
193 dp_panel->edid = NULL; in dp_panel_read_sink_caps()
195 dp_panel->edid = drm_get_edid(connector, in dp_panel_read_sink_caps()
197 if (!dp_panel->edid) { in dp_panel_read_sink_caps()
209 rc = dp_panel_read_dpcd(dp_panel); in dp_panel_read_sink_caps()
210 bw_code = drm_dp_link_rate_to_bw_code(dp_panel->link_info.rate); in dp_panel_read_sink_caps()
212 !is_lane_count_valid(dp_panel->link_info.num_lanes) in dp_panel_read_sink_caps()
213 || (bw_code > dp_panel->max_bw_code)) { in dp_panel_read_sink_caps()
223 u32 dp_panel_get_mode_bpp(struct dp_panel *dp_panel, in dp_panel_get_mode_bpp() argument
229 if (!dp_panel || !mode_edid_bpp || !mode_pclk_khz) { in dp_panel_get_mode_bpp()
234 panel = container_of(dp_panel, struct dp_panel_private, dp_panel); in dp_panel_get_mode_bpp()
236 if (dp_panel->video_test) in dp_panel_get_mode_bpp()
240 bpp = dp_panel_get_supported_bpp(dp_panel, mode_edid_bpp, in dp_panel_get_mode_bpp()
246 int dp_panel_get_modes(struct dp_panel *dp_panel, in dp_panel_get_modes() argument
249 if (!dp_panel) { in dp_panel_get_modes()
254 if (dp_panel->edid) in dp_panel_get_modes()
255 return dp_panel_update_modes(connector, dp_panel->edid); in dp_panel_get_modes()
284 void dp_panel_handle_sink_request(struct dp_panel *dp_panel) in dp_panel_handle_sink_request() argument
288 if (!dp_panel) { in dp_panel_handle_sink_request()
293 panel = container_of(dp_panel, struct dp_panel_private, dp_panel); in dp_panel_handle_sink_request()
296 u8 checksum = dp_panel_get_edid_checksum(dp_panel->edid); in dp_panel_handle_sink_request()
303 void dp_panel_tpg_config(struct dp_panel *dp_panel, bool enable) in dp_panel_tpg_config() argument
308 if (!dp_panel) { in dp_panel_tpg_config()
313 panel = container_of(dp_panel, struct dp_panel_private, dp_panel); in dp_panel_tpg_config()
327 dp_catalog_panel_tpg_enable(catalog, &panel->dp_panel.dp_mode.drm_mode); in dp_panel_tpg_config()
330 void dp_panel_dump_regs(struct dp_panel *dp_panel) in dp_panel_dump_regs() argument
335 panel = container_of(dp_panel, struct dp_panel_private, dp_panel); in dp_panel_dump_regs()
341 int dp_panel_timing_cfg(struct dp_panel *dp_panel) in dp_panel_timing_cfg() argument
349 panel = container_of(dp_panel, struct dp_panel_private, dp_panel); in dp_panel_timing_cfg()
351 drm_mode = &panel->dp_panel.dp_mode.drm_mode; in dp_panel_timing_cfg()
381 data |= (panel->dp_panel.dp_mode.v_active_low << 31); in dp_panel_timing_cfg()
383 data |= (panel->dp_panel.dp_mode.h_active_low << 15); in dp_panel_timing_cfg()
399 int dp_panel_init_panel_info(struct dp_panel *dp_panel) in dp_panel_init_panel_info() argument
404 drm_mode = &dp_panel->dp_mode.drm_mode; in dp_panel_init_panel_info()
422 DRM_DEBUG_DP("bpp = %d\n", dp_panel->dp_mode.bpp); in dp_panel_init_panel_info()
424 dp_panel->dp_mode.bpp = max_t(u32, 18, in dp_panel_init_panel_info()
425 min_t(u32, dp_panel->dp_mode.bpp, 30)); in dp_panel_init_panel_info()
426 DRM_DEBUG_DP("updated bpp = %d\n", dp_panel->dp_mode.bpp); in dp_panel_init_panel_info()
431 struct dp_panel *dp_panel_get(struct dp_panel_in *in) in dp_panel_get()
434 struct dp_panel *dp_panel; in dp_panel_get() local
450 dp_panel = &panel->dp_panel; in dp_panel_get()
451 dp_panel->max_bw_code = DP_LINK_BW_8_1; in dp_panel_get()
454 return dp_panel; in dp_panel_get()
457 void dp_panel_put(struct dp_panel *dp_panel) in dp_panel_put() argument
459 if (!dp_panel) in dp_panel_put()
462 kfree(dp_panel->edid); in dp_panel_put()