Skip to content

Commit 895a479

Browse files
author
Thomas Zimmermann
committed
drm/mgag200: Inline mga_crtc_{prepare, commit}() into enable function
There's only trivial code left in mga_crtc_{prepare,commit}(). Merge the functions into the simple pipe's enable function. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 904347f commit 895a479

File tree

1 file changed

+7
-32
lines changed

1 file changed

+7
-32
lines changed

drivers/gpu/drm/mgag200/mgag200_mode.c

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,36 +1335,6 @@ static void mgag200_disable_display(struct mga_device *mdev)
13351335
WREG_ECRT(0x01, crtcext1);
13361336
}
13371337

1338-
/*
1339-
* This is called before a mode is programmed. A typical use might be to
1340-
* enable DPMS during the programming to avoid seeing intermediate stages,
1341-
* but that's not relevant to us
1342-
*/
1343-
static void mga_crtc_prepare(struct drm_crtc *crtc)
1344-
{
1345-
struct drm_device *dev = crtc->dev;
1346-
struct mga_device *mdev = to_mga_device(dev);
1347-
1348-
if (mdev->type == G200_WB || mdev->type == G200_EW3)
1349-
mgag200_g200wb_hold_bmc(mdev);
1350-
}
1351-
1352-
/*
1353-
* This is called after a mode is programmed. It should reverse anything done
1354-
* by the prepare function
1355-
*/
1356-
static void mga_crtc_commit(struct drm_crtc *crtc)
1357-
{
1358-
struct drm_device *dev = crtc->dev;
1359-
struct mga_device *mdev = to_mga_device(dev);
1360-
1361-
if (mdev->type == G200_WB || mdev->type == G200_EW3)
1362-
mgag200_g200wb_release_bmc(mdev);
1363-
1364-
mga_crtc_load_lut(crtc);
1365-
mgag200_enable_display(mdev);
1366-
}
1367-
13681338
/*
13691339
* Connector
13701340
*/
@@ -1585,7 +1555,8 @@ mgag200_simple_display_pipe_enable(struct drm_simple_display_pipe *pipe,
15851555
.y2 = fb->height,
15861556
};
15871557

1588-
mga_crtc_prepare(crtc);
1558+
if (mdev->type == G200_WB || mdev->type == G200_EW3)
1559+
mgag200_g200wb_hold_bmc(mdev);
15891560

15901561
mgag200_set_format_regs(mdev, fb);
15911562
mgag200_set_mode_regs(mdev, adjusted_mode);
@@ -1599,7 +1570,11 @@ mgag200_simple_display_pipe_enable(struct drm_simple_display_pipe *pipe,
15991570
else if (mdev->type == G200_EV)
16001571
mgag200_g200ev_set_hiprilvl(mdev);
16011572

1602-
mga_crtc_commit(crtc);
1573+
if (mdev->type == G200_WB || mdev->type == G200_EW3)
1574+
mgag200_g200wb_release_bmc(mdev);
1575+
1576+
mga_crtc_load_lut(crtc);
1577+
mgag200_enable_display(mdev);
16031578

16041579
mgag200_handle_damage(mdev, fb, &fullscreen);
16051580
}

0 commit comments

Comments
 (0)