drivers/intel/gma: Drop unused INTEL_DP
Change-Id: I786848cd48c6fcfecf9b72c60623cadcfcbb7db7 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/19803 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
parent
0df9a01009
commit
746aa054e2
@ -14,12 +14,6 @@
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
|
||||
config INTEL_DP
|
||||
bool
|
||||
default n
|
||||
help
|
||||
helper functions for intel display port operations
|
||||
|
||||
config INTEL_DDI
|
||||
bool
|
||||
default n
|
||||
|
@ -13,7 +13,6 @@
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
|
||||
ramstage-$(CONFIG_INTEL_DP) += intel_dp.c drm_dp_helper.c display.c
|
||||
ramstage-$(CONFIG_INTEL_DDI) += intel_ddi.c
|
||||
ramstage-$(CONFIG_INTEL_EDID) += edid.c vbt.c
|
||||
ifeq ($(CONFIG_VGA_ROM_RUN),y)
|
||||
|
@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013 Google 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.
|
||||
*
|
||||
* Authors:
|
||||
* Keith Packard <keithp@keithp.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/* This code was created by the coccinnelle filters in the i915tool,
|
||||
* with some final hand filtering.
|
||||
*/
|
||||
|
||||
#include <console/console.h>
|
||||
#include <stdint.h>
|
||||
#include <delay.h>
|
||||
#include <drivers/intel/gma/i915.h>
|
||||
#include <string.h>
|
||||
|
||||
void compute_display_params(struct intel_dp *dp)
|
||||
{
|
||||
struct edid *edid = &(dp->edid);
|
||||
struct edid_mode *mode = &edid->mode;
|
||||
|
||||
/* step 1: get the constants in the dp struct set up. */
|
||||
dp->lane_count = dp->dpcd[DP_MAX_LANE_COUNT]&DP_LANE_COUNT_MASK;
|
||||
|
||||
dp->link_bw = dp->dpcd[DP_MAX_LINK_RATE];
|
||||
dp->clock = intel_dp_bw_code_to_link_rate(dp->link_bw);
|
||||
dp->edid.link_clock = intel_dp_bw_code_to_link_rate(dp->link_bw);
|
||||
|
||||
/* step 2. Do some computation of other stuff. */
|
||||
dp->bytes_per_pixel = dp->pipe_bits_per_pixel/8;
|
||||
|
||||
dp->stride = edid->bytes_per_line;
|
||||
|
||||
dp->htotal = (mode->ha - 1) | ((mode->ha + mode->hbl - 1) << 16);
|
||||
|
||||
dp->hblank = (mode->ha - 1) | ((mode->ha + mode->hbl - 1) << 16);
|
||||
|
||||
dp->hsync = (mode->ha + mode->hso - 1) |
|
||||
((mode->ha + mode->hso + mode->hspw - 1) << 16);
|
||||
|
||||
dp->vtotal = (mode->va - 1) | ((mode->va + mode->vbl - 1) << 16);
|
||||
|
||||
dp->vblank = (mode->va - 1) | ((mode->va + mode->vbl - 1) << 16);
|
||||
|
||||
dp->vsync = (mode->va + mode->vso - 1) |
|
||||
((mode->va + mode->vso + mode->vspw - 1) << 16);
|
||||
|
||||
/* PIPEASRC is wid-1 x ht-1 */
|
||||
dp->pipesrc = (mode->ha-1)<<16 | (mode->va-1);
|
||||
|
||||
dp->pfa_pos = 0;
|
||||
|
||||
dp->pfa_ctl = PF_ENABLE | PF_FILTER_MED_3x3;
|
||||
/* IVB hack */
|
||||
if (dp->gen == 6)
|
||||
dp->pfa_ctl |= PF_PIPE_SEL_IVB(dp->pipe);
|
||||
|
||||
dp->pfa_sz = (mode->ha << 16) | (mode->va);
|
||||
|
||||
/* step 3. Call the linux code we pulled in. */
|
||||
dp->flags = intel_ddi_calc_transcoder_flags(edid->panel_bits_per_pixel,
|
||||
dp->port,
|
||||
dp->pipe,
|
||||
dp->type,
|
||||
dp->lane_count,
|
||||
dp->pfa_sz,
|
||||
mode->phsync == '+'?1:0,
|
||||
mode->pvsync == '+'?1:0);
|
||||
|
||||
dp->transcoder = intel_ddi_get_transcoder(dp->port,
|
||||
dp->pipe);
|
||||
|
||||
intel_dp_compute_m_n(edid->panel_bits_per_pixel,
|
||||
dp->lane_count,
|
||||
dp->edid.mode.pixel_clock,
|
||||
dp->edid.link_clock,
|
||||
&dp->m_n);
|
||||
|
||||
printk(BIOS_SPEW, "dp->lane_count = 0x%08x\n",dp->lane_count);
|
||||
printk(BIOS_SPEW, "dp->stride = 0x%08x\n",dp->stride);
|
||||
printk(BIOS_SPEW, "dp->htotal = 0x%08x\n", dp->htotal);
|
||||
printk(BIOS_SPEW, "dp->hblank = 0x%08x\n", dp->hblank);
|
||||
printk(BIOS_SPEW, "dp->hsync = 0x%08x\n", dp->hsync);
|
||||
printk(BIOS_SPEW, "dp->vtotal = 0x%08x\n", dp->vtotal);
|
||||
printk(BIOS_SPEW, "dp->vblank = 0x%08x\n", dp->vblank);
|
||||
printk(BIOS_SPEW, "dp->vsync = 0x%08x\n", dp->vsync);
|
||||
printk(BIOS_SPEW, "dp->pipesrc = 0x%08x\n", dp->pipesrc);
|
||||
printk(BIOS_SPEW, "dp->pfa_pos = 0x%08x\n", dp->pfa_pos);
|
||||
printk(BIOS_SPEW, "dp->pfa_ctl = 0x%08x\n", dp->pfa_ctl);
|
||||
printk(BIOS_SPEW, "dp->pfa_sz = 0x%08x\n", dp->pfa_sz);
|
||||
printk(BIOS_SPEW, "dp->link_m = 0x%08x\n", dp->m_n.link_m);
|
||||
printk(BIOS_SPEW, "dp->link_n = 0x%08x\n", dp->m_n.link_n);
|
||||
printk(BIOS_SPEW, "0x6f030 = 0x%08x\n",
|
||||
TU_SIZE(dp->m_n.tu) | dp->m_n.gmch_m);
|
||||
printk(BIOS_SPEW, "0x6f030 = 0x%08x\n", dp->m_n.gmch_m);
|
||||
printk(BIOS_SPEW, "0x6f034 = 0x%08x\n", dp->m_n.gmch_n);
|
||||
printk(BIOS_SPEW, "dp->flags = 0x%08x\n", dp->flags);
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013 Google Inc.
|
||||
* Copyright © 2009 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <console/console.h>
|
||||
#include <stdint.h>
|
||||
#include <delay.h>
|
||||
#include <drivers/intel/gma/i915.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <edid.h>
|
||||
|
||||
/* reduced a lot for coreboot. */
|
||||
/**
|
||||
* DOC: dp helpers
|
||||
*
|
||||
* These functions contain some common logic and helpers at various
|
||||
* abstraction levels to deal with Display Port sink devices and
|
||||
* related things like DP aux channel transfers, EDID reading over DP
|
||||
* aux channels, decoding certain DPCD blocks, ...
|
||||
*/
|
||||
|
||||
|
||||
/* Helpers for DP link training */
|
||||
static u8 dp_link_status(u8 link_status[DP_LINK_STATUS_SIZE], int r)
|
||||
{
|
||||
printk(BIOS_SPEW, "%s: %d, %d, %d\n", __func__,
|
||||
r, r - DP_LANE0_1_STATUS,
|
||||
link_status[r - DP_LANE0_1_STATUS]);
|
||||
return link_status[r - DP_LANE0_1_STATUS];
|
||||
}
|
||||
|
||||
static u8 dp_get_lane_status(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane)
|
||||
{
|
||||
int i = DP_LANE0_1_STATUS + (lane >> 1);
|
||||
int s = (lane & 1) * 4;
|
||||
u8 l = dp_link_status(link_status, i);
|
||||
return (l >> s) & 0xf;
|
||||
}
|
||||
|
||||
int drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane_count)
|
||||
{
|
||||
u8 lane_align;
|
||||
u8 lane_status;
|
||||
int lane;
|
||||
|
||||
lane_align = dp_link_status(link_status,
|
||||
DP_LANE_ALIGN_STATUS_UPDATED);
|
||||
if ((lane_align & DP_INTERLANE_ALIGN_DONE) == 0)
|
||||
return 0;
|
||||
for (lane = 0; lane < lane_count; lane++) {
|
||||
lane_status = dp_get_lane_status(link_status, lane);
|
||||
if ((lane_status & DP_CHANNEL_EQ_BITS) != DP_CHANNEL_EQ_BITS)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane_count)
|
||||
{
|
||||
int lane;
|
||||
u8 lane_status;
|
||||
|
||||
for (lane = 0; lane < lane_count; lane++) {
|
||||
lane_status = dp_get_lane_status(link_status, lane);
|
||||
if ((lane_status & DP_LANE_CR_DONE) == 0)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane)
|
||||
{
|
||||
int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
|
||||
int s = ((lane & 1) ?
|
||||
DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT :
|
||||
DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT);
|
||||
u8 l = dp_link_status(link_status, i);
|
||||
|
||||
printk(BIOS_SPEW, "%s: i %d s %d l %d return %d\n",
|
||||
__func__, i, s, l,
|
||||
((l >> s) & 0x3) << DP_TRAIN_VOLTAGE_SWING_SHIFT);
|
||||
return ((l >> s) & 0x3) << DP_TRAIN_VOLTAGE_SWING_SHIFT;
|
||||
}
|
||||
|
||||
u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane)
|
||||
{
|
||||
int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
|
||||
int s = ((lane & 1) ?
|
||||
DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT :
|
||||
DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT);
|
||||
u8 l = dp_link_status(link_status, i);
|
||||
|
||||
return ((l >> s) & 0x3) << DP_TRAIN_PRE_EMPHASIS_SHIFT;
|
||||
}
|
@ -81,201 +81,7 @@ enum {
|
||||
unsigned long io_i915_read32(unsigned long addr);
|
||||
void io_i915_write32(unsigned long val, unsigned long addr);
|
||||
|
||||
/*
|
||||
* To communicate to and control the extracted-from-kernel code,
|
||||
* we need this struct. It has a counterpart in the ARM code, so
|
||||
* there is a precedent.
|
||||
*/
|
||||
|
||||
#define DP_RECEIVER_CAP_SIZE 0xf
|
||||
#define DP_LINK_STATUS_SIZE 6
|
||||
#define DP_LINK_CHECK_TIMEOUT (10 * 1000)
|
||||
|
||||
#define DP_LINK_CONFIGURATION_SIZE 9
|
||||
|
||||
struct intel_dp_m_n {
|
||||
uint32_t tu;
|
||||
uint32_t gmch_m;
|
||||
uint32_t gmch_n;
|
||||
uint32_t link_m;
|
||||
uint32_t link_n;
|
||||
};
|
||||
|
||||
struct intel_dp {
|
||||
int gen; // 6 for link, 7 for wtm2
|
||||
int has_pch_split; // 1 for link and wtm2
|
||||
int has_pch_cpt; // 1 for everything we know about.
|
||||
int is_haswell;
|
||||
/* output register offset in MMIO space. Usually DP_A */
|
||||
u32 output_reg;
|
||||
/* The initial value of the DP register.
|
||||
* Mainboards can set this to a non-zero
|
||||
* value in the case that there are undetectable
|
||||
* but essential parameters.
|
||||
*/
|
||||
u32 DP;
|
||||
uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE];
|
||||
u32 color_range;
|
||||
/* these paramaters are determined after reading the DPCD */
|
||||
int dpms_mode;
|
||||
uint8_t link_bw;
|
||||
uint8_t lane_count;
|
||||
/* This data is read from the panel via the AUX channel.*/
|
||||
uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
|
||||
int type;
|
||||
int edp;
|
||||
int is_pch_edp;
|
||||
/* state related to training. */
|
||||
uint8_t train_set[4];
|
||||
/* Determined from EDID or coreboot hard-sets. */
|
||||
int panel_power_up_delay;
|
||||
int panel_power_down_delay;
|
||||
int panel_power_cycle_delay;
|
||||
int backlight_on_delay;
|
||||
int backlight_off_delay;
|
||||
int want_panel_vdd;
|
||||
u32 clock;
|
||||
int port;
|
||||
int pipe;
|
||||
int plane;
|
||||
int pipe_bits_per_pixel;
|
||||
/* i2c on aux is ... interesting.
|
||||
* Before you do an i2c cycle, you need to set the address.
|
||||
* This requires we remember it from one moment to the next.
|
||||
* Remember it here.
|
||||
*/
|
||||
u16 address;
|
||||
/* timing parameters for aux channel IO. They used to compute these on
|
||||
* each and every entry to the functions, which is kind of stupid, and it had
|
||||
* errors anyway.
|
||||
* note: you can get these from watching YABEL output. E.g.:
|
||||
* you see an outb of 0x802300e1 to 64010. the 3 is the precharge
|
||||
* and the e1 is the clock divider.
|
||||
*/
|
||||
u32 aux_clock_divider;
|
||||
u32 precharge;
|
||||
/* EDID, raw and processed */
|
||||
u8 rawedid[256];
|
||||
int edidlen;
|
||||
struct edid edid;
|
||||
/* computed values needed for "i915" registers */
|
||||
int bytes_per_pixel;
|
||||
u32 htotal;
|
||||
u32 hblank;
|
||||
u32 hsync;
|
||||
u32 vtotal;
|
||||
u32 vblank;
|
||||
u32 vsync;
|
||||
u32 pfa_sz;
|
||||
u32 pfa_pos;
|
||||
u32 pfa_ctl;
|
||||
u32 pipesrc;
|
||||
u32 stride;
|
||||
struct intel_dp_m_n m_n;
|
||||
u32 flags;
|
||||
u32 transcoder;
|
||||
/* parameters computed by the early startup, to be used
|
||||
* in the GMA code.
|
||||
*/
|
||||
u8 *graphics;
|
||||
/* physical address, not to be used directly. */
|
||||
u64 physbase;
|
||||
};
|
||||
|
||||
/* we may yet need these. */
|
||||
void intel_dp_mode_set(struct intel_dp *intel_dp);
|
||||
void intel_dp_start_link_train(struct intel_dp *intel_dp);
|
||||
|
||||
int intel_dp_i2c_init(struct intel_dp *intel_dp);
|
||||
int intel_dp_i2c_aux_ch(struct intel_dp *intel_dp,
|
||||
int mode, uint8_t write_byte, uint8_t *read_byte);
|
||||
|
||||
int intel_dp_get_dpcd(struct intel_dp *intel_dp);
|
||||
struct edid *intel_dp_get_edid(struct intel_dp *intel_dp);
|
||||
|
||||
void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
|
||||
void ironlake_edp_pll_on(void);
|
||||
void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp);
|
||||
void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, int sync);
|
||||
int intel_dp_get_max_downspread(struct intel_dp *intel_dp, u8 *max_downspread);
|
||||
void ironlake_edp_panel_on(struct intel_dp *intel_dp);
|
||||
void ironlake_edp_backlight_on(struct intel_dp *intel_dp);
|
||||
/* needed only on haswell. */
|
||||
void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp, int port);
|
||||
int intel_dp_aux_ch(struct intel_dp *intel_dp,
|
||||
uint8_t *send, int send_bytes,
|
||||
uint8_t *recv, int recv_size);
|
||||
void unpack_aux(u32 src, uint8_t *dst, int dst_bytes);
|
||||
int intel_channel_eq_ok(struct intel_dp *intel_dp,
|
||||
uint8_t link_status[DP_LINK_STATUS_SIZE]);
|
||||
void ironlake_edp_panel_off(struct intel_dp *intel_dp);
|
||||
void ironlake_edp_backlight_off(struct intel_dp *intel_dp);
|
||||
|
||||
/* drm_dp_helper.c */
|
||||
int drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane_count);
|
||||
int drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane_count);
|
||||
u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane);
|
||||
u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane);
|
||||
|
||||
|
||||
void intel_dp_wait_reg(unsigned long addr,
|
||||
unsigned long val);
|
||||
|
||||
void intel_dp_wait_panel_power_control(unsigned long val);
|
||||
|
||||
void intel_dp_compute_m_n(unsigned int bits_per_pixel,
|
||||
unsigned int nlanes,
|
||||
unsigned int pixel_clock,
|
||||
unsigned int link_clock,
|
||||
struct intel_dp_m_n *m_n);
|
||||
|
||||
u32 intel_ddi_calc_transcoder_flags(u32 pipe_bpp,
|
||||
enum port port,
|
||||
enum pipe pipe,
|
||||
int type,
|
||||
int lane_count,
|
||||
int pf_sz,
|
||||
u8 phsync,
|
||||
u8 pvsync);
|
||||
|
||||
enum transcoder intel_ddi_get_transcoder(enum port port,
|
||||
enum pipe pipe);
|
||||
|
||||
void intel_dp_set_m_n_regs(struct intel_dp *intel_dp);
|
||||
int intel_dp_bw_code_to_link_rate(u8 link_bw);
|
||||
void intel_dp_set_resolution(struct intel_dp *intel_dp);
|
||||
|
||||
int intel_dp_i2c_write(struct intel_dp *intel_dp,
|
||||
u8 val);
|
||||
|
||||
int intel_dp_i2c_read(struct intel_dp *intel_dp,
|
||||
u8 *val);
|
||||
|
||||
int intel_dp_set_bw(struct intel_dp *intel_dp);
|
||||
int intel_dp_set_lane_count(struct intel_dp *intel_dp);
|
||||
int intel_dp_set_training_lane0(struct intel_dp *intel_dp,
|
||||
u8 val);
|
||||
int intel_dp_set_training_pattern(struct intel_dp *intel_dp,
|
||||
u8 pat);
|
||||
|
||||
int intel_dp_get_link_status(struct intel_dp *intel_dp,
|
||||
uint8_t link_status[DP_LINK_STATUS_SIZE]);
|
||||
|
||||
int intel_dp_get_training_pattern(struct intel_dp *intel_dp,
|
||||
u8 *recv);
|
||||
|
||||
int intel_dp_get_lane_count(struct intel_dp *intel_dp,
|
||||
u8 *recv);
|
||||
|
||||
int intel_dp_get_lane_align_status(struct intel_dp *intel_dp,
|
||||
u8 *recv);
|
||||
|
||||
void intel_prepare_ddi(void);
|
||||
void intel_ddi_set_pipe_settings(struct intel_dp *intel_dp);
|
||||
|
||||
int gtt_poll(u32 reg, u32 mask, u32 value);
|
||||
void gtt_write(u32 reg, u32 data);
|
||||
@ -295,14 +101,8 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info *
|
||||
const struct i915_gpu_controller_info *
|
||||
intel_gma_get_controller_info(void);
|
||||
|
||||
int i915lightup(unsigned int physbase, unsigned int mmio,
|
||||
unsigned int gfx, unsigned int init_fb);
|
||||
int panel_lightup(struct intel_dp *dp, unsigned int init_fb);
|
||||
void *igd_make_opregion(void);
|
||||
|
||||
/* display.c */
|
||||
void compute_display_params(struct intel_dp *dp);
|
||||
|
||||
/* vbt.c */
|
||||
struct device;
|
||||
void
|
||||
|
@ -114,159 +114,3 @@ void intel_prepare_ddi(void)
|
||||
|
||||
intel_prepare_ddi_buffers(PORT_E, use_fdi);
|
||||
}
|
||||
|
||||
static void intel_wait_ddi_buf_idle(int port)
|
||||
{
|
||||
uint32_t reg = DDI_BUF_CTL(port);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
udelay(1);
|
||||
if (gtt_read(reg) & DDI_BUF_IS_IDLE){
|
||||
printk(BIOS_SPEW, "%s: buf is idle (success)\n", __func__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
printk(BIOS_ERR, "Timeout waiting for DDI BUF %d idle bit\n", port);
|
||||
}
|
||||
|
||||
|
||||
void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp, int port)
|
||||
{
|
||||
int wait = 0;
|
||||
uint32_t val;
|
||||
|
||||
if (gtt_read(DP_TP_CTL(port)) & DP_TP_CTL_ENABLE) {
|
||||
val = gtt_read(DDI_BUF_CTL(port));
|
||||
if (val & DDI_BUF_CTL_ENABLE) {
|
||||
val &= ~DDI_BUF_CTL_ENABLE;
|
||||
gtt_write(val,DDI_BUF_CTL(port));
|
||||
wait = 1;
|
||||
}
|
||||
|
||||
val = gtt_read(DP_TP_CTL(port));
|
||||
val &= ~(DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_MASK);
|
||||
val |= DP_TP_CTL_LINK_TRAIN_PAT1;
|
||||
gtt_write(val,DP_TP_CTL(port));
|
||||
//POSTING_READ(DP_TP_CTL(port));
|
||||
|
||||
if (wait)
|
||||
intel_wait_ddi_buf_idle(port);
|
||||
}
|
||||
|
||||
val = DP_TP_CTL_ENABLE | DP_TP_CTL_MODE_SST |
|
||||
DP_TP_CTL_LINK_TRAIN_PAT1 | DP_TP_CTL_SCRAMBLE_DISABLE;
|
||||
if (intel_dp->link_configuration[1] & DP_LANE_COUNT_ENHANCED_FRAME_EN)
|
||||
val |= DP_TP_CTL_ENHANCED_FRAME_ENABLE;
|
||||
gtt_write(val,DP_TP_CTL(port));
|
||||
//POSTING_READ(DP_TP_CTL(port));
|
||||
|
||||
intel_dp->DP |= DDI_BUF_CTL_ENABLE;
|
||||
gtt_write(intel_dp->DP,DDI_BUF_CTL(port));
|
||||
//POSTING_READ(DDI_BUF_CTL(port));
|
||||
|
||||
udelay(600);
|
||||
}
|
||||
|
||||
u32 intel_ddi_calc_transcoder_flags(u32 pipe_bpp,
|
||||
enum port port,
|
||||
enum pipe pipe,
|
||||
int type,
|
||||
int lane_count,
|
||||
int pf_sz,
|
||||
u8 phsync,
|
||||
u8 pvsync)
|
||||
{
|
||||
u32 temp;
|
||||
|
||||
temp = TRANS_DDI_FUNC_ENABLE;
|
||||
temp |= TRANS_DDI_SELECT_PORT(port);
|
||||
|
||||
switch (pipe_bpp) {
|
||||
case 18:
|
||||
temp |= TRANS_DDI_BPC_6;
|
||||
break;
|
||||
case 24:
|
||||
temp |= TRANS_DDI_BPC_8;
|
||||
break;
|
||||
case 30:
|
||||
temp |= TRANS_DDI_BPC_10;
|
||||
break;
|
||||
case 36:
|
||||
temp |= TRANS_DDI_BPC_12;
|
||||
break;
|
||||
default:
|
||||
printk(BIOS_ERR, "Invalid pipe_bpp: %d, *** Initialization will not succeed ***\n", pipe_bpp);
|
||||
}
|
||||
|
||||
if (port == PORT_A) {
|
||||
switch (pipe) {
|
||||
case PIPE_A:
|
||||
if (pf_sz)
|
||||
temp |= TRANS_DDI_EDP_INPUT_A_ONOFF;
|
||||
else
|
||||
temp |= TRANS_DDI_EDP_INPUT_A_ON;
|
||||
break;
|
||||
case PIPE_B:
|
||||
temp |= TRANS_DDI_EDP_INPUT_B_ONOFF;
|
||||
break;
|
||||
case PIPE_C:
|
||||
temp |= TRANS_DDI_EDP_INPUT_C_ONOFF;
|
||||
break;
|
||||
default:
|
||||
printk(BIOS_ERR, "Invalid pipe %d\n", pipe);
|
||||
}
|
||||
}
|
||||
|
||||
if (phsync)
|
||||
temp |= TRANS_DDI_PHSYNC;
|
||||
|
||||
if (pvsync)
|
||||
temp |= TRANS_DDI_PVSYNC;
|
||||
|
||||
if (type == INTEL_OUTPUT_HDMI) {
|
||||
/* Need to understand when to set TRANS_DDI_MODE_SELECT_HDMI / TRANS_DDI_MODE_SELECT_DVI */
|
||||
} else if (type == INTEL_OUTPUT_ANALOG) {
|
||||
/* Set TRANS_DDI_MODE_SELECT_FDI with lane_count */
|
||||
} else if (type == INTEL_OUTPUT_DISPLAYPORT ||
|
||||
type == INTEL_OUTPUT_EDP) {
|
||||
temp |= TRANS_DDI_MODE_SELECT_DP_SST;
|
||||
|
||||
temp |= DDI_PORT_WIDTH(lane_count);
|
||||
} else {
|
||||
printk(BIOS_ERR, "Invalid type %d for pipe\n", type);
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
enum transcoder intel_ddi_get_transcoder(enum port port,
|
||||
enum pipe pipe)
|
||||
{
|
||||
if (port == PORT_A)
|
||||
return TRANSCODER_EDP;
|
||||
return (enum transcoder)pipe;
|
||||
}
|
||||
|
||||
void intel_ddi_set_pipe_settings(struct intel_dp *intel_dp)
|
||||
{
|
||||
u32 val = TRANS_MSA_SYNC_CLK;
|
||||
|
||||
switch (intel_dp->pipe_bits_per_pixel) {
|
||||
case 18:
|
||||
val |= TRANS_MSA_6_BPC;
|
||||
break;
|
||||
case 24:
|
||||
val |= TRANS_MSA_8_BPC;
|
||||
break;
|
||||
case 30:
|
||||
val |= TRANS_MSA_10_BPC;
|
||||
break;
|
||||
case 36:
|
||||
val |= TRANS_MSA_12_BPC;
|
||||
break;
|
||||
default:
|
||||
printk(BIOS_ERR, "Invalid bpp settings %d\n", intel_dp->pipe_bits_per_pixel);
|
||||
}
|
||||
gtt_write(TRANS_MSA_MISC(intel_dp->transcoder),val);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user