Skip to content

Commit 8ee7956

Browse files
committed
Merge branch 'linux-5.3' of git://github.com/skeggsb/linux into drm-next
nouveau fixes and TU116 enablement. Signed-off-by: Dave Airlie <[email protected]> From: Ben Skeggs <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv5hZ3B4S9cVTPd2-Ug7dMSasLPJrWMyoDo4MOg8cbXWkA@mail.gmail.com
2 parents 9fb7dc7 + 4d352db commit 8ee7956

File tree

342 files changed

+475
-372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+475
-372
lines changed

drivers/gpu/drm/nouveau/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: GPL-2.0
1+
# SPDX-License-Identifier: MIT
22
ccflags-y += -I $(srctree)/$(src)/include
33
ccflags-y += -I $(srctree)/$(src)/include/nvkm
44
ccflags-y += -I $(srctree)/$(src)/nvkm

drivers/gpu/drm/nouveau/dispnv04/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: GPL-2.0
1+
# SPDX-License-Identifier: MIT
22
nouveau-y += dispnv04/arb.o
33
nouveau-y += dispnv04/crtc.o
44
nouveau-y += dispnv04/cursor.o

drivers/gpu/drm/nouveau/dispnv04/cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: GPL-2.0
1+
// SPDX-License-Identifier: MIT
22
#include <drm/drmP.h>
33
#include <drm/drm_mode.h>
44
#include "nouveau_drv.h"

drivers/gpu/drm/nouveau/dispnv04/disp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0 */
1+
/* SPDX-License-Identifier: MIT */
22
#ifndef __NV04_DISPLAY_H__
33
#define __NV04_DISPLAY_H__
44
#include <subdev/bios.h>

drivers/gpu/drm/nouveau/dispnv50/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: GPL-2.0
1+
# SPDX-License-Identifier: MIT
22
nouveau-y += dispnv50/disp.o
33
nouveau-y += dispnv50/lut.o
44

drivers/gpu/drm/nouveau/dispnv50/disp.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,13 @@ nv50_outp_atomic_check_view(struct drm_encoder *encoder,
322322
switch (connector->connector_type) {
323323
case DRM_MODE_CONNECTOR_LVDS:
324324
case DRM_MODE_CONNECTOR_eDP:
325-
/* Force use of scaler for non-EDID modes. */
326-
if (adjusted_mode->type & DRM_MODE_TYPE_DRIVER)
325+
/* Don't force scaler for EDID modes with
326+
* same size as the native one (e.g. different
327+
* refresh rate)
328+
*/
329+
if (adjusted_mode->hdisplay == native_mode->hdisplay &&
330+
adjusted_mode->vdisplay == native_mode->vdisplay &&
331+
adjusted_mode->type & DRM_MODE_TYPE_DRIVER)
327332
break;
328333
mode = native_mode;
329334
asyc->scaler.full = true;

drivers/gpu/drm/nouveau/dispnv50/head.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,34 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh,
169169
*/
170170
switch (mode) {
171171
case DRM_MODE_SCALE_CENTER:
172-
asyh->view.oW = min((u16)umode->hdisplay, asyh->view.oW);
173-
asyh->view.oH = min((u16)umode_vdisplay, asyh->view.oH);
174-
/* fall-through */
172+
/* NOTE: This will cause scaling when the input is
173+
* larger than the output.
174+
*/
175+
asyh->view.oW = min(asyh->view.iW, asyh->view.oW);
176+
asyh->view.oH = min(asyh->view.iH, asyh->view.oH);
177+
break;
175178
case DRM_MODE_SCALE_ASPECT:
176-
if (asyh->view.oH < asyh->view.oW) {
179+
/* Determine whether the scaling should be on width or on
180+
* height. This is done by comparing the aspect ratios of the
181+
* sizes. If the output AR is larger than input AR, that means
182+
* we want to change the width (letterboxed on the
183+
* left/right), otherwise on the height (letterboxed on the
184+
* top/bottom).
185+
*
186+
* E.g. 4:3 (1.333) AR image displayed on a 16:10 (1.6) AR
187+
* screen will have letterboxes on the left/right. However a
188+
* 16:9 (1.777) AR image on that same screen will have
189+
* letterboxes on the top/bottom.
190+
*
191+
* inputAR = iW / iH; outputAR = oW / oH
192+
* outputAR > inputAR is equivalent to oW * iH > iW * oH
193+
*/
194+
if (asyh->view.oW * asyh->view.iH > asyh->view.iW * asyh->view.oH) {
195+
/* Recompute output width, i.e. left/right letterbox */
177196
u32 r = (asyh->view.iW << 19) / asyh->view.iH;
178197
asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19;
179198
} else {
199+
/* Recompute output height, i.e. top/bottom letterbox */
180200
u32 r = (asyh->view.iH << 19) / asyh->view.iW;
181201
asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19;
182202
}

drivers/gpu/drm/nouveau/include/nvif/cl0002.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0 */
1+
/* SPDX-License-Identifier: MIT */
22
#ifndef __NVIF_CL0002_H__
33
#define __NVIF_CL0002_H__
44

drivers/gpu/drm/nouveau/include/nvif/cl0046.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0 */
1+
/* SPDX-License-Identifier: MIT */
22
#ifndef __NVIF_CL0046_H__
33
#define __NVIF_CL0046_H__
44

drivers/gpu/drm/nouveau/include/nvif/cl006b.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0 */
1+
/* SPDX-License-Identifier: MIT */
22
#ifndef __NVIF_CL006B_H__
33
#define __NVIF_CL006B_H__
44

0 commit comments

Comments
 (0)