*/
unsigned long max_mem_bandwidth;
+ /* HW has external source (e.g., BMC) to synchronize with */
+ bool has_vidrst:1;
+
/*
* HW does not handle 'startadd' register correctly. Always set
* it's value to 0.
};
#define MGAG200_DEVICE_INFO_INIT(_max_hdisplay, _max_vdisplay, _max_mem_bandwidth, \
- _bug_no_startadd) \
+ _has_vidrst, _bug_no_startadd) \
{ \
.max_hdisplay = (_max_hdisplay), \
.max_vdisplay = (_max_vdisplay), \
.max_mem_bandwidth = (_max_mem_bandwidth), \
+ .has_vidrst = (_has_vidrst), \
.bug_no_startadd = (_bug_no_startadd), \
}
*/
static const struct mgag200_device_info mgag200_g200_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false, false);
static void mgag200_g200_interpret_bios(struct mgag200_g200_device *g200,
const unsigned char *bios, size_t size)
*/
static const struct mgag200_device_info mgag200_g200eh_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 37500, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 37500, false, false);
struct mga_device *mgag200_g200eh_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
*/
static const struct mgag200_device_info mgag200_g200eh3_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false, false);
struct mga_device *mgag200_g200eh3_device_create(struct pci_dev *pdev,
const struct drm_driver *drv,
*/
static const struct mgag200_device_info mgag200_g200er_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false, false);
struct mga_device *mgag200_g200er_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
*/
static const struct mgag200_device_info mgag200_g200ev_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 32700, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 32700, false, false);
struct mga_device *mgag200_g200ev_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
*/
static const struct mgag200_device_info mgag200_g200ew3_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, true, false);
static resource_size_t mgag200_g200ew3_device_probe_vram(struct mga_device *mdev)
{
*/
static const struct mgag200_device_info mgag200_g200se_a_01_device_info =
- MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, true);
+ MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, false, true);
static const struct mgag200_device_info mgag200_g200se_a_02_device_info =
- MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, true);
+ MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, false, true);
static const struct mgag200_device_info mgag200_g200se_a_03_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false, false);
static const struct mgag200_device_info mgag200_g200se_b_01_device_info =
- MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, false);
+ MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, false, false);
static const struct mgag200_device_info mgag200_g200se_b_02_device_info =
- MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, false);
+ MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, false, false);
static const struct mgag200_device_info mgag200_g200se_b_03_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false, false);
static int mgag200_g200se_init_unique_rev_id(struct mgag200_g200se_device *g200se)
{
*/
static const struct mgag200_device_info mgag200_g200wb_device_info =
- MGAG200_DEVICE_INFO_INIT(1280, 1024, 31877, false);
+ MGAG200_DEVICE_INFO_INIT(1280, 1024, 31877, true, false);
struct mga_device *mgag200_g200wb_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
static void mgag200_set_mode_regs(struct mga_device *mdev,
const struct drm_display_mode *mode)
{
+ const struct mgag200_device_info *info = mdev->info;
unsigned int hdisplay, hsyncstart, hsyncend, htotal;
unsigned int vdisplay, vsyncstart, vsyncend, vtotal;
u8 misc, crtcext1, crtcext2, crtcext5;
((hdisplay & 0x100) >> 7) |
((hsyncstart & 0x100) >> 6) |
(htotal & 0x40);
- if (mdev->type == G200_WB || mdev->type == G200_EW3)
- crtcext1 |= BIT(7) | /* vrsten */
- BIT(3); /* hrsten */
+ if (info->has_vidrst)
+ crtcext1 |= MGAREG_CRTCEXT1_VRSTEN |
+ MGAREG_CRTCEXT1_HRSTEN;
crtcext2 = ((vtotal & 0xc00) >> 10) |
((vdisplay & 0x400) >> 8) |
#define MGAREG_CRTCEXT0_OFFSET_MASK GENMASK(5, 4)
+#define MGAREG_CRTCEXT1_VRSTEN BIT(7)
#define MGAREG_CRTCEXT1_VSYNCOFF BIT(5)
#define MGAREG_CRTCEXT1_HSYNCOFF BIT(4)
+#define MGAREG_CRTCEXT1_HRSTEN BIT(3)
#define MGAREG_CRTCEXT3_MGAMODE BIT(7)