|
14 | 14 | #include <linux/platform_device.h> |
15 | 15 | #include <linux/clk/tegra.h> |
16 | 16 |
|
17 | | -#include "drm.h" |
18 | | -#include "dc.h" |
19 | 17 | #include "host1x_client.h" |
| 18 | +#include "dc.h" |
| 19 | +#include "drm.h" |
| 20 | +#include "gem.h" |
20 | 21 |
|
21 | 22 | struct tegra_plane { |
22 | 23 | struct drm_plane base; |
@@ -52,9 +53,9 @@ static int tegra_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, |
52 | 53 | window.bits_per_pixel = fb->bits_per_pixel; |
53 | 54 |
|
54 | 55 | for (i = 0; i < drm_format_num_planes(fb->pixel_format); i++) { |
55 | | - struct drm_gem_cma_object *gem = drm_fb_cma_get_gem_obj(fb, i); |
| 56 | + struct tegra_bo *bo = tegra_fb_get_plane(fb, i); |
56 | 57 |
|
57 | | - window.base[i] = gem->paddr + fb->offsets[i]; |
| 58 | + window.base[i] = bo->paddr + fb->offsets[i]; |
58 | 59 |
|
59 | 60 | /* |
60 | 61 | * Tegra doesn't support different strides for U and V planes |
@@ -137,15 +138,15 @@ static int tegra_dc_add_planes(struct drm_device *drm, struct tegra_dc *dc) |
137 | 138 | static int tegra_dc_set_base(struct tegra_dc *dc, int x, int y, |
138 | 139 | struct drm_framebuffer *fb) |
139 | 140 | { |
140 | | - struct drm_gem_cma_object *gem = drm_fb_cma_get_gem_obj(fb, 0); |
| 141 | + struct tegra_bo *bo = tegra_fb_get_plane(fb, 0); |
141 | 142 | unsigned long value; |
142 | 143 |
|
143 | 144 | tegra_dc_writel(dc, WINDOW_A_SELECT, DC_CMD_DISPLAY_WINDOW_HEADER); |
144 | 145 |
|
145 | 146 | value = fb->offsets[0] + y * fb->pitches[0] + |
146 | 147 | x * fb->bits_per_pixel / 8; |
147 | 148 |
|
148 | | - tegra_dc_writel(dc, gem->paddr + value, DC_WINBUF_START_ADDR); |
| 149 | + tegra_dc_writel(dc, bo->paddr + value, DC_WINBUF_START_ADDR); |
149 | 150 | tegra_dc_writel(dc, fb->pitches[0], DC_WIN_LINE_STRIDE); |
150 | 151 |
|
151 | 152 | value = GENERAL_UPDATE | WIN_A_UPDATE; |
@@ -187,20 +188,20 @@ static void tegra_dc_finish_page_flip(struct tegra_dc *dc) |
187 | 188 | { |
188 | 189 | struct drm_device *drm = dc->base.dev; |
189 | 190 | struct drm_crtc *crtc = &dc->base; |
190 | | - struct drm_gem_cma_object *gem; |
191 | 191 | unsigned long flags, base; |
| 192 | + struct tegra_bo *bo; |
192 | 193 |
|
193 | 194 | if (!dc->event) |
194 | 195 | return; |
195 | 196 |
|
196 | | - gem = drm_fb_cma_get_gem_obj(crtc->fb, 0); |
| 197 | + bo = tegra_fb_get_plane(crtc->fb, 0); |
197 | 198 |
|
198 | 199 | /* check if new start address has been latched */ |
199 | 200 | tegra_dc_writel(dc, READ_MUX, DC_CMD_STATE_ACCESS); |
200 | 201 | base = tegra_dc_readl(dc, DC_WINBUF_START_ADDR); |
201 | 202 | tegra_dc_writel(dc, 0, DC_CMD_STATE_ACCESS); |
202 | 203 |
|
203 | | - if (base == gem->paddr + crtc->fb->offsets[0]) { |
| 204 | + if (base == bo->paddr + crtc->fb->offsets[0]) { |
204 | 205 | spin_lock_irqsave(&drm->event_lock, flags); |
205 | 206 | drm_send_vblank_event(drm, dc->pipe, dc->event); |
206 | 207 | drm_vblank_put(drm, dc->pipe); |
@@ -570,7 +571,7 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, |
570 | 571 | struct drm_display_mode *adjusted, |
571 | 572 | int x, int y, struct drm_framebuffer *old_fb) |
572 | 573 | { |
573 | | - struct drm_gem_cma_object *gem = drm_fb_cma_get_gem_obj(crtc->fb, 0); |
| 574 | + struct tegra_bo *bo = tegra_fb_get_plane(crtc->fb, 0); |
574 | 575 | struct tegra_dc *dc = to_tegra_dc(crtc); |
575 | 576 | struct tegra_dc_window window; |
576 | 577 | unsigned long div, value; |
@@ -617,7 +618,7 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, |
617 | 618 | window.format = tegra_dc_format(crtc->fb->pixel_format); |
618 | 619 | window.bits_per_pixel = crtc->fb->bits_per_pixel; |
619 | 620 | window.stride[0] = crtc->fb->pitches[0]; |
620 | | - window.base[0] = gem->paddr; |
| 621 | + window.base[0] = bo->paddr; |
621 | 622 |
|
622 | 623 | err = tegra_dc_setup_window(dc, 0, &window); |
623 | 624 | if (err < 0) |
|
0 commit comments