diff options
author | Dave Airlie <airlied@redhat.com> | 2014-11-13 15:24:50 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-11-13 15:24:50 -0500 |
commit | 3d0f8536cd24079a68a53266517f6ab85d7d6f5b (patch) | |
tree | 37f64c68c02b46a3ffdba17284b7a74932e8b246 /drivers | |
parent | 64e5fcc68baaf5301af2c4d28229fcfeb99c009a (diff) | |
parent | eae7382bc5547391e72f8cde83f5e2be9c359d5b (diff) |
Merge branch 'linux-3.18' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes
One modesetting, one gk20a fix.
* 'linux-3.18' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
drm/nouveau/nv50/disp: Fix modeset on G94
drm/gk20a/fb: fix setting of large page size bit
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 25 |
2 files changed, 38 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c b/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c index a16024a74771..fde42e4d1b56 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c | |||
@@ -27,6 +27,20 @@ struct gk20a_fb_priv { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | static int | 29 | static int |
30 | gk20a_fb_init(struct nouveau_object *object) | ||
31 | { | ||
32 | struct gk20a_fb_priv *priv = (void *)object; | ||
33 | int ret; | ||
34 | |||
35 | ret = nouveau_fb_init(&priv->base); | ||
36 | if (ret) | ||
37 | return ret; | ||
38 | |||
39 | nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */ | ||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | static int | ||
30 | gk20a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | 44 | gk20a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, |
31 | struct nouveau_oclass *oclass, void *data, u32 size, | 45 | struct nouveau_oclass *oclass, void *data, u32 size, |
32 | struct nouveau_object **pobject) | 46 | struct nouveau_object **pobject) |
@@ -48,7 +62,7 @@ gk20a_fb_oclass = &(struct nouveau_fb_impl) { | |||
48 | .base.ofuncs = &(struct nouveau_ofuncs) { | 62 | .base.ofuncs = &(struct nouveau_ofuncs) { |
49 | .ctor = gk20a_fb_ctor, | 63 | .ctor = gk20a_fb_ctor, |
50 | .dtor = _nouveau_fb_dtor, | 64 | .dtor = _nouveau_fb_dtor, |
51 | .init = _nouveau_fb_init, | 65 | .init = gk20a_fb_init, |
52 | .fini = _nouveau_fb_fini, | 66 | .fini = _nouveau_fb_fini, |
53 | }, | 67 | }, |
54 | .memtype = nvc0_fb_memtype_valid, | 68 | .memtype = nvc0_fb_memtype_valid, |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index ae873d1a8d46..eb8b36714fa1 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -791,6 +791,22 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update) | |||
791 | } | 791 | } |
792 | 792 | ||
793 | static int | 793 | static int |
794 | nv50_crtc_set_raster_vblank_dmi(struct nouveau_crtc *nv_crtc, u32 usec) | ||
795 | { | ||
796 | struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); | ||
797 | u32 *push; | ||
798 | |||
799 | push = evo_wait(mast, 8); | ||
800 | if (!push) | ||
801 | return -ENOMEM; | ||
802 | |||
803 | evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1); | ||
804 | evo_data(push, usec); | ||
805 | evo_kick(push, mast); | ||
806 | return 0; | ||
807 | } | ||
808 | |||
809 | static int | ||
794 | nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update) | 810 | nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update) |
795 | { | 811 | { |
796 | struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); | 812 | struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); |
@@ -1104,14 +1120,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, | |||
1104 | evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2); | 1120 | evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2); |
1105 | evo_data(push, 0x00800000 | mode->clock); | 1121 | evo_data(push, 0x00800000 | mode->clock); |
1106 | evo_data(push, (ilace == 2) ? 2 : 0); | 1122 | evo_data(push, (ilace == 2) ? 2 : 0); |
1107 | evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 8); | 1123 | evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 6); |
1108 | evo_data(push, 0x00000000); | 1124 | evo_data(push, 0x00000000); |
1109 | evo_data(push, (vactive << 16) | hactive); | 1125 | evo_data(push, (vactive << 16) | hactive); |
1110 | evo_data(push, ( vsynce << 16) | hsynce); | 1126 | evo_data(push, ( vsynce << 16) | hsynce); |
1111 | evo_data(push, (vblanke << 16) | hblanke); | 1127 | evo_data(push, (vblanke << 16) | hblanke); |
1112 | evo_data(push, (vblanks << 16) | hblanks); | 1128 | evo_data(push, (vblanks << 16) | hblanks); |
1113 | evo_data(push, (vblan2e << 16) | vblan2s); | 1129 | evo_data(push, (vblan2e << 16) | vblan2s); |
1114 | evo_data(push, vblankus); | 1130 | evo_mthd(push, 0x082c + (nv_crtc->index * 0x400), 1); |
1115 | evo_data(push, 0x00000000); | 1131 | evo_data(push, 0x00000000); |
1116 | evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2); | 1132 | evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2); |
1117 | evo_data(push, 0x00000311); | 1133 | evo_data(push, 0x00000311); |
@@ -1141,6 +1157,11 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, | |||
1141 | nv_connector = nouveau_crtc_connector_get(nv_crtc); | 1157 | nv_connector = nouveau_crtc_connector_get(nv_crtc); |
1142 | nv50_crtc_set_dither(nv_crtc, false); | 1158 | nv50_crtc_set_dither(nv_crtc, false); |
1143 | nv50_crtc_set_scale(nv_crtc, false); | 1159 | nv50_crtc_set_scale(nv_crtc, false); |
1160 | |||
1161 | /* G94 only accepts this after setting scale */ | ||
1162 | if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA) | ||
1163 | nv50_crtc_set_raster_vblank_dmi(nv_crtc, vblankus); | ||
1164 | |||
1144 | nv50_crtc_set_color_vibrance(nv_crtc, false); | 1165 | nv50_crtc_set_color_vibrance(nv_crtc, false); |
1145 | nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false); | 1166 | nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false); |
1146 | return 0; | 1167 | return 0; |