Skip to content
Snippets Groups Projects
Select Git revision
  • ed5fa90660d63bcec4c3a62b03fed9427418b53d
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

intel_dp_mst.c

Blame
  • intel_dp_mst.c 21.01 KiB
    /*
     * Copyright © 2008 Intel Corporation
     *             2014 Red Hat Inc.
     *
     * Permission is hereby granted, free of charge, to any person obtaining a
     * copy of this software and associated documentation files (the "Software"),
     * to deal in the Software without restriction, including without limitation
     * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     * and/or sell copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice (including the next
     * paragraph) shall be included in all copies or substantial portions of the
     * Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     * IN THE SOFTWARE.
     *
     */
    
    #include <drm/drm_atomic_helper.h>
    #include <drm/drm_edid.h>
    #include <drm/drm_probe_helper.h>
    
    #include "i915_drv.h"
    #include "intel_atomic.h"
    #include "intel_audio.h"
    #include "intel_connector.h"
    #include "intel_ddi.h"
    #include "intel_dp.h"
    #include "intel_dp_mst.h"
    #include "intel_dpio_phy.h"
    #include "intel_drv.h"
    
    static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
    					    struct intel_crtc_state *crtc_state,
    					    struct drm_connector_state *conn_state,
    					    struct link_config_limits *limits)
    {
    	struct drm_atomic_state *state = crtc_state->base.state;
    	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
    	struct intel_dp *intel_dp = &intel_mst->primary->dp;
    	struct intel_connector *connector =
    		to_intel_connector(conn_state->connector);
    	const struct drm_display_mode *adjusted_mode =
    		&crtc_state->base.adjusted_mode;
    	void *port = connector->port;
    	bool constant_n = drm_dp_has_quirk(&intel_dp->desc,
    					   DP_DPCD_QUIRK_CONSTANT_N);
    	int bpp, slots = -EINVAL;
    
    	crtc_state->lane_count = limits->max_lane_count;
    	crtc_state->port_clock = limits->max_clock;
    
    	for (bpp = limits->max_bpp; bpp >= limits->min_bpp; bpp -= 2 * 3) {
    		crtc_state->pipe_bpp = bpp;
    
    		crtc_state->pbn = drm_dp_calc_pbn_mode(adjusted_mode->crtc_clock,
    						       crtc_state->pipe_bpp);
    
    		slots = drm_dp_atomic_find_vcpi_slots(state, &intel_dp->mst_mgr,
    						      port, crtc_state->pbn);
    		if (slots == -EDEADLK)
    			return slots;
    		if (slots >= 0)