Re: [PATCH 7/7] drm/mgag200: Split up connector's mode_valid helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 12.05.22 um 12:38 schrieb Jocelyn Falempe:
...

One suggestion to avoid too much repetition:

static int mgag200_get_bandwidth_kbps(mdev) {

     if (IS_G200_SE(mdev)) {
         u32 unique_rev_id = mdev->model.g200se.unique_rev_id;

         if (unique_rev_id == 0x01) {
             return 24400;
         } else if (unique_rev_id == 0x02) {
             return 30100;
     ...

     } else if (mdev->type == G200_ER) {
         return 55000;
     }
     /* No bandwidth defined */
     return 0;
}

then in mgag200_mode_config_mode_valid()

int g200_bandwidth = mgag200_get_bandwidth_kbps(mdev);

if (g200_bandwidth && mgag200_calculate_mode_bandwidth(mode, max_bpp * 8) > g200_bandwidth * 1024)
     return MODE_BAD;


FYI that code will soon be parameterized via model-specific constants.

Best regards
Thomas



I've also tested this patchset, and have seen no regression.

you can add

Reviewed-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
Tested-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>

for the whole series.


--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux