Lines Matching defs:gv
77 struct grfvideo_mode gv[1];
170 gv->pixel_clock = atoi(cps[1]);
171 gv->disp_width = atoi(cps[2]);
172 gv->disp_height = atoi(cps[3]);
173 gv->depth = atoi(cps[4]);
174 gv->hblank_start = atoi(cps[5]);
175 gv->hsync_start = atoi(cps[6]);
176 gv->hsync_stop = atoi(cps[7]);
177 gv->htotal = atoi(cps[8]);
178 gv->vblank_start = atoi(cps[9]);
179 gv->vsync_start = atoi(cps[10]);
180 gv->vsync_stop = atoi(cps[11]);
181 gv->vtotal = atoi(cps[12]);
184 gv->mode_num = y;
187 gv->mode_num = 255;
188 gv->depth = 4;
194 if ((gv->pixel_clock == 0) ||
195 (gv->disp_width == 0) ||
196 (gv->disp_height == 0) ||
197 (gv->depth == 0) ||
198 (gv->hblank_start == 0) ||
199 (gv->hsync_start == 0) ||
200 (gv->hsync_stop == 0) ||
201 (gv->htotal == 0) ||
202 (gv->vblank_start == 0) ||
203 (gv->vsync_start == 0) ||
204 (gv->vsync_stop == 0) ||
205 (gv->vtotal == 0)) {
207 "mode #%d: `%s'", gv->mode_num, obuf);
211 gv->disp_flags = GRF_FLAGS_DEFAULT;
213 gv->disp_flags = GRF_FLAGS_DEFAULT;
217 gv->disp_flags |= grf_flagp->grf_flag_number;
220 if (gv->disp_flags == GRF_FLAGS_DEFAULT)
227 * Check for impossible gv->disp_flags:
233 if ((gv->disp_flags & GRF_FLAGS_DBLSCAN) &&
234 (gv->disp_flags & GRF_FLAGS_LACE))
236 if ((gv->disp_flags & GRF_FLAGS_PHSYNC) &&
237 (gv->disp_flags & GRF_FLAGS_NHSYNC))
239 if ((gv->disp_flags & GRF_FLAGS_PVSYNC) &&
240 (gv->disp_flags & GRF_FLAGS_NVSYNC))
246 gv->mode_num, errortext);
249 if ((gv->htotal < (gv->disp_width / 4))) {
250 gv->hblank_start *= 8;
251 gv->hsync_start *= 8;
252 gv->hsync_stop *= 8;
253 gv->htotal *= 8;
254 suggest(gv, "horizontal videoclock cycle "
260 uplim = gv->disp_height + (gv->disp_height / 4);
261 lowlim = gv->disp_height - (gv->disp_height / 4);
262 if (((gv->vtotal * 2) > lowlim) &&
263 ((gv->vtotal * 2) < uplim)) {
264 gv->vblank_start *= 2;
265 gv->vsync_start *= 2;
266 gv->vsync_stop *= 2;
267 gv->vtotal *= 2;
268 gv->disp_flags &= ~GRF_FLAGS_DBLSCAN;
269 gv->disp_flags |= GRF_FLAGS_LACE;
270 suggest(gv, "vertical values for interlace "
273 } else if (((gv->vtotal / 2) > lowlim) &&
274 ((gv->vtotal / 2) < uplim)) {
275 gv->vblank_start /= 2;
276 gv->vsync_start /= 2;
277 gv->vsync_stop /= 2;
278 gv->vtotal /= 2;
279 gv->disp_flags &= ~GRF_FLAGS_LACE;
280 gv->disp_flags |= GRF_FLAGS_DBLSCAN;
281 suggest(gv, "vertical values for doublescan "
291 print_modeline(stdout, gv, 1);
293 gv->mode_descr[0] = 0;
294 if (ioctl(grffd, GRFIOCSETMON, (char *) gv) < 0)
297 gv->mode_num);
305 c = gv->mode_num = (c != (y - 1)) ? c : 255;
306 if (ioctl(grffd, GRFGETVMODE, gv) < 0)
309 print_modeline(stdout, gv, 0);
315 printf("%2d: ", gv->mode_num);
318 gv->disp_width,
319 gv->disp_height);
322 printf("x%d", gv->depth);
325 gv->disp_width / 8,
326 gv->disp_height / gv->depth);
329 gv->pixel_clock / (gv->htotal * 1000),
330 (gv->pixel_clock / (gv->htotal * 100))
332 gv->pixel_clock / (gv->htotal * gv->vtotal));
335 if (gv->disp_flags == GRF_FLAGS_DEFAULT) {
342 if (gv->disp_flags & grf_flagp->grf_flag_number)
353 suggest(struct grfvideo_mode *gv, const char *d, const char *s)
358 print_modeline(stderr, gv, 0);
362 print_modeline(FILE *fp, struct grfvideo_mode *gv, int rawflags)
366 if (gv->mode_num == 255)
369 fprintf(fp, "%d ", gv->mode_num);
372 gv->pixel_clock,
373 gv->disp_width,
374 gv->disp_height,
375 gv->depth,
376 gv->hblank_start,
377 gv->hsync_start,
378 gv->hsync_stop,
379 gv->htotal,
380 gv->vblank_start,
381 gv->vsync_start,
382 gv->vsync_stop,
383 gv->vtotal);
386 fprintf(fp, " 0x%.2x\n", gv->disp_flags);
389 if (gv->disp_flags == GRF_FLAGS_DEFAULT) {
395 if (gv->disp_flags & grf_flagp->grf_flag_number)