Skip to content

Commit

Permalink
drm/gma500: Rename psb_intel_crtc to gma_crtc
Browse files Browse the repository at this point in the history
The psb_intel_crtc is generic and should be named appropriately

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
  • Loading branch information
Patrik Jakobsson committed Jul 23, 2013
1 parent c5c81f4 commit 6306865
Show file tree
Hide file tree
Showing 15 changed files with 170 additions and 181 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/drm/gma500/cdv_intel_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ static void cdv_intel_crt_mode_set(struct drm_encoder *encoder,

struct drm_device *dev = encoder->dev;
struct drm_crtc *crtc = encoder->crtc;
struct psb_intel_crtc *psb_intel_crtc =
to_psb_intel_crtc(crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int dpll_md_reg;
u32 adpa, dpll_md;
u32 adpa_reg;

if (psb_intel_crtc->pipe == 0)
if (gma_crtc->pipe == 0)
dpll_md_reg = DPLL_A_MD;
else
dpll_md_reg = DPLL_B_MD;
Expand All @@ -124,7 +123,7 @@ static void cdv_intel_crt_mode_set(struct drm_encoder *encoder,
if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
adpa |= ADPA_VSYNC_ACTIVE_HIGH;

if (psb_intel_crtc->pipe == 0)
if (gma_crtc->pipe == 0)
adpa |= ADPA_PIPE_A_SELECT;
else
adpa |= ADPA_PIPE_B_SELECT;
Expand Down
28 changes: 14 additions & 14 deletions drivers/gpu/drm/gma500/cdv_intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ static int
cdv_dpll_set_clock_cdv(struct drm_device *dev, struct drm_crtc *crtc,
struct gma_clock_t *clock, bool is_lvds, u32 ddi_select)
{
struct psb_intel_crtc *psb_crtc = to_psb_intel_crtc(crtc);
int pipe = psb_crtc->pipe;
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe;
u32 m, n_vco, p;
int ret = 0;
int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
Expand Down Expand Up @@ -458,12 +458,12 @@ static bool cdv_intel_pipe_enabled(struct drm_device *dev, int pipe)
{
struct drm_crtc *crtc;
struct drm_psb_private *dev_priv = dev->dev_private;
struct psb_intel_crtc *psb_intel_crtc = NULL;
struct gma_crtc *gma_crtc = NULL;

crtc = dev_priv->pipe_to_crtc_mapping[pipe];
psb_intel_crtc = to_psb_intel_crtc(crtc);
gma_crtc = to_gma_crtc(crtc);

if (crtc->fb == NULL || !psb_intel_crtc->active)
if (crtc->fb == NULL || !gma_crtc->active)
return false;
return true;
}
Expand All @@ -489,11 +489,11 @@ static bool cdv_intel_single_pipe_active (struct drm_device *dev)

static bool is_pipeb_lvds(struct drm_device *dev, struct drm_crtc *crtc)
{
struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_connector *connector;

if (psb_intel_crtc->pipe != 1)
if (gma_crtc->pipe != 1)
return false;

list_for_each_entry(connector, &mode_config->connector_list, head) {
Expand Down Expand Up @@ -616,8 +616,8 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
int pipe = psb_intel_crtc->pipe;
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe];
int refclk;
struct gma_clock_t clock;
Expand Down Expand Up @@ -693,7 +693,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,

drm_mode_debug_printmodeline(adjusted_mode);

limit = psb_intel_crtc->clock_funcs->limit(crtc, refclk);
limit = gma_crtc->clock_funcs->limit(crtc, refclk);

ok = limit->find_pll(limit, crtc, adjusted_mode->clock, refclk,
&clock);
Expand Down Expand Up @@ -883,8 +883,8 @@ static int cdv_intel_crtc_clock_get(struct drm_device *dev,
struct drm_crtc *crtc)
{
struct drm_psb_private *dev_priv = dev->dev_private;
struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
int pipe = psb_intel_crtc->pipe;
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe;
const struct psb_offset *map = &dev_priv->regmap[pipe];
u32 dpll;
u32 fp;
Expand Down Expand Up @@ -961,8 +961,8 @@ static int cdv_intel_crtc_clock_get(struct drm_device *dev,
struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev,
struct drm_crtc *crtc)
{
struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
int pipe = psb_intel_crtc->pipe;
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int pipe = gma_crtc->pipe;
struct drm_psb_private *dev_priv = dev->dev_private;
struct psb_pipe *p = &dev_priv->regs.pipe[pipe];
const struct psb_offset *map = &dev_priv->regmap[pipe];
Expand Down
10 changes: 5 additions & 5 deletions drivers/gpu/drm/gma500/cdv_intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,10 @@ cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
struct drm_psb_private *dev_priv = dev->dev_private;
struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_encoder *encoder;
struct psb_intel_crtc *intel_crtc = to_psb_intel_crtc(crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int lane_count = 4, bpp = 24;
struct cdv_intel_dp_m_n m_n;
int pipe = intel_crtc->pipe;
int pipe = gma_crtc->pipe;

/*
* Find the lane count in the intel_encoder private
Expand Down Expand Up @@ -844,7 +844,7 @@ cdv_intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode
{
struct psb_intel_encoder *intel_encoder = to_psb_intel_encoder(encoder);
struct drm_crtc *crtc = encoder->crtc;
struct psb_intel_crtc *intel_crtc = to_psb_intel_crtc(crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv;
struct drm_device *dev = encoder->dev;

Expand Down Expand Up @@ -886,7 +886,7 @@ cdv_intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode
}

/* CPT DP's pipe select is decided in TRANS_DP_CTL */
if (intel_crtc->pipe == 1)
if (gma_crtc->pipe == 1)
intel_dp->DP |= DP_PIPEB_SELECT;

REG_WRITE(intel_dp->output_reg, (intel_dp->DP | DP_PORT_EN));
Expand All @@ -901,7 +901,7 @@ cdv_intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode
else
pfit_control = 0;

pfit_control |= intel_crtc->pipe << PFIT_PIPE_SHIFT;
pfit_control |= gma_crtc->pipe << PFIT_PIPE_SHIFT;

REG_WRITE(PFIT_CONTROL, pfit_control);
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/gma500/cdv_intel_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static void cdv_hdmi_mode_set(struct drm_encoder *encoder,
struct mid_intel_hdmi_priv *hdmi_priv = psb_intel_encoder->dev_priv;
u32 hdmib;
struct drm_crtc *crtc = encoder->crtc;
struct psb_intel_crtc *intel_crtc = to_psb_intel_crtc(crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);

hdmib = (2 << 10);

Expand All @@ -77,7 +77,7 @@ static void cdv_hdmi_mode_set(struct drm_encoder *encoder,
if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
hdmib |= HDMI_HSYNC_ACTIVE_HIGH;

if (intel_crtc->pipe == 1)
if (gma_crtc->pipe == 1)
hdmib |= HDMIB_PIPE_B_SELECT;

if (hdmi_priv->has_hdmi_audio) {
Expand Down Expand Up @@ -167,7 +167,7 @@ static int cdv_hdmi_set_property(struct drm_connector *connector,
struct drm_encoder *encoder = connector->encoder;

if (!strcmp(property->name, "scaling mode") && encoder) {
struct psb_intel_crtc *crtc = to_psb_intel_crtc(encoder->crtc);
struct gma_crtc *crtc = to_gma_crtc(encoder->crtc);
bool centre;
uint64_t curValue;

Expand Down
8 changes: 3 additions & 5 deletions drivers/gpu/drm/gma500/cdv_intel_lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder,
{
struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(
encoder->crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc);
u32 pfit_control;

/*
Expand All @@ -379,7 +378,7 @@ static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder,
else
pfit_control = 0;

pfit_control |= psb_intel_crtc->pipe << PFIT_PIPE_SHIFT;
pfit_control |= gma_crtc->pipe << PFIT_PIPE_SHIFT;

if (dev_priv->lvds_dither)
pfit_control |= PANEL_8TO6_DITHER_ENABLE;
Expand Down Expand Up @@ -461,8 +460,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector,
struct drm_encoder *encoder = connector->encoder;

if (!strcmp(property->name, "scaling mode") && encoder) {
struct psb_intel_crtc *crtc =
to_psb_intel_crtc(encoder->crtc);
struct gma_crtc *crtc = to_gma_crtc(encoder->crtc);
uint64_t curValue;

if (!crtc)
Expand Down
16 changes: 8 additions & 8 deletions drivers/gpu/drm/gma500/framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,21 +520,21 @@ static struct drm_framebuffer *psb_user_framebuffer_create
static void psbfb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
u16 blue, int regno)
{
struct psb_intel_crtc *intel_crtc = to_psb_intel_crtc(crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);

intel_crtc->lut_r[regno] = red >> 8;
intel_crtc->lut_g[regno] = green >> 8;
intel_crtc->lut_b[regno] = blue >> 8;
gma_crtc->lut_r[regno] = red >> 8;
gma_crtc->lut_g[regno] = green >> 8;
gma_crtc->lut_b[regno] = blue >> 8;
}

static void psbfb_gamma_get(struct drm_crtc *crtc, u16 *red,
u16 *green, u16 *blue, int regno)
{
struct psb_intel_crtc *intel_crtc = to_psb_intel_crtc(crtc);
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);

*red = intel_crtc->lut_r[regno] << 8;
*green = intel_crtc->lut_g[regno] << 8;
*blue = intel_crtc->lut_b[regno] << 8;
*red = gma_crtc->lut_r[regno] << 8;
*green = gma_crtc->lut_g[regno] << 8;
*blue = gma_crtc->lut_b[regno] << 8;
}

static int psbfb_probe(struct drm_fb_helper *helper,
Expand Down
Loading

0 comments on commit 6306865

Please sign in to comment.