diff options
Diffstat (limited to 'drivers/gpu/drm/tegra')
| -rw-r--r-- | drivers/gpu/drm/tegra/dc.c | 14 | ||||
| -rw-r--r-- | drivers/gpu/drm/tegra/drm.h | 18 | ||||
| -rw-r--r-- | drivers/gpu/drm/tegra/hdmi.c | 27 | ||||
| -rw-r--r-- | drivers/gpu/drm/tegra/host1x.c | 5 | 
4 files changed, 19 insertions, 45 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 53b98520ebd..656b2e3334a 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -102,12 +102,12 @@ static int tegra_dc_set_timings(struct tegra_dc *dc,  		((mode->hsync_end - mode->hsync_start) <<  0);  	tegra_dc_writel(dc, value, DC_DISP_SYNC_WIDTH); -	value = ((mode->vsync_start - mode->vdisplay) << 16) | -		((mode->hsync_start - mode->hdisplay) <<  0); -	tegra_dc_writel(dc, value, DC_DISP_BACK_PORCH); -  	value = ((mode->vtotal - mode->vsync_end) << 16) |  		((mode->htotal - mode->hsync_end) <<  0); +	tegra_dc_writel(dc, value, DC_DISP_BACK_PORCH); + +	value = ((mode->vsync_start - mode->vdisplay) << 16) | +		((mode->hsync_start - mode->hdisplay) <<  0);  	tegra_dc_writel(dc, value, DC_DISP_FRONT_PORCH);  	value = (mode->vdisplay << 16) | mode->hdisplay; @@ -218,11 +218,10 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc,  	}  	bpp = crtc->fb->bits_per_pixel / 8; -	win.stride = win.outw * bpp; +	win.stride = crtc->fb->pitches[0];  	/* program window registers */ -	value = tegra_dc_readl(dc, DC_CMD_DISPLAY_WINDOW_HEADER); -	value |= WINDOW_A_SELECT; +	value = WINDOW_A_SELECT;  	tegra_dc_writel(dc, value, DC_CMD_DISPLAY_WINDOW_HEADER);  	tegra_dc_writel(dc, win.fmt, DC_WIN_COLOR_DEPTH); @@ -818,6 +817,7 @@ static int tegra_dc_remove(struct platform_device *pdev)  }  static struct of_device_id tegra_dc_of_match[] = { +	{ .compatible = "nvidia,tegra30-dc", },  	{ .compatible = "nvidia,tegra20-dc", },  	{ },  }; diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index 3a843a77ddc..741b5dc2742 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -204,24 +204,6 @@ extern int tegra_output_parse_dt(struct tegra_output *output);  extern int tegra_output_init(struct drm_device *drm, struct tegra_output *output);  extern int tegra_output_exit(struct tegra_output *output); -/* from gem.c */ -extern struct tegra_gem_object *tegra_gem_alloc(struct drm_device *drm, -						size_t size); -extern int tegra_gem_handle_create(struct drm_device *drm, -				   struct drm_file *file, size_t size, -				   unsigned long flags, uint32_t *handle); -extern int tegra_gem_dumb_create(struct drm_file *file, struct drm_device *drm, -				 struct drm_mode_create_dumb *args); -extern int tegra_gem_dumb_map_offset(struct drm_file *file, -				     struct drm_device *drm, uint32_t handle, -				     uint64_t *offset); -extern int tegra_gem_dumb_destroy(struct drm_file *file, -				  struct drm_device *drm, uint32_t handle); -extern int tegra_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); -extern int tegra_gem_init_object(struct drm_gem_object *obj); -extern void tegra_gem_free_object(struct drm_gem_object *obj); -extern struct vm_operations_struct tegra_gem_vm_ops; -  /* from fb.c */  extern int tegra_drm_fb_init(struct drm_device *drm);  extern void tegra_drm_fb_exit(struct drm_device *drm); diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 58f55dc6d59..e060c7e6434 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -149,7 +149,7 @@ struct tmds_config {  };  static const struct tmds_config tegra2_tmds_config[] = { -	{ /* 480p modes */ +	{ /* slow pixel clock modes */  		.pclk = 27000000,  		.pll0 = SOR_PLL_BG_V17_S(3) | SOR_PLL_ICHPMP(1) |  			SOR_PLL_RESISTORSEL | SOR_PLL_VCOCAP(0) | @@ -163,21 +163,8 @@ static const struct tmds_config tegra2_tmds_config[] = {  			DRIVE_CURRENT_LANE1(DRIVE_CURRENT_7_125_mA) |  			DRIVE_CURRENT_LANE2(DRIVE_CURRENT_7_125_mA) |  			DRIVE_CURRENT_LANE3(DRIVE_CURRENT_7_125_mA), -	}, { /* 720p modes */ -		.pclk = 74250000, -		.pll0 = SOR_PLL_BG_V17_S(3) | SOR_PLL_ICHPMP(1) | -			SOR_PLL_RESISTORSEL | SOR_PLL_VCOCAP(1) | -			SOR_PLL_TX_REG_LOAD(3), -		.pll1 = SOR_PLL_TMDS_TERM_ENABLE | SOR_PLL_PE_EN, -		.pe_current = PE_CURRENT0(PE_CURRENT_6_0_mA) | -			PE_CURRENT1(PE_CURRENT_6_0_mA) | -			PE_CURRENT2(PE_CURRENT_6_0_mA) | -			PE_CURRENT3(PE_CURRENT_6_0_mA), -		.drive_current = DRIVE_CURRENT_LANE0(DRIVE_CURRENT_7_125_mA) | -			DRIVE_CURRENT_LANE1(DRIVE_CURRENT_7_125_mA) | -			DRIVE_CURRENT_LANE2(DRIVE_CURRENT_7_125_mA) | -			DRIVE_CURRENT_LANE3(DRIVE_CURRENT_7_125_mA), -	}, { /* 1080p modes */ +	}, +	{ /* high pixel clock modes */  		.pclk = UINT_MAX,  		.pll0 = SOR_PLL_BG_V17_S(3) | SOR_PLL_ICHPMP(1) |  			SOR_PLL_RESISTORSEL | SOR_PLL_VCOCAP(1) | @@ -479,7 +466,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,  		return;  	} -	h_front_porch = mode->htotal - mode->hsync_end; +	h_front_porch = mode->hsync_start - mode->hdisplay;  	memset(&frame, 0, sizeof(frame));  	frame.r = HDMI_AVI_R_SAME; @@ -634,8 +621,8 @@ static int tegra_output_hdmi_enable(struct tegra_output *output)  	pclk = mode->clock * 1000;  	h_sync_width = mode->hsync_end - mode->hsync_start; -	h_front_porch = mode->htotal - mode->hsync_end; -	h_back_porch = mode->hsync_start - mode->hdisplay; +	h_back_porch = mode->htotal - mode->hsync_end; +	h_front_porch = mode->hsync_start - mode->hdisplay;  	err = regulator_enable(hdmi->vdd);  	if (err < 0) { @@ -1318,8 +1305,8 @@ static int tegra_hdmi_remove(struct platform_device *pdev)  }  static struct of_device_id tegra_hdmi_of_match[] = { -	{ .compatible = "nvidia,tegra20-hdmi", },  	{ .compatible = "nvidia,tegra30-hdmi", }, +	{ .compatible = "nvidia,tegra20-hdmi", },  	{ },  }; diff --git a/drivers/gpu/drm/tegra/host1x.c b/drivers/gpu/drm/tegra/host1x.c index 1f728cd7f61..5d17b113a6f 100644 --- a/drivers/gpu/drm/tegra/host1x.c +++ b/drivers/gpu/drm/tegra/host1x.c @@ -68,6 +68,8 @@ static int host1x_parse_dt(struct host1x *host1x)  	static const char * const compat[] = {  		"nvidia,tegra20-dc",  		"nvidia,tegra20-hdmi", +		"nvidia,tegra30-dc", +		"nvidia,tegra30-hdmi",  	};  	unsigned int i;  	int err; @@ -237,6 +239,8 @@ int host1x_register_client(struct host1x *host1x, struct host1x_client *client)  		}  	} +	client->host1x = host1x; +  	return 0;  } @@ -268,6 +272,7 @@ int host1x_unregister_client(struct host1x *host1x,  }  static struct of_device_id tegra_host1x_of_match[] = { +	{ .compatible = "nvidia,tegra30-host1x", },  	{ .compatible = "nvidia,tegra20-host1x", },  	{ },  };  |