[Intel-gfx] [PATCH 4/6] drm: take modeset locks around initial fb helper probing
Chris Wilson
chris at chris-wilson.co.uk
Thu Mar 6 10:14:44 CET 2014
On Wed, Mar 05, 2014 at 02:48:29PM -0800, Jesse Barnes wrote:
> Drivers ought to complain otherwise.
>
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> ---
> drivers/gpu/drm/drm_fb_helper.c | 2 ++
> drivers/gpu/drm/i915/intel_dp.c | 4 ++++
> drivers/gpu/drm/i915/intel_drv.h | 3 +++
> 3 files changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index ca100d6..b946217 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -1533,9 +1533,11 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
>
> drm_fb_helper_parse_command_line(fb_helper);
>
> + drm_modeset_lock_all(dev);
> count = drm_fb_helper_probe_connector_modes(fb_helper,
> dev->mode_config.max_width,
> dev->mode_config.max_height);
> + drm_modeset_unlock_all(dev);
> /*
> * we shouldn't end up with no modes here.
> */
Spurious chunks below?
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 0d5a311..738c4e6 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2880,6 +2880,10 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
>
> char dpcd_hex_dump[sizeof(intel_dp->dpcd) * 3];
>
> + /* We cache the DPCD for eDP panels */
> + if (intel_dp->dpcd_valid)
> + return true;
> +
> if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
> sizeof(intel_dp->dpcd)) == 0)
> return false; /* aux transfer failed */
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index a01fcf0..9ee412d 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -503,8 +503,11 @@ struct intel_dp {
> unsigned long last_backlight_off;
> bool psr_setup_done;
> bool use_tps3;
> + bool dpcd_valid; /* for eDP DPCD caching */
> struct intel_connector *attached_connector;
> + struct work_struct edp_cache_work;
> struct edp_power_seq power_seq;
> + const char *i2c_name;
>
> uint32_t (*get_aux_clock_divider)(struct intel_dp *dp, int index);
> /*
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list