hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
u-boot/include/drm_modes.h
....@@ -38,7 +38,6 @@
3838 #define DRM_MODE_FLAG_PIXMUX (1 << 11)
3939 #define DRM_MODE_FLAG_DBLCLK (1 << 12)
4040 #define DRM_MODE_FLAG_CLKDIV2 (1 << 13)
41
-#define DRM_MODE_FLAG_PPIXDATA BIT(31)
4241 /*
4342 * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX
4443 * (define not exposed to user space).
....@@ -212,6 +211,95 @@
212211 bool invalid;
213212 };
214213
214
+/**
215
+ * enum drm_mode_status - hardware support status of a mode
216
+ * @MODE_OK: Mode OK
217
+ * @MODE_HSYNC: hsync out of range
218
+ * @MODE_VSYNC: vsync out of range
219
+ * @MODE_H_ILLEGAL: mode has illegal horizontal timings
220
+ * @MODE_V_ILLEGAL: mode has illegal vertical timings
221
+ * @MODE_BAD_WIDTH: requires an unsupported linepitch
222
+ * @MODE_NOMODE: no mode with a matching name
223
+ * @MODE_NO_INTERLACE: interlaced mode not supported
224
+ * @MODE_NO_DBLESCAN: doublescan mode not supported
225
+ * @MODE_NO_VSCAN: multiscan mode not supported
226
+ * @MODE_MEM: insufficient video memory
227
+ * @MODE_VIRTUAL_X: mode width too large for specified virtual size
228
+ * @MODE_VIRTUAL_Y: mode height too large for specified virtual size
229
+ * @MODE_MEM_VIRT: insufficient video memory given virtual size
230
+ * @MODE_NOCLOCK: no fixed clock available
231
+ * @MODE_CLOCK_HIGH: clock required is too high
232
+ * @MODE_CLOCK_LOW: clock required is too low
233
+ * @MODE_CLOCK_RANGE: clock/mode isn't in a ClockRange
234
+ * @MODE_BAD_HVALUE: horizontal timing was out of range
235
+ * @MODE_BAD_VVALUE: vertical timing was out of range
236
+ * @MODE_BAD_VSCAN: VScan value out of range
237
+ * @MODE_HSYNC_NARROW: horizontal sync too narrow
238
+ * @MODE_HSYNC_WIDE: horizontal sync too wide
239
+ * @MODE_HBLANK_NARROW: horizontal blanking too narrow
240
+ * @MODE_HBLANK_WIDE: horizontal blanking too wide
241
+ * @MODE_VSYNC_NARROW: vertical sync too narrow
242
+ * @MODE_VSYNC_WIDE: vertical sync too wide
243
+ * @MODE_VBLANK_NARROW: vertical blanking too narrow
244
+ * @MODE_VBLANK_WIDE: vertical blanking too wide
245
+ * @MODE_PANEL: exceeds panel dimensions
246
+ * @MODE_INTERLACE_WIDTH: width too large for interlaced mode
247
+ * @MODE_ONE_WIDTH: only one width is supported
248
+ * @MODE_ONE_HEIGHT: only one height is supported
249
+ * @MODE_ONE_SIZE: only one resolution is supported
250
+ * @MODE_NO_REDUCED: monitor doesn't accept reduced blanking
251
+ * @MODE_NO_STEREO: stereo modes not supported
252
+ * @MODE_NO_420: ycbcr 420 modes not supported
253
+ * @MODE_STALE: mode has become stale
254
+ * @MODE_BAD: unspecified reason
255
+ * @MODE_ERROR: error condition
256
+ *
257
+ * This enum is used to filter out modes not supported by the driver/hardware
258
+ * combination.
259
+ */
260
+enum drm_mode_status {
261
+ MODE_OK = 0,
262
+ MODE_HSYNC,
263
+ MODE_VSYNC,
264
+ MODE_H_ILLEGAL,
265
+ MODE_V_ILLEGAL,
266
+ MODE_BAD_WIDTH,
267
+ MODE_NOMODE,
268
+ MODE_NO_INTERLACE,
269
+ MODE_NO_DBLESCAN,
270
+ MODE_NO_VSCAN,
271
+ MODE_MEM,
272
+ MODE_VIRTUAL_X,
273
+ MODE_VIRTUAL_Y,
274
+ MODE_MEM_VIRT,
275
+ MODE_NOCLOCK,
276
+ MODE_CLOCK_HIGH,
277
+ MODE_CLOCK_LOW,
278
+ MODE_CLOCK_RANGE,
279
+ MODE_BAD_HVALUE,
280
+ MODE_BAD_VVALUE,
281
+ MODE_BAD_VSCAN,
282
+ MODE_HSYNC_NARROW,
283
+ MODE_HSYNC_WIDE,
284
+ MODE_HBLANK_NARROW,
285
+ MODE_HBLANK_WIDE,
286
+ MODE_VSYNC_NARROW,
287
+ MODE_VSYNC_WIDE,
288
+ MODE_VBLANK_NARROW,
289
+ MODE_VBLANK_WIDE,
290
+ MODE_PANEL,
291
+ MODE_INTERLACE_WIDTH,
292
+ MODE_ONE_WIDTH,
293
+ MODE_ONE_HEIGHT,
294
+ MODE_ONE_SIZE,
295
+ MODE_NO_REDUCED,
296
+ MODE_NO_STEREO,
297
+ MODE_NO_420,
298
+ MODE_STALE = -3,
299
+ MODE_BAD = -2,
300
+ MODE_ERROR = -1
301
+};
302
+
215303 /*
216304 * Subsystem independent description of a videomode.
217305 * Can be generated from struct display_timing.
....@@ -233,12 +321,16 @@
233321 };
234322
235323 struct drm_display_mode *drm_mode_create(void);
324
+void drm_mode_copy(struct drm_display_mode *dst,
325
+ const struct drm_display_mode *src);
236326 void drm_mode_destroy(struct drm_display_mode *mode);
237327 bool drm_mode_match(const struct drm_display_mode *mode1,
238328 const struct drm_display_mode *mode2,
239329 unsigned int match_flags);
240330 bool drm_mode_equal(const struct drm_display_mode *mode1,
241331 const struct drm_display_mode *mode2);
332
+void drm_display_mode_from_videomode(const struct videomode *vm,
333
+ struct drm_display_mode *dmode);
242334 void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
243335 struct videomode *vm);
244336