linux/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c

/*
 * Copyright 2007-8 Advanced Micro Devices, Inc.
 * Copyright 2008 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
 *
 * Authors: Dave Airlie
 *          Alex Deucher
 */

#include <drm/display/drm_dp_helper.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_probe_helper.h>
#include <drm/amdgpu_drm.h>
#include "amdgpu.h"
#include "atom.h"
#include "atombios_encoders.h"
#include "atombios_dp.h"
#include "amdgpu_connectors.h"
#include "amdgpu_i2c.h"
#include "amdgpu_display.h"

#include <linux/pm_runtime.h>

void amdgpu_connector_hotplug(struct drm_connector *connector)
{}

static void amdgpu_connector_property_change_mode(struct drm_encoder *encoder)
{}

int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
{}

static void
amdgpu_connector_update_scratch_regs(struct drm_connector *connector,
				      enum drm_connector_status status)
{}

static struct drm_encoder *
amdgpu_connector_find_encoder(struct drm_connector *connector,
			       int encoder_type)
{}

static struct edid *
amdgpu_connector_get_hardcoded_edid(struct amdgpu_device *adev)
{}

static void amdgpu_connector_get_edid(struct drm_connector *connector)
{}

static void amdgpu_connector_free_edid(struct drm_connector *connector)
{}

static int amdgpu_connector_ddc_get_modes(struct drm_connector *connector)
{}

static struct drm_encoder *
amdgpu_connector_best_single_encoder(struct drm_connector *connector)
{}

static void amdgpu_get_native_mode(struct drm_connector *connector)
{}

static struct drm_display_mode *
amdgpu_connector_lcd_native_mode(struct drm_encoder *encoder)
{}

static void amdgpu_connector_add_common_modes(struct drm_encoder *encoder,
					       struct drm_connector *connector)
{}

static int amdgpu_connector_set_property(struct drm_connector *connector,
					  struct drm_property *property,
					  uint64_t val)
{}

static void
amdgpu_connector_fixup_lcd_native_mode(struct drm_encoder *encoder,
					struct drm_connector *connector)
{}

static int amdgpu_connector_lvds_get_modes(struct drm_connector *connector)
{}

static enum drm_mode_status amdgpu_connector_lvds_mode_valid(struct drm_connector *connector,
					     struct drm_display_mode *mode)
{}

static enum drm_connector_status
amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force)
{}

static void amdgpu_connector_unregister(struct drm_connector *connector)
{}

static void amdgpu_connector_destroy(struct drm_connector *connector)
{}

static int amdgpu_connector_set_lcd_property(struct drm_connector *connector,
					      struct drm_property *property,
					      uint64_t value)
{}


static const struct drm_connector_helper_funcs amdgpu_connector_lvds_helper_funcs =;

static const struct drm_connector_funcs amdgpu_connector_lvds_funcs =;

static int amdgpu_connector_vga_get_modes(struct drm_connector *connector)
{}

static enum drm_mode_status amdgpu_connector_vga_mode_valid(struct drm_connector *connector,
					    struct drm_display_mode *mode)
{}

static enum drm_connector_status
amdgpu_connector_vga_detect(struct drm_connector *connector, bool force)
{}

static const struct drm_connector_helper_funcs amdgpu_connector_vga_helper_funcs =;

static const struct drm_connector_funcs amdgpu_connector_vga_funcs =;

static bool
amdgpu_connector_check_hpd_status_unchanged(struct drm_connector *connector)
{}

static void amdgpu_connector_shared_ddc(enum drm_connector_status *status,
					struct drm_connector *connector,
					struct amdgpu_connector *amdgpu_connector)
{}

/*
 * DVI is complicated
 * Do a DDC probe, if DDC probe passes, get the full EDID so
 * we can do analog/digital monitor detection at this point.
 * If the monitor is an analog monitor or we got no DDC,
 * we need to find the DAC encoder object for this connector.
 * If we got no DDC, we do load detection on the DAC encoder object.
 * If we got analog DDC or load detection passes on the DAC encoder
 * we have to check if this analog encoder is shared with anyone else (TV)
 * if its shared we have to set the other connector to disconnected.
 */
static enum drm_connector_status
amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
{}

/* okay need to be smart in here about which encoder to pick */
static struct drm_encoder *
amdgpu_connector_dvi_encoder(struct drm_connector *connector)
{}

static void amdgpu_connector_dvi_force(struct drm_connector *connector)
{}

static enum drm_mode_status amdgpu_connector_dvi_mode_valid(struct drm_connector *connector,
					    struct drm_display_mode *mode)
{}

static const struct drm_connector_helper_funcs amdgpu_connector_dvi_helper_funcs =;

static const struct drm_connector_funcs amdgpu_connector_dvi_funcs =;

static int amdgpu_connector_dp_get_modes(struct drm_connector *connector)
{}

u16 amdgpu_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *connector)
{}

static bool amdgpu_connector_encoder_is_hbr2(struct drm_connector *connector)
{}

bool amdgpu_connector_is_dp12_capable(struct drm_connector *connector)
{}

static enum drm_connector_status
amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)
{}

static enum drm_mode_status amdgpu_connector_dp_mode_valid(struct drm_connector *connector,
					   struct drm_display_mode *mode)
{}

static int
amdgpu_connector_late_register(struct drm_connector *connector)
{}

static const struct drm_connector_helper_funcs amdgpu_connector_dp_helper_funcs =;

static const struct drm_connector_funcs amdgpu_connector_dp_funcs =;

static const struct drm_connector_funcs amdgpu_connector_edp_funcs =;

void
amdgpu_connector_add(struct amdgpu_device *adev,
		      uint32_t connector_id,
		      uint32_t supported_device,
		      int connector_type,
		      struct amdgpu_i2c_bus_rec *i2c_bus,
		      uint16_t connector_object_id,
		      struct amdgpu_hpd *hpd,
		      struct amdgpu_router *router)
{}