aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ast
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-01-08 18:55:57 -0500
committerDave Airlie <airlied@redhat.com>2017-01-08 18:55:57 -0500
commit3806a271bf4be375f304e492148edb2507181158 (patch)
treecd1b2410e8a98e63e44c4cee058b2beeb1924cf4 /drivers/gpu/drm/ast
parenta121103c922847ba5010819a3f250f1f7fc84ab8 (diff)
parent9b8b75de4cb379187c481a5332a12429f31c0887 (diff)
Merge tag 'drm-misc-next-2016-12-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next
First -misc pull for 4.11: - drm_mm rework + lots of selftests (Chris Wilson) - new connector_list locking+iterators - plenty of kerneldoc updates - format handling rework from Ville - atomic helper changes from Maarten for better plane corner-case handling in drivers, plus the i915 legacy cursor patch that needs this - bridge cleanup from Laurent - plus plenty of small stuff all over - also contains a merge of the 4.10 docs tree so that we could apply the dma-buf kerneldoc patches It's a lot more than usual, but due to the merge window blackout it also covers about 4 weeks, so all in line again on a per-week basis. The more annoying part with no pull request for 4 weeks is managing cross-tree work. The -intel pull request I'll follow up with does conflict quite a bit with -misc here. Longer-term (if drm-misc keeps growing) a drm-next-queued to accept pull request for the next merge window during this time might be useful. I'd also like to backmerge -rc2+this into drm-intel next week, we have quite a pile of patches waiting for the stuff in here. * tag 'drm-misc-next-2016-12-30' of git://anongit.freedesktop.org/git/drm-misc: (126 commits) drm: Add kerneldoc markup for new @scan parameters in drm_mm drm/mm: Document locking rules drm: Use drm_mm_insert_node_in_range_generic() for everyone drm: Apply range restriction after color adjustment when allocation drm: Wrap drm_mm_node.hole_follows drm: Apply tight eviction scanning to color_adjust drm: Simplify drm_mm scan-list manipulation drm: Optimise power-of-two alignments in drm_mm_scan_add_block() drm: Compute tight evictions for drm_mm_scan drm: Fix application of color vs range restriction when scanning drm_mm drm: Unconditionally do the range check in drm_mm_scan_add_block() drm: Rename prev_node to hole in drm_mm_scan_add_block() drm: Fix O= out-of-tree builds for selftests drm: Extract struct drm_mm_scan from struct drm_mm drm: Add asserts to catch overflow in drm_mm_init() and drm_mm_init_scan() drm: Simplify drm_mm_clean() drm: Detect overflow in drm_mm_reserve_node() drm: Fix kerneldoc for drm_mm_scan_remove_block() drm: Promote drm_mm alignment to u64 drm: kselftest for drm_mm and restricted color eviction ...
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r--drivers/gpu/drm/ast/ast_drv.h1
-rw-r--r--drivers/gpu/drm/ast/ast_fb.c4
-rw-r--r--drivers/gpu/drm/ast/ast_main.c2
-rw-r--r--drivers/gpu/drm/ast/ast_mode.c16
4 files changed, 15 insertions, 8 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 908011d2c8f5..6f3b6f50cf52 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -28,6 +28,7 @@
28#ifndef __AST_DRV_H__ 28#ifndef __AST_DRV_H__
29#define __AST_DRV_H__ 29#define __AST_DRV_H__
30 30
31#include <drm/drm_encoder.h>
31#include <drm/drm_fb_helper.h> 32#include <drm/drm_fb_helper.h>
32 33
33#include <drm/ttm/ttm_bo_api.h> 34#include <drm/ttm/ttm_bo_api.h>
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index d6f5ec64c667..b085140fae95 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -49,7 +49,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
49 struct drm_gem_object *obj; 49 struct drm_gem_object *obj;
50 struct ast_bo *bo; 50 struct ast_bo *bo;
51 int src_offset, dst_offset; 51 int src_offset, dst_offset;
52 int bpp = (afbdev->afb.base.bits_per_pixel + 7)/8; 52 int bpp = afbdev->afb.base.format->cpp[0];
53 int ret = -EBUSY; 53 int ret = -EBUSY;
54 bool unmap = false; 54 bool unmap = false;
55 bool store_for_later = false; 55 bool store_for_later = false;
@@ -237,7 +237,7 @@ static int astfb_create(struct drm_fb_helper *helper,
237 info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0); 237 info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
238 info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0); 238 info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
239 239
240 drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); 240 drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
241 drm_fb_helper_fill_var(info, &afbdev->helper, sizes->fb_width, sizes->fb_height); 241 drm_fb_helper_fill_var(info, &afbdev->helper, sizes->fb_width, sizes->fb_height);
242 242
243 info->screen_base = sysram; 243 info->screen_base = sysram;
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index f75c6421db62..dcdd59d505bd 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -314,7 +314,7 @@ int ast_framebuffer_init(struct drm_device *dev,
314{ 314{
315 int ret; 315 int ret;
316 316
317 drm_helper_mode_fill_fb_struct(&ast_fb->base, mode_cmd); 317 drm_helper_mode_fill_fb_struct(dev, &ast_fb->base, mode_cmd);
318 ast_fb->obj = obj; 318 ast_fb->obj = obj;
319 ret = drm_framebuffer_init(dev, &ast_fb->base, &ast_fb_funcs); 319 ret = drm_framebuffer_init(dev, &ast_fb->base, &ast_fb_funcs);
320 if (ret) { 320 if (ret) {
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index e26c98f51eb4..606cb40f6c7c 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -79,12 +79,13 @@ static bool ast_get_vbios_mode_info(struct drm_crtc *crtc, struct drm_display_mo
79 struct ast_vbios_mode_info *vbios_mode) 79 struct ast_vbios_mode_info *vbios_mode)
80{ 80{
81 struct ast_private *ast = crtc->dev->dev_private; 81 struct ast_private *ast = crtc->dev->dev_private;
82 const struct drm_framebuffer *fb = crtc->primary->fb;
82 u32 refresh_rate_index = 0, mode_id, color_index, refresh_rate; 83 u32 refresh_rate_index = 0, mode_id, color_index, refresh_rate;
83 u32 hborder, vborder; 84 u32 hborder, vborder;
84 bool check_sync; 85 bool check_sync;
85 struct ast_vbios_enhtable *best = NULL; 86 struct ast_vbios_enhtable *best = NULL;
86 87
87 switch (crtc->primary->fb->bits_per_pixel) { 88 switch (fb->format->cpp[0] * 8) {
88 case 8: 89 case 8:
89 vbios_mode->std_table = &vbios_stdtable[VGAModeIndex]; 90 vbios_mode->std_table = &vbios_stdtable[VGAModeIndex];
90 color_index = VGAModeIndex - 1; 91 color_index = VGAModeIndex - 1;
@@ -207,7 +208,8 @@ static bool ast_get_vbios_mode_info(struct drm_crtc *crtc, struct drm_display_mo
207 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x91, 0x00); 208 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x91, 0x00);
208 if (vbios_mode->enh_table->flags & NewModeInfo) { 209 if (vbios_mode->enh_table->flags & NewModeInfo) {
209 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x91, 0xa8); 210 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x91, 0xa8);
210 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x92, crtc->primary->fb->bits_per_pixel); 211 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x92,
212 fb->format->cpp[0] * 8);
211 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x93, adjusted_mode->clock / 1000); 213 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x93, adjusted_mode->clock / 1000);
212 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x94, adjusted_mode->crtc_hdisplay); 214 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x94, adjusted_mode->crtc_hdisplay);
213 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x95, adjusted_mode->crtc_hdisplay >> 8); 215 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x95, adjusted_mode->crtc_hdisplay >> 8);
@@ -369,10 +371,11 @@ static void ast_set_crtc_reg(struct drm_crtc *crtc, struct drm_display_mode *mod
369static void ast_set_offset_reg(struct drm_crtc *crtc) 371static void ast_set_offset_reg(struct drm_crtc *crtc)
370{ 372{
371 struct ast_private *ast = crtc->dev->dev_private; 373 struct ast_private *ast = crtc->dev->dev_private;
374 const struct drm_framebuffer *fb = crtc->primary->fb;
372 375
373 u16 offset; 376 u16 offset;
374 377
375 offset = crtc->primary->fb->pitches[0] >> 3; 378 offset = fb->pitches[0] >> 3;
376 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x13, (offset & 0xff)); 379 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x13, (offset & 0xff));
377 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xb0, (offset >> 8) & 0x3f); 380 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xb0, (offset >> 8) & 0x3f);
378} 381}
@@ -395,9 +398,10 @@ static void ast_set_ext_reg(struct drm_crtc *crtc, struct drm_display_mode *mode
395 struct ast_vbios_mode_info *vbios_mode) 398 struct ast_vbios_mode_info *vbios_mode)
396{ 399{
397 struct ast_private *ast = crtc->dev->dev_private; 400 struct ast_private *ast = crtc->dev->dev_private;
401 const struct drm_framebuffer *fb = crtc->primary->fb;
398 u8 jregA0 = 0, jregA3 = 0, jregA8 = 0; 402 u8 jregA0 = 0, jregA3 = 0, jregA8 = 0;
399 403
400 switch (crtc->primary->fb->bits_per_pixel) { 404 switch (fb->format->cpp[0] * 8) {
401 case 8: 405 case 8:
402 jregA0 = 0x70; 406 jregA0 = 0x70;
403 jregA3 = 0x01; 407 jregA3 = 0x01;
@@ -452,7 +456,9 @@ static void ast_set_sync_reg(struct drm_device *dev, struct drm_display_mode *mo
452static bool ast_set_dac_reg(struct drm_crtc *crtc, struct drm_display_mode *mode, 456static bool ast_set_dac_reg(struct drm_crtc *crtc, struct drm_display_mode *mode,
453 struct ast_vbios_mode_info *vbios_mode) 457 struct ast_vbios_mode_info *vbios_mode)
454{ 458{
455 switch (crtc->primary->fb->bits_per_pixel) { 459 const struct drm_framebuffer *fb = crtc->primary->fb;
460
461 switch (fb->format->cpp[0] * 8) {
456 case 8: 462 case 8:
457 break; 463 break;
458 default: 464 default: